Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Oracle stored function
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00926057
Message ID:
00926104
Views:
26
>Hi all,
>
>Trying to call a stored function from vfp5 using odbc, not ado. I'm having issues with the correct syntax of the statement. Can I not use the standard vfp sqlexec() command? ( i.e. sqlexec( connhandle, "{call package.function()}, "returncursor" ) Any help would be great since my customer has no clue on this, and frankly, neither do I.
CREATE OR REPLACE PACKAGE CustomerGetByID AS
 Type RetCursor Is Ref Cursor;
 Procedure ReturnCursor(
   pCursor OUT RetCursor,
   nKeyID IN Customer.KeyID%Type);
END;
/
show error
CREATE OR REPLACE PACKAGE BODY CustomerGetByID AS
 Procedure ReturnCursor(
   pCursor OUT RetCursor,
   nKeyID IN Customer.KeyID%Type)
 IS
 Begin
  open pCursor for
    select * FROM Customer where KeyID = nKeyID;
 End;
END;
/
show error
The VFP code is:
lcSQL = "{call CustomerGetByID.ReturnCursor(" ;
      + TRANSFORM(This.nKeyID) + ")}"
lnRetVal = SQLEXEC(nHandle, lcSQL, 'crsCustomer')
Mark McCasland
Midlothian, TX USA
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform