Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> problem using user-defined table types and cursors

problem using user-defined table types and cursors

From: Mike <hikemike_at_gmail.com>
Date: 23 Feb 2006 14:29:52 -0800
Message-ID: <1140733792.500572.206790@t39g2000cwt.googlegroups.com>


I am trying to compile the following stored procedure code:

but I get the error

Line # = 19 Column # = 66 Error Text = PL/SQL: ORA-00902: invalid datatype

for the line:
OPEN v_ref_cursor FOR SELECT user_id from TABLE (CAST (t_id AS id_type));
the problem (column #=66) is id_type

i am trying to do a bulk-read of the user_id column from a table returned by the function (get_acl_accounts(userId) into a table of type id_type and then open a cursor on it.



 (
  genericcursor OUT SYS_REFCURSOR,
  userId IN account.users.user_id%TYPE,
  addressIn IN account.nodes.address%TYPE )
AS
  v_ref_cursor types.ref_cursor;
  user_id account.users.user_id%TYPE;
  TYPE id_type IS TABLE OF account.users.user_id%TYPE;   t_id id_type;
BEGIN   select user_id
  BULK COLLECT INTO t_id FROM
        (SELECT DISTINCT user_id FROM TABLE (
           account.get_acl_accounts(userId)
  ));

/* LINE 19 */   OPEN v_ref_cursor FOR SELECT user_id from TABLE (CAST (t_id AS id_type));  

END update_acl_addresses_proc; Received on Thu Feb 23 2006 - 16:29:52 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US