Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Call Oracle store procedure
Message
General information
Forum:
Visual FoxPro
Category:
Client/server
Miscellaneous
Thread ID:
00647076
Message ID:
00651994
Views:
39
Put the following code after editing it for your situation into a script [text] file [myscript.sql]. Use Notepad to do so:
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.
You call the SP from VFP using this syntax:
lcSQL = "{call SCHEMA_NAME.CustomerGetByLastName.ReturnCursor('"
      + alltrim(ThisForm.txtLastName.Value) + "')}"
lnRetVal = SQLEXEC(gnHandle, lcSQL, 'crsCustomer')
Mark McCasland
Midlothian, TX USA
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform