Cool....Borg SQL.

-----Original Message-----
From: u2-users-boun...@listserver.u2ug.org 
[mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Brian Leach
Sent: Friday, August 23, 2013 4:29 AM
To: 'U2 Users List'
Subject: Re: [U2] SQL Update Multiple rows

Hi Riverman

That's obviously TSQL and therefore Microsoft specific. You can get clever
in that way by mixing UniVerse SQL and EVAL expressions (which are the same
as inline IDescriptors in RetrieVe)

This should work the same as the example below:

UPDATE Product  SET Availability = EVAL "IF ProductId = 1 THEN 5 ELSE IF
ProductId = 2 THEN 5 ELSE IF ProductId = 6 THEN 5 ELSE Availability" ;


Brian

-----Original Message-----
From: u2-users-boun...@listserver.u2ug.org
[mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Riverman
Sent: 22 August 2013 18:23
To: u2-users@listserver.u2ug.org
Subject: [U2] SQL Update Multiple rows


Here is the SQL example I am trying to follow
                
UPDATE dbo.Product
       SET Availability=CASE When ProductId='1' Then '5'
                             When ProductId='2' Then '5'
                             When ProductId='6' Then '10'
                             Else Availability
                 END

My attempts

>UPDATE TESTFILE SET TRAN.NUMBER=CASE WHEN CONTROL.NUMBER.NFMT='9001' 
>THEN
'' WHEN CONTROL.NUMBER.NFMT='66551' THEN '' WHEN CONTROL.NUMBER.NFMT='1205'
THEN '' ELSE TRAN.NUMBER END;
UniVerse/SQL: A WHEN clause must have at least one multi-valued column

>UPDATE TESTFILE SET TRAN.NUMBER=CASE WHERE CONTROL.NUMBER.NFMT='9001' 
>THEN
'' WHERE CONTROL.NUMBER.NFMT='66551' THEN '' WHERE
CONTROL.NUMBER.NFMT='1205' THEN '' ELSE TRAN.NUMBER END;
UniVerse/SQL: syntax error.  Unexpected symbol.  Token was "THEN".
Scanned command was UPDATE RECEIPT SET TRANSACTION.H = CASE WHERE
CONTROL.NUMBER.NFMT = "900166550841" THEN 

Universe 10.1.1, Windows Server 2003



--
View this message in context:
http://u2-universe-unidata.1073795.n5.nabble.com/SQL-Update-Multiple-rows-tp
41681.html
Sent from the U2 - Users mailing list archive at Nabble.com.
_______________________________________________
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users


_______________________________________________
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users
_______________________________________________
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users

Reply via email to