1

All,

I've been fighting this issue for a little while, now, and it seems like there's something simple I'm missing, but I haven't been able to figure it out.

I'm trying to use a pl/sql nested table in APEX to collate and return data from disparate tables to a page view.

As a test, I created a nested table object and type:

CREATE OR REPLACE TYPE  "E_TEST" as object (
col1 varchar2(8),
col2 varchar2(16)
)
/

CREATE OR REPLACE TYPE  "E_TEST_TAB" as table of e_test
/

When I attempt to populate the nested table with this code:

declare
l_test e_test_tab := e_test_tab();
begin
l_test.extend;
l_test(l_test.last) := e_test_tab('testing','testing12345');
end

I get these errors:

ORA-06550: line 5, column 24:
PLS-00306: wrong number or types of arguments in call to 'E_TEST_TAB'
ORA-06550: line 5, column 24:
PLS-00306: wrong number or types of arguments in call to 'E_TEST_TAB'
ORA-06550: line 5, column 1:
PL/SQL: Statement ignored

I've been searching for an answer for a couple of days, but everything I can see says I'm creating and populating the object correctly, and searches related to the PLS-00306 error don't return much specific to the nested table context. I'm new to pl/sql, so there's a high probability that I've missed something simple, but the folks I know who might be able to help me don't use a lot of collections, so they're stumped by this one, as well.

Thanks in advance for your assistance.

Justin

1 Answer 1

3
declare
l_test e_test_tab := e_test_tab();
begin
l_test.extend;
l_test(l_test.last) := e_test('testing','testing12345');
end;
/

It has to be e_test() while assignment of individual record.
Only while initializing the nested collection we use e_test_tab()

Sign up to request clarification or add additional context in comments.

2 Comments

Thank you! Now, I need to get this to work in my much more complex function, but I have a place to begin sorting it out.
I had similar problems for a few weeks too. Just keep track of the progression from the record type to the table type. It's really subtle but makes all the difference.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.