Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Nested Update Possible?
Message
 
À
07/05/1998 06:35:43
Steve Camsell
Windmill Associates
Bath, Royaume Uni
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00097257
Message ID:
00097884
Vues:
21
>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.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform