Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

oracle select into array

helooOct 14 2019 — edited Oct 20 2019

declear
type function_array is varray(4) of varchar2(10);
function_id  function_array;

begin
SELECT 'AAB'||TO_CHAR(SubStr(Max(ID),6,3)+1) BLUK COLLECT INTO function_id FROM GSC_functions   WHERE ID LIKE 'AAB%' ORDER BY ID DESC;
SELECT 'AAB'||TO_CHAR(SubStr(Max(ID),6,3)+2) BLUK COLLECT INTO function_id FROM GSC_functions   WHERE ID LIKE 'AAB%' ORDER BY ID DESC;
for i in 1..function_id.count loop

dbms_output.put_line('function_id.count'|| function_id.count ||'FUNCTION:'||function_id(i));

end loop;

end;

/

i expect the function.count should be 2. but i don't know why it return 1.

how can i select into function_id(1) and function_id(2) to array of function_id?

or how to create two dimension array and then select into array.

This post has been answered by BEDE on Oct 14 2019
Jump to Answer
Comments
Post Details
Added on Oct 14 2019
9 comments
4,304 views