If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Informix > update field from other table

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 11-19-04, 05:46
Themis Themis is offline
Registered User
 
Join Date: Nov 2004
Posts: 6
update field from other table

Need help.
My employer asked me to update multiple records in a table using data from another table. I am experienced with SQL but I am relatively new to Informix.. I am not a programmer though.

It seems that the common (access, MS SQL Server) syntax joining the two tables is not understandable with Informix.

what I am used to:

update table1
set table1.field2=table2.field2
from table1 inner join table2 on table1.field1=table2.field1

Informix Dynamic Server 9.4 on SuSE SLES 8

Thanx.
Reply With Quote
  #2 (permalink)  
Old 11-19-04, 10:23
nog nog is offline
Registered User
 
Join Date: Nov 2004
Posts: 26
Quote:
Originally Posted by Themis
Need help.
My employer asked me to update multiple records in a table using data from another table. I am experienced with SQL but I am relatively new to Informix.. I am not a programmer though.

It seems that the common (access, MS SQL Server) syntax joining the two tables is not understandable with Informix.

what I am used to:

update table1
set table1.field2=table2.field2
from table1 inner join table2 on table1.field1=table2.field1

Informix Dynamic Server 9.4 on SuSE SLES 8

Thanx.
update table1
set table1.field2 = (select table2.field2 from table2 where table1.field1=table2.field1)
where table1.field1 in (select table2.field1 from table2)
Reply With Quote
  #3 (permalink)  
Old 11-19-04, 10:55
Themis Themis is offline
Registered User
 
Join Date: Nov 2004
Posts: 6
Everything worked, thanx for your help.
Cheers!!!
Reply With Quote
  #4 (permalink)  
Old 11-19-04, 10:56
Themis Themis is offline
Registered User
 
Join Date: Nov 2004
Posts: 6
Everything worked fine, thanx for your help.
Cheers!!!
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On