Why doesn't this query work?
Posted in 1999
Topics: General Discussion
Help! I want to run this simple update query, but it doesn't work, it says it's got a syntax error. Any ideas? UPDATE ISMTMPRPTSTAGE1 E, ISMTMPRPTSTAGE2 F SET E.COUNTTAKENUP = F.TAKENUP WHERE (E.COMMCODE = F.COMMCODE) AND (E.CAMPCODE = F.CAMPCODE) Thanks Simon
Update statements can only take one table name. Only put ISMTMPRPSTAGE1 as the table you wish to update. Then, use a select statement to get the appropriate values from ISMTMPRPSTAGE2. Just to be sure, check out Informix's on-line documentation at their website. Their manual for SQL Syntax is there. Kind regards, John Bejarano. In article <7i19cd$om0$1@plutonium.btinternet.com>, "Simon Leigh" <simon.leigh@btinternet.com> wrote: > Help! I want to run this simple update query, but it doesn't work, it says > it's got a syntax error. > Any ideas? > > UPDATE ISMTMPRPTSTAGE1 E, ISMTMPRPTSTAGE2 F SET E.COUNTTAKENUP = F.TAKENUP > WHERE (E.COMMCODE = F.COMMCODE) AND (E.CAMPCODE = F.CAMPCODE) > > Thanks > > Simon > > -- <><><><><><><><> John Bejarano bebe stores, inc. <><><><><><><><> --== Sent via Deja.com http://www.deja.com/ ==-- ---Share what you know. Learn what you don't.---
Maybe this will show my ignorance on "modern" updates to SQL; but, in my twenty years (14 with Oracle) I've never used a single update statement to update two tables... Quite the novel idea, I guess; but, it doesn't work. Update each table in a separate statement... and obviously, have rows to update the meet the where clause... David Russell On Thu, 20 May 1999 16:19:48 +0100, "Simon Leigh" <simon.leigh@btinternet.com> wrote: >Help! I want to run this simple update query, but it doesn't work, it says >it's got a syntax error. >Any ideas? > >UPDATE ISMTMPRPTSTAGE1 E, ISMTMPRPTSTAGE2 F SET E.COUNTTAKENUP = F.TAKENUP >WHERE (E.COMMCODE = F.COMMCODE) AND (E.CAMPCODE = F.CAMPCODE) > >Thanks > >Simon > >