| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
|  |  | |||
Home -> Community -> Usenet -> c.d.o.misc -> Re: Ref cursor from stored procedure for use in Forms 6
Heiko wrote:
> Hi, I'm trying desperately to register a function on the server which
> will return a ref cursor for use in a data block in Forms.
>
> Can someone find the error in the code at the end of the posting and
> do you know how to use the ref cursor in the datablock (by a trigger
> or simply by a property?)
>
> Thanks a lot!!!
>
> Heiko Kopitzki
>
> ******CODE******
>
> CREATE FUNCTION ts( prodid_para IN INT ) RETURN REF CURSOR
> IS
>   TYPE result_type IS RECORD (
>     clientId NUMBER(4),
>     clientName VARCHAR2,
>     clientAdresse VARCHAR2
>   );
>
>   TYPE result_cursor_type IS REF CURSOR RETURN result_type;
>   rc result_cursor;  -- declare cursor variable
>
>   rc IS
>     SELECT client.custid, client.name, client.address FROM client,
> produit, ligne_comm, commande
>       WHERE client.custid = commande.custid
>       AND commande.ordid = ligne_comm.ordid
>       AND produit.prodid = prodid_para;
>
> BEGIN
>   RETURN rc;
> END;
> /
> show errors
You ended your posting with "show errors".
Too bad you didn't. ;-)
Daniel Morgan Received on Tue May 28 2002 - 14:29:48 CDT
|  |  |