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!

how i will retrive rows from object type

453745Apr 4 2006 — edited Apr 4 2006
test is object type(varchar2,varchar2)
test1 is a object derived from test

test1(varchar2,varchar2,test);
how i will retrive rows from test1.



declare
type recf is ref cursor;
v_tab test1 := test1('a','b',test('c','d'));
rec recf;
begin
open rec for
select * from table(cast(v_tab as test1));
dbms_output.put_line('the rows are'||rec.test1.test11);
end;

when i compile this it return

ERROR at line 7:
ORA-06550: line 7, column 35:
PL/SQL: ORA-22907: invalid CAST to a type that is not a nested table or VARRAY
ORA-06550: line 7, column 1:
PL/SQL: SQL Statement ignored
ORA-06550: line 8, column 48:
PLS-00487: Invalid reference to variable 'REC'
ORA-06550: line 8, column 1:
PL/SQL: Statement ignored

error.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 2 2006
Added on Apr 4 2006
3 comments
471 views