Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Oracle and FOxPro - Calling stored procs
Message
From
17/05/2001 21:59:11
Les Chandra
Mastersoft Pty Ltd
Melbourne, Australia
 
 
To
17/05/2001 18:59:07
Christian Cote
Les Logiciels Onoma Inc.
Longueuil, Quebec, Canada
General information
Forum:
Visual FoxPro
Category:
Client/server
Miscellaneous
Thread ID:
00508447
Message ID:
00508569
Views:
21
It depends on which ODBC driver you are using. The Microsoft drivers work with the CALL syntax, the Oracle ones don't. (The latest Oracle drivers have a SQL-server workaround to enable CALL syntax - haven't tried this).

Both drivers will work with this work around:

=SQLEXEC(h, 'begin SP_MYPROC ; end;)

Basically, what you are doing is sending down an PL/SQL anonymous block. You can test it in SQL*Plus:

SQL> begin
2 sp_myproc ;
3 end ;
4 /


If you want to run a stored procedure/package that returns results, there is a complex syntax that only works on the MS drivers. I can try to dig it out if you need it, but I hope (for your sake) not :)
HTH

Les




>I did not try with SPT but I did it successfully with ADO. Maybe you could try this :
>
>*************************************
>** Description of variables used **
>* h = handle
>* ORADSN = datasource name
>* USERID = user id
>* PWD = password
>**************************************
>
> h=SQLConnect("ORADSN","USERID","PWD") && Establish a connection
>
> IF h > 0
>
> WAIT WINDOW "Connection Successful" NOWAIT
> =SQLExec(h,"{Call SP_MYPROC}") && Execute the stored procedure
> =SQLDisconnect(h) && Terminate the connection
>
> ELSE
>
> WAIT WINDOW "Connection Failed"
>
> ENDIF
>I found it on MSDN.
>
>HTH,
>Christian Cote
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform