***This is the code that works CREATE OR REPLACE PACKAGE Get_today_3 AS Type RetCursor Is Ref Cursor; Procedure ReturnCursor ( pCursor OUT RetCursor, cWarehouse IN detailbohoutput.warehouse%Type, cCompany IN detailbohoutput.company%Type ); END; / show error CREATE OR REPLACE PACKAGE BODY Get_today_3 AS Procedure ReturnCursor ( pCursor OUT RetCursor, cWarehouse IN detailbohoutput.warehouse%Type, cCompany IN detailbohoutput.company%Type ) IS Begin open pCursor for select * FROM detailbohoutput where asofdate = trunc(sysdate) -1 and warehouse = cWarehouse and company = cCompany ; End; END; / show errorThis is what I do to run it from VFP
*** I do the declare to let the proc know what is pCursor is TEXT TO lcSQL DECLARE TYPE CURSOR_TYPE_1 IS REF CURSOR; pcursor CURSOR_TYPE_1; begin get_today_3.returncursor(pcursor, ENDTEXT lcSQL = lcSQL + [']+ lcCompany + ['] + ',' + ['] +lcwarehouse + ['] + "); End;" lnRetVal = SQLEXEC(lnHandle, lcSQL, 'todays_view')lnRetVal comes back greater than 1 so I know it works.
Select todays_view && Errors out here because there isn't cursor open named 'Todays_view' *** As a matter of fact there isn't anything open at all browsePS. Right now I am using Microsoft ODBC for Oracle driver.