Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Informix SQL Update using an inner join

Status
Not open for further replies.

cwbloucks

Programmer
Dec 15, 2015
1
US
I have a need to update 270,000 records with a particular flag. Using temporary tables and multiple update queries I have creating a staging table to put the original value and the new value. So the table structure is like this:

Code:
ID      ORIG_VALUE     NEW_VALUE
1223    A              B
1234    D              A
1334    ...
I'm struggling with creating an efficient UPDATE query that will update these records in mass.

In MS SQL I have used an INNER JOIN to accomplish this, but it seems that Informix doesn't support that. Right now I'm structuring the query like this:

SQL:
UPDATE TABLEA
SET prod_field = (
  SELECT new_field
  FROM TABLEB_STAGING
  WHERE TABLEA.id = TABLEB_STAGING.id)

Is there a better way to accomplish this?

Thank you for any guidance!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top