Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Pass by Ref Error w/Oracle Package
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00621675
Message ID:
00625031
Vues:
12
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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform