Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Oracle and ODBC: returning cursor results from stored function
I have written an Oracle stored function which creates and returns a REF
CURSOR. Now I would like to return those results to VFP through the Oracle
ODBC driver.
CREATE OR REPLACE PACKAGE reseller AS
TYPE ref_cursor_type IS REF CURSOR;
FUNCTION reseller_rpt (START_DATE_IN IN DATE, END_DATE_IN IN DATE ) RETURN
ref_cursor_type;
END reseller;
CREATE OR REPLACE PACKAGE BODY reseller AS FUNCTION reseller_rpt (START_DATE_IN IN DATE, END_DATE_IN IN DATE ) RETURN ref_cursor_type IS
cursor_out ref_cursor_type;
BEGIN
.
.
.
RETURN cursor_out;
END;
END reseller;
Noted: Package and package body create without errors.
Noted: Report can be run in SQL*plus as follows:
SQL> variable c refcursor;
SQL> exec :c :=uaadmin.reseller.reseller_rpt(TO_DATE( '1-1-99',
'MM-DD-YY'),TO_DATE('1-31-99', 'MM-D
D-YY'));
SQL> print C;
returning 54 records.
Don't know the interface between Oracle and ODBC too well.
I have tried:
? SQLEXEC( gnSQLConnectionHandle, [{call seller.reseller_rpt( TRUNC( TO_DATE('1-1-1999', MM-DD-YYYY'),'DD'),TRUNC( TO_DATE('1-31-1999', 'MM-DD-YYYY'),'DD' ))}], 'reseller_cursor' )
with a striking lack of results: object 'reseller' does not exist.
Alan Lattimore Received on Thu Jan 28 1999 - 15:44:09 CST