Stephen Russell wrote:
> On Mon, Mar 31, 2008 at 10:30 AM, Ricardo Araoz <[EMAIL PROTECTED]> wrote:
> 
>> Hi,
>>
>> I'm sending the following script to SQLServer 2000 using SQLexec() (this
>> is VFP 6.0 SP5).
>>
>> <code>
>> declare @ult smallint
>>
>> update adm35.prv set @ult = prvretgan = prvretgan+1 where prvid = 161
>>
>> select @ult as 'Ultimo'
>> </code>
>>
>> I was expecting SQLexec to return a cursor with one tuple with the value
>> of the new prvretgan value, I get no cursor.
>> Any suggestions?
>>
>> TIA
>>
> -------------------------------------------------------------
> 
> It doesn't work that way:
> 
> Update TableName
> Set columnName = functionOfChoice
> where clause
> 
> update adm35.prv
> set @ult = prvretgan = prvretgan+1
> where prvid = 161
> 
> Maybe you had a typo in this posting or your orig code is wrong
> 
> HTH
> 
> 

It does work, I've tried it from inside SQLServer. It will update the 
field prvretgan and put the updated value in @ult. Maybe it's an 
SQLServer lingo.
Anyway, same thing happens when I declare a variable or use temporal 
tables (#table) in a script I send with sqlexec(), though the behavior 
is not consistent, sometimes it will work (this means that a given 
script will always work whilst others will never return the cursor).





_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://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