Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> SELECT FROM TABLE(CAST... failure
9iR2
Why is the SELECT failing ?
thanks
SQL> CREATE OR REPLACE TYPE email_demo_obj_t AS OBJECT (
2 email_id NUMBER, 3 demo_code NUMBER, 4 value VARCHAR2(30));
Type created
SQL> CREATE OR REPLACE TYPE email_demo_nt_t AS TABLE OF email_demo_obj_t; 2 /
Type created
SQL> CREATE OR REPLACE PACKAGE testpkg IS
2 eml_dmo_nt email_demo_nt_t ;
3 PROCEDURE alpha ;
4 END testpkg;
5 /
Package created
SQL>
SQL> CREATE OR REPLACE PACKAGE BODY testpkg IS
2
3 PROCEDURE alpha IS
4 BEGIN
5 eml_dmo_nt := email_demo_nt_t(); 6 eml_dmo_nt.EXTEND(3); 7 eml_dmo_nt(1) := email_demo_obj_t(45, 3, '23'); 8 eml_dmo_nt(2) := email_demo_obj_t(22, 3, '41'); 9 eml_dmo_nt(3) := email_demo_obj_t(18, 7, 'over_100k');10 END;
Package body created
SQL> exec testpkg.alpha
PL/SQL procedure successfully completed
SQL> SELECT * FROM TABLE(CAST(testpkg.eml_dmo_nt AS email_demo_nt_t)) ;
SELECT * FROM TABLE(CAST(testpkg.eml_dmo_nt AS email_demo_nt_t))
ORA-06553: PLS-221: 'EML_DMO_NT' is not a procedure or is undefined Received on Thu Jul 06 2006 - 14:22:41 CDT
![]() |
![]() |