Hi Again,

Problem found:
The "field1" below had actually started with a number.  Apparently this 
isn't allowed in queries - but it is allowed in table creates!

Thank you,
      Noah Silva
      Atofina IS&T - Sr. Programmer Analyst
      (215) 419 - 7916





"Noah J SILVA" <[EMAIL PROTECTED]>
05/25/2004 04:27 PM

 
        To:     [EMAIL PROTECTED]
        cc: 
        Subject:        RE: Question about UPDATE query syntax


Hi again,

I did a little more digging, and found the post below, which is similar to 

one way I tried writing my query, and yet my query didn't work still:

the query I am running (with some field names changed ...) is:

update table1 a
set field1 = (select amount 
                      from table2 b 
                      where a.key=b.key
                      and a.thedate=b.thedate
                      and a.ckno = b.ckno
                      and b.code='abcd')

This query is the same as the one below, except that the subquery is more 
complex.

The error given is:
---- Error -------------------------------
Auto Commit: On, SQL Mode: Internal, Isolation Level: Committed
General error;-5006 POS(21) Missing identifier.

it is complaining about the "field1" part ??

Thank you,
      Noah Silva
      Atofina IS&T - Sr. Programmer Analyst
      (215) 419 - 7916





"PcgScrapAddy" <[EMAIL PROTECTED]>
03/21/2004 03:13 PM

 
        To:     "Andris Spruds" <[EMAIL PROTECTED]>, 
<[EMAIL PROTECTED]>
        cc: 
        Subject:        RE: Question about UPDATE query syntax


don't use the 'c' alias and it will run ok.

-----Original Message-----
From: Andris Spruds [mailto:[EMAIL PROTECTED]
Sent: Sunday, March 21, 2004 1:25 PM
To: [EMAIL PROTECTED]
Subject: Question about UPDATE query syntax


Hello MaxDB list,

I have problems understanding the correct syntax of a particular UPDATE
statement. The query, which seems a pretty standard query for me, does not
work:

'update ar_comments c set c.author = (select u.username from users u where
u.id = c.author_id)'.

It complains about '-5016 Missing delimiter:='. The query, however, 
executes
just fine if 'c.author' is replaced with just 'author'. Is this a bug or
more likely, it's just my wrong understanding of SQL?

Best regards,
Andris Spruds








--
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]





-- 
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]

Reply via email to