Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Pass by Ref Error w/Oracle Package
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00621675
Message ID:
00625031
Views:
17
You can get a cursor back from a SP as we have shown elsewhere here. The problem is you have to pass the variables by value instead of reference. In this case the order in which you pass the variables to the SP matters. For example:
CREATE OR REPLACE PACKAGE PermitGetByID AS
 Type RetCursor Is Ref Cursor;
 Procedure ReturnCursor(pCursor OUT RetCursor, nID IN Permits.KeyID%Type);
END;
/
show error
CREATE OR REPLACE PACKAGE BODY PermitGetByID AS
 Procedure ReturnCursor(pCursor OUT RetCursor, nKeyID IN Permits.KeyID%Type) is
 Begin
  open pCursor for
    select * FROM Permits where KeyID = nKeyID;
 End;
END;
/
show error
In VFP, the syntax is:
lcSQL = "{call PermitGetByID.ReturnCursor(" + TRANSFORM(This.nKeyID) + ")}"
lnRetVal = SQLExec(This.nHandle, lcSQL, 'crsPermit')
Until we can figure something else out with respect to passing by reference to a SP that returns a cursor, this is approach I/we have to take.
Mark McCasland
Midlothian, TX USA
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform