CREATE OR REPLACE PACKAGE CustomerGetByLastName AS Type RetCursor Is Ref Cursor; Procedure ReturnCursor(pCursor OUT RetCursor, cUser IN Customer.LastName%Type); END; / show error CREATE OR REPLACE PACKAGE BODY CustomerGetByLastName AS Procedure ReturnCursor(pCursor OUT RetCursor, cLastName IN Customer.LastName%Type) is Begin open pCursor for select * from SCHEMA_NAME.Customer where LastName = cLastName; End; END; / show error --Save the script file. I keep mine in a folder under my App development folder called SCRIPTS. Launch SQL*Plus and run this script file. You run it by typing @C:\AppDev\MyApp\Scripts\MyScript at the SQL prompt.
lcSQL = "{call SCHEMA_NAME.CustomerGetByLastName.ReturnCursor('" + alltrim(ThisForm.txtLastName.Value) + "')}" lnRetVal = SQLEXEC(gnHandle, lcSQL, 'crsCustomer')