[EMAIL PROTECTED] wrote: > > > Well this isn't necessarily true because if it were then this > statement > would work: > > UPDATE USERDB.RMA A SET A.ITEM_TOTAL = (SELECT > (SUM(B.WARRANTY_CHARGE) + > SUM(B.LABOR_CHARGE) + SUM(B.PARTS_CHARGE)) FROM > USERDB.RMA_ITEM B WHERE > B.RMA_ID = 2045001 AND B.ACTIVE='Y') WHERE A.RMA_ID = 2045001; > > error = General error;-5016 POS(27) Missing delimiter: =. > > running sapdb v7.4.0.46 on SuSE Linux >
This has nothing to do with the value or select behind the =, it has nothing to do with pseudo table names (a, b). It has only to do with the part of the statement shown by the position given in the error message, the 27.byte (and those following): you wrote UPDATE ... SET <tablename>.<columnname> And as the manual tells us (and as was discussed here some times), only a column name, but no tablename in front are allowed behind the SET. http://www.mysql.com/documentation/maxdb/8d/ff61682ec511d3a98100a0c9449261/frameset.htm For syntax errors (as missing delimiter is without doubt), the given position is very helpful to find the problem, i.e. where the parser found out that the correct sequence of syntax-elements was left/lost/not reached any more. He accepts a as the columnname and then struggles as the correct syntax needs a = behind, no ., no further identifier. Elke SAP Labs Berlin > -----Original Message----- > From: Zabach, Elke [mailto:[EMAIL PROTECTED] > Sent: Tuesday, February 17, 2004 12:19 AM > To: 'Jos� R�mulo El�as Contreras'; [EMAIL PROTECTED] > Subject: RE: Update from tables? > > > Jos� R�mulo El�as Contreras wrote: > > > > > How can I do an update of a table usign values from different > > tables to > > set it? > > > Use subqueries like this: > UPDATE t SET a = (SELECT col FROM base) > > Elke > SAP Labs Berlin > > -- > MaxDB Discussion Mailing List > For list archives: http://lists.mysql.com/maxdb > To unsubscribe: > http://lists.mysql.com/[EMAIL PROTECTED] > -- MaxDB Discussion Mailing List For list archives: http://lists.mysql.com/maxdb To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]
