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 -> Re: Returning a result set from a table using a stored procedure

Re: Returning a result set from a table using a stored procedure

From: <aglanvil_at_my-dejanews.com>
Date: Thu, 23 Jul 1998 17:11:53 GMT
Message-ID: <6p7qsp$47p$1@nnrp1.dejanews.com>

> >>> We're trying to return a table by calling a stored procedure which has a
> >>> select clause inside ( which looks like SELECT * FROM MYCUSTOMERS ).
> >>>

> create or replace package types
> as
> type cursorType is ref cursor;
> end;
> /
>
> create or replace function sp_ListEmp return types.cursortype
> as
> l_cursor types.cursorType;
> begin
> open l_cursor for select ename, empno from emp order by ename;
>
> return l_cursor;
> end;
> /
>
> REM SQL*Plus commands to use a cursor variable
>
> variable c refcursor
> exec :c := sp_ListEmp
> print c
>
> -----------------------------------------------------

How would you call the function sp_ListEmp using ODBC ? I have tried using {CALL function} but Oracle complains the function is not a procedure (which of course it isn't, it's a function). How can I CALL an Oracle stored function using ODBC ?

Adrian Glanvill
Sterling Commerce
Adrian_Glanvill_at_stercomm.com

-----== Posted via Deja News, The Leader in Internet Discussion ==----- http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum Received on Thu Jul 23 1998 - 12:11:53 CDT

Original text of this message

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