Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Running of the Oracle SP from VFP
Message
General information
Forum:
Visual FoxPro
Category:
Client/server
Miscellaneous
Thread ID:
00510968
Message ID:
00512371
Views:
16
This message has been marked as a message which has helped to the initial question of the thread.
I just used the ideas inside of that article and changed them to fit my cursor needs. Anyway, here is an idea of how I do it. Basically I had to create a package that returned an Oracle Cursor to VFP.

Create a package that returns a reference cursor. Pass this to your procedures within the package body. Each procedure will create a set of records by declaring a cusor and pass that back to you application. The call to the procedure from SQLEXEC is the same except you must reference the package body in the call:

retval = SQLEXEC( nHandle, '{CALL ReturnCursors.GetCustTrans}', tmpCursor )

I have placed the code for one of my packages below:
CREATE OR REPLACE PACKAGE ReturnCursors AS
TYPE RetCursor IS REF CURSOR;

PROCEDURE GetExpRecords(p_cursor OUT RetCursor,
InSource IN VARCHAR2);

PROCEDURE GetCustTrans(p_cursor OUT RetCursor);

PROCEDURE GetAccountList( p_cursor OUT RetCursor );

END ReturnCursors;
/

CREATE OR REPLACE PACKAGE BODY ReturnCursors AS

PROCEDURE GetExpRecords(p_cursor OUT RetCursor, InSource IN VARCHAR2) IS
BEGIN

OPEN p_cursor FOR
        SELECT RTRIM (product_id) expcode, RTRIM (charge_name) expcodename,
                RTRIM (charge_type) chargetype
           FROM vwLastChargeDetails
     WHERE RTRIM(product_id) IN
        (SELECT RTRIM(expcode)
        FROM expcodes
       WHERE RTRIM(source) = InSource);
END GetExpRecords;

PROCEDURE GetCustTrans(p_cursor OUT RetCursor) IS
BEGIN
OPEN p_cursor FOR
  SELECT * FROM custtrans;

END GetCustTrans;

PROCEDURE GetAccountList( p_cursor OUT RetCursor ) IS
BEGIN
OPEN p_cursor FOR
  SELECT account_number, relationship_name
    FROM fnbaa.relationship
   WHERE account_number IS NOT NULL
     AND close_date IS NULL;

END GetAccountList;


END ReturnCursors;
>Hi!
>
>That article describes the approach for Oracle OLEDB provider that you cannot use by VFP other way than through ADO. Do you have samples for pure VFP SQLEXEC command?
>
>Thanks!
Everything we see or seems
Is but a dream within a dream
- Edgar Allen Poe
Previous
Reply
Map
View

Click here to load this message in the networking platform