Informix SQL Update using an inner join

5 pts.
Tags:
INNER JOIN
SQL
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:
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:
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!
0

Answer Wiki

Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

Discuss This Question:  

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

Thanks! We'll email you when relevant content is added and updated.

Following

Share this item with your network: