Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Nested Update Possible?
Message
 
To
07/05/1998 06:35:43
Steve Camsell
Windmill Associates
Bath, United Kingdom
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00097257
Message ID:
00097884
Views:
20
>Hello Barbara,
>
>>Steve, your select returns a cursor/query, not a number. Is this your exact code?
>>>
>>>UPDATE vueOrdLines ;
>>>SET iQty = ;
>>>	(SELECT MAX(iQty) from vueOrdLines)
>>>WHERE ...
>>>
>
>Yes, this is the exact syntax that I was trying. When I highlight the SELECT portion of the code and tell fox to execute the selection, it does return one number. I can run an almost identical query in SQL Server and it's perfectly happy. Unfortunately the info in the help file on the UPDATE-SQL command is really thin on the ground and the example is very simple. I suppose the crux of my question is can I embed a SELECT statement in an update statement? Maybe this is a really obscure requirement?

Steve, will it work if you break out the SELECT?
nNewQty = SELECT MAX(iQty) from vueOrdLines

UPDATE vueOrdLines ;
SET iQty = ;
WHERE ...
If so, then you have at least isolated the problem. If not, then there's a syntax error in your Update.

HTH
Barbara
Barbara Paltiel, Paltiel Inc.
Previous
Reply
Map
View

Click here to load this message in the networking platform