Home » SQL & PL/SQL » SQL & PL/SQL » Re: Arrays of Records ?
Re: Arrays of Records ? [message #36423] Tue, 27 November 2001 01:19
tinel
Messages: 42
Registered: November 2001
Member
try this:

create or replace TYPE A_RECORD AS OBJECT
(
sName CHAR,
nAge NUMBER(2)
);

create or replace TYPE rec_array AS VARRAY (10) OF a_Record;

DECLARE
recs rec_Array;
BEGIN
recs := rec_Array(A_Record('help',1),
A_Record('on',2),
A_Record('the',3),
A_Record('way',1));
FOR i IN 1..recs.COUNT LOOP
dbms_output.put_line(recs(i).sName);
END LOOP;
end;

----------------------------------------------------------------------
Previous Topic: Selecting a specific row number
Next Topic: Ref Cursor Exception
Goto Forum:
  


Current Time: Sun Mar 29 23:04:20 CDT 2020