If the SQLEXEC calls an sp it gets the return value from the sp (which the author of the sp can use to indicate if the command was executed successfully etc. ). The code I posted /should/ also give a result in the OUT parameter passed (by reference) to the sp (I don't have a db to test it on so I can't check if it works [on MySQL] or whether it also returns a 'null' cursor e.g. in SQLRESULT). Stored /functions/ are only available on the server, the functions and their results are out of scope outside server code. I am 95% certain that if you want function output at the client your only two options are a) SELECT the fn() (which will give you a VFP cursor) - or b) call the fn() in an sp, and call the sp in sqlexec with an @[IN]OUT parameter to get the result into a memvar - in my example I used ? just to show success/failure, you would of course assign it to a memvar. If anyone wants to play with this it would be interesting to know whether you canalso use sqlprepare() with an sp Call.

/caveat: this is mostly from memory, it is more years than I care to remember since I actually did it (ms SQL / Oracle - not MySQL). => AndyD/

On 17/01/2014 00:00, Richard Kaye wrote:
AFAIK SQLEXEC in VFP will always an integer value that indicates if the command 
was executed successfully. Any result set will end up in a VFP cursor.

--
rk

-----Original Message-----
From: ProfoxTech [mailto:[email protected]] On Behalf Of Stephen 
Russell
Sent: Thursday, January 16, 2014 1:05 PM
To: [email protected]
Subject: Re: Getting answer values from MySQL stored procedures

? SQLEXEC(lnConn, lCmd)

----------------------------------------------
Why not try:

MyVar =  SQLEXEC(lnConn, lCmd)

--
Stephen Russell


[excessive quoting removed by server]

_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: 
http://leafe.com/archives/byMID/profox/[email protected]
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to