Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Oracle and FOxPro - Calling stored procs
Message
 
À
17/05/2001 21:59:11
Les Chandra
Mastersoft Pty Ltd
Melbourne, Australie
Information générale
Forum:
Visual FoxPro
Catégorie:
Client/serveur
Divers
Thread ID:
00508447
Message ID:
00508607
Vues:
17
Can you not also use something like:

select theFunction(value) from dual;

(Dual is a dummy table in Oracle)

>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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform