On Tue, Jan 14, 2014 at 12:15 PM, <
[email protected]> wrote:

> On 2014-01-14 11:35, Stephen Russell wrote:
>
>> On Tue, Jan 14, 2014 at 9:40 AM, <
>> [email protected]> wrote:
>>
>>  VFP9SP2 on front end; MariaDB (MySQL) on backend
>>>
>>> I have a ton of stored procedures that return resulting calculations from
>>> sums.  I want to know the easiest way to get that value from the VFP
>>> call.
>>>  Right now, I'm doing something like this:
>>>
>>> SQLEXEC(this.iHandle,[call spCalcSumForRegion(?pcRegion,
>>> ?piLine)],"Answer") && call remote stored proc
>>> lnAnswer = eval("Answer." + field(1,"Answer") && only one value in result
>>> and that's the answer I want
>>> use in sele("Answer") && done with temp cursor
>>> return lnAnswer && have a nice day
>>> -----------------
>>>
>>
>>
>> This gets into the area of how often is this run and should you make it a
>> function that returns value?  Input params are pcRegion and piLine
>>
>> Now you could place the function call wherever needed in your code.
>>
>
>
> Steve,
>
> How does that answer my question?  I don't understand your response.  It's
> a calculation done several times over where those are the 2 input
> parameters.
> --------------
>

 I want to know the easiest way to get that value from the VFP call.

I said make it a function.  That returns a value right?  In your case you
need to pass in the params you have to present to the function.  I would
pass a collection object or an array to the function allowing you to
iterate through all of the param names and values you need to present via
ODBC to the backend.


Function SingleIntBack( iHandle, spName, spParams[])  returns lnAnswer   *
not sure how you return in VFP anymore

Loop through collection or array to define the vars you are passing.

SQLEXEC(iHandle,[ 'call' +  spName+ '('+?paramString'+)],"Answer") && call
remote stored proc
lnAnswer = eval("Answer." + field(1,"Answer") && only one value in result
return lnAnswer && have a nice day

end Function



-- 
Stephen Russell
Sr. Analyst
Ring Container Technology
Oakland TN

901.246-0159 cell


--- StripMime Report -- processed MIME parts ---
multipart/alternative
  text/plain (text body -- kept)
  text/html
---

_______________________________________________
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/cajidmyk0ss_yqawafs0_gww2r6-trquxvh_etg+ve8t1bqw...@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