René Nyffenegger's collection of things on the web | |
René Nyffenegger on Oracle - Most wanted - Feedback
- Follow @renenyffenegger
|
Declaration of record types in PL/SQL | ||
Declare a record variable whose fields correspond to the ones found in the table some_table:
declare some_rec some_table%rowtype;
Declaring record types:
declare type some_record_type is record (fld1 varchar2(10), fld2 number); type other_record_type is record ( foo date bar some_record_type, -- nested baz char(10));
A ref cursor can be constructed from a record type.
Declaring a record variable from a cursor:
declare cursor cur is select col_1, col_2, col_2 from some_table; rec cur%rowtype; |