I wonder if you could change the type of execution against the db to fit
the data it is going to output?

I use an ExecuteScalar() in my C# code when I am getting this single
row/column return.

Not sure in VFP you can set that but just giving you something to look for.

string value = (string)command.ExecuteScalar();  This is how my statement
is, and yoiu do not need that (string) in front like I show.


On Thu, Jan 16, 2014 at 6:33 AM, AndyHC <[email protected]> wrote:

> Personally I always found it /convenient/ to get results in Fox cursors (I
> even struggled with Oracle RefCursors to do it!) however:
> I don't know mySQl but for SQL Server or Oracle some variation of the
> following should work:
>
> use
> lConn = && insert your conn string or etc.
> * we assume an sp that accepts 2 IN parms (char, int) and one [IN]OUT parm
> (int)
> lInParm1 = 'mykey'
> lInParm2 = 123
> lOut = 0
> lCmd = "exec myDB.mysp(?lInParm1, ?lInParm2, ?@lOut"  && pass by reference.
> ? SQLEXEC(lnConn, lCmd)
> ?lOut
> browse  && is there an empty cursor?
>
>
> On 16/01/2014 04:34, Mike Copeland wrote:
>
>> Like you, I would also like to know if there is any way to retrieve a
>> value, for example just one field from one table, from a MySQL or MariaDB
>> server without going through the process of receiving it into a VFP table,
>> then accessing the table and the table's field, and then closing the table.
>> Like, just return the value into a memvar...
>>
>> Maybe what seems to be a multi-step process is all just semantics to
>> standardize the process interface due to the ExecSQL?
>> Maybe VFP really isn't creating files on disk like it appears?
>> Maybe encapsulating the process in a function to hide the lengthy
>> mechanism would hide the complexity and "solve" the problem?
>> Maybe that's what everyone is talking about already?
>>
>> Mike Copeland
>>
>>
>> -------- Original Message --------
>> Subject: Re: Getting answer values from MySQL stored procedures
>> From: [email protected]
>> To: [email protected]
>> Date: 1/15/2014 4:40 PM
>>
>>> On 2014-01-15 11:55, Paul McNett wrote:
>>>
>>>> On 1/14/14 11:37 AM, Stephen Russell wrote:
>>>>
>>>>> So you have to rewrite this similar code block for every time you have
>>>>> this
>>>>> need?  That would never make it in one of our builds.  As you save your
>>>>> code it would cough up that hairball.
>>>>>
>>>>
>>>> Don't rewrite the same or similar code over and over. Don't even do it
>>>> once. Take the
>>>> 5 minutes now to make a new function, seriously.
>>>>
>>>> Don't Repeat Yourself (at least try as hard as you can not to).
>>>>
>>>
>>>
>>> Of course!  I don't know why it sounded (if it did?) that I would be
>>> repeating any code.  I just wanted to know the easiest way in VFP to
>>> receive a return value from a MySQL function.
>>>
[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/CAJidMYKup_baidVVSQv8HRM3wC3RZ+YQjo=pzocn+_dhsce...@mail.gmail.com
** 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