Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How do I execute a VFP stored procedure using SQLEXEC()/
Message
From
14/09/1998 10:34:39
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
General information
Forum:
Visual FoxPro
Category:
Client/server
Miscellaneous
Thread ID:
00135933
Message ID:
00136170
Views:
33
Hidy Kamal,
I also later noticed I have added other procs while old handle was alive. Good news order of proc and length doesn't bother :) I could understand why #define doesn't work but will need experimenting before really using. It's good to know it works with vital ones :) One row dummy table is the best for "cheat". I created that dummy before select and drop after select. Here is my working copy code :
sqlexec(gnConnHandle,"create table dummy (mydummy L)")
sqlexec(gnConnHandle,"insert into dummy values (.f.)")
cSQL = "select "+;
	"getmykey(3,[testtable]) as retval1,"+;
	" getkey(5) as retval2,"+;
	" check() as retval3 from dummy"
sqlexec(gnConnHandle,cSQL)
? retval1, retval2, retval3
sqlexec(gnConnHandle,"drop table dummy")
Cetin

>Hi Cetin,
>
>This is really a good cheat. The good news though is that it works. From my testing on Codebook's NewId function to get new id's from VFP StoredProcedure. What I found that #DEFINES don't work, though functions like LOCK, UNLOCK, SEEK, EVAL work perfectly. The length of the name of the function, the position i.e. 1st one, 2nd one etc also does not matter.
>
>What is required is an table with an single record on which the select can be issued to return just one row.
>
>I tested this on local machine (NT workstation) and a remote one too (NT Server) and the results have been positive. Though the one on the server was a little slower... obviously... but this time it was slower than running a query but the results returned were right.
>
>This was also tested on VFP 5 (Build 415) and VFP6 and worked at both the places.
>
>>Only a cheat (select storedproc(parm) as result ...) but that also succeeds if "storedproc is the first proc in stored procs.
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform