Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Oracle SP
Message
 
 
To
09/09/2003 14:24:10
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Miscellaneous
Thread ID:
00827590
Message ID:
00827596
Views:
11
The VFP syntax is something like:
LOCAL lcSQL, lnRetVal
PRIVATE nEmpPersNo, cEmplName, nPersNo, cLoginID
nEmpPersNo = 0
cEmplName  = SPACE(30)
nPersNo    = 0
cLoginID   = SPACE(8)

lcSQL = "begin Schema.GetEmplInfoSP(" ;
   + "pnEmpPersNo=>?nEmpPersNo, " ;
   + "pcEmplName=>?@cEmplName, " ;
   + "pnPersNo=>?@nPersNo, " ;
   + "pcLoginId=>?@cLoginID); end;"
lnRetVal = SQLEXEC(goApp.nConnectionHandle, lcSQL)
The variables on the left side of the "=>" are the names of the variables in the Oracle SP. The ones on the right side are the VFP variable names. The SP will stuff the "OUT" variable values into your VFP variables.

>Hi All,
>
>I created the following stored procedure & compiled it in an Oracle database.
>
>CREATE OR REPLACE PROCEDURE GetEmplInfoSP( pnEmpPersNo NUMBER,
>pcEmplName OUT VARCHAR2,
>pnPersNo OUT NUMBER,
>pcLoginId OUT VARCHAR2)
>
>IS
>
>BEGIN
>
>SELECT RTRIM(PERS.last_name) || ', ' || RTRIM(PERS.first_name) AS Employee, EMP.pers_no, EMP.login_lvl
>INTO pcEmplName, pnPersNo, pcLoginId
>FROM EMP,PERS
>WHERE EMP.pers_no = PERS.pers_no (+)
> AND EMP.pers_no = pnEmpPersNo
>ORDER BY PERS.last_name, PERS.first_name;
>
>END GetEmplInfoSP;
>
>What I was hoping to get was a cursor with the 3 fields I requested. But I've no idea the syntax for query.
>
>sqlexec(nSatHandle, ??????, 'test_cursor')
>
>TIA
>Mike
>
>P.S. VFP 6 SP5
Mark McCasland
Midlothian, TX USA
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform