Why doesn't this query work? 
Author Message
 Why doesn't this query work?
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



Wed, 18 Jun 1902 08:00:00 GMT
 Why doesn't this query work?

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.



Quote:
> 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.---



Wed, 18 Jun 1902 08:00:00 GMT
 Why doesn't this query work?

Hi !

You cannot give two table names in the UPDATE command as you have given,
so you will have to give another sub-query to select the value for the
field.

So then your query will look like this :-

update tab1
set tab1.field1 = (select field1 from tab2 where field1="abc")
where field2 = "xyz"

Hope that will help...

Nayan Jain's little drop in Informix Ocean !

Good Luck,
Nayan !
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

"Only that man can take a right decision,
whose soul is not tormented by the afflictions of attachment and aversion."

                                        -- Mahavira


Quote:
> Simon Leigh  (20.05.1999  17:19):
> >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

> Hi!



Wed, 18 Jun 1902 08:00:00 GMT
 Why doesn't this query work?

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"

Quote:

>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



Wed, 18 Jun 1902 08:00:00 GMT
 
 [ 4 post ] 

 Relevant Pages 

1. Why doesn't this query work?

2. Why doesn't this query work?!

3. Why doesn't this query work?!

4. ActiveX Query - Why doesn't this work?

5. Why doesn't this mySQL query work?

6. ORACLE DOESN'T COMPLY TO BASIC STANDARD SQL: SIMPLE QUERIES DOESN'T WORK

7. Query works in SQL Query Analyzer but doesn't work in DTS

8. Why oh why doesn't this work?

9. Why doesn't this query work part 2...

10. Why this code doesn't work?

11. Why doesn't this work?

12. why doesn't this work?


 
Powered by phpBB® Forum Software