Posted: Thu Dec 13, 2007 8:26 am Post subject: esql query help
Novice
Joined: 19 Sep 2007 Posts: 11
Hi ,
Need some basics on query in esql.
Scenario:
IF((SELECT COUNT(*) FROM Database.Column1 AS T
WHERE T.YYY = InputRoot.XML.YYY) )
THEN
UPDATE Column2
T.WWW=InputRoot.XML.WWW
Where T.YYY= InputRoot.XML.YYY
T.PPP=InputRoot.XML.PPP
Need this kind of query in general form.The two columns 1 & 2 has almost same information but column 2 has extra info,which needs to be updated only when I get the status from from column1(under the condition T.YYY=InputRoot.XML.YYY ) ,if not no action on column2.It would be great if you can help me on this today.Thanks
Your IF condition is not checking the Selected value against the InputRoot YYY value....instead it is simply returning an integer....I hope this is not your code and that you are only trying to make us understand your issue...
Why don't you simply do an UPDATE with the WHERE clause....in this way you can avoid doing a SELECT and then an UPDATE....instead the update will only occur when the condition YYY = InputRoot.XML.YYY matches.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum