Link to home
Start Free TrialLog in
Avatar of DaniPro
DaniProFlag for Italy

asked on

array in stored procedure

Can i declare an array of varchar in a stored procedure or use a structure but calling the structure fields using their position in the structure instead of the name?
Avatar of slightwv (䄆 Netminder)
slightwv (䄆 Netminder)

To answer the first part:  Yes

declare
      type arrType is table of varchar2(50);
      myarr arrType;
begin
      myarr := arrType('a','b');
      dbms_output.put_line('First: ' || myarr(1));
      dbms_output.put_line('Second: ' || myarr(2));
end;
/


I'm not clear what you are asking on the second part.
Avatar of DaniPro

ASKER

Thank's for your replay, but i need to valorize my array with the field number.
Can i use a syntax like this?
myarr(1) := 'a'
myarr(2) := 'b'
ASKER CERTIFIED SOLUTION
Avatar of slightwv (䄆 Netminder)
slightwv (䄆 Netminder)

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial