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 > Need Example Update from triple Temp Table

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 04-23-07, 14:19
Err Err is offline
Registered User
 
Join Date: Jan 2007
Posts: 8
Need Example Update from triple Temp Table

Hi,

I am running: IBM Informix Dynamic Server Version 9.40.FC7


My Temp Table looks like this:

Drink_Code|Version|Number_in_stock|
Beer12|5|123|
Beer13|4|321|
Wine45|15|987|
Wine723|98|567|


Traditionally I am able to update this one record at a time with an update from sql that looks like this:

Code:
update drink0 set drink0.stockno = "123" where drink0.code = "Beer12" and drink0.version = "05";
Does someone have an example where I can update using data from my temp table?

Thanks,

-Eric
Reply With Quote
  #2 (permalink)  
Old 05-03-07, 16:52
Err Err is offline
Registered User
 
Join Date: Jan 2007
Posts: 8
Thanks for the overwhelming support. For anyone else looking for this -The answer is:

Code:
update drink0 set drink0.stockno = (select t_table.Number_in_stock from 
	t_table where t_table.Drink_Code = drink0.code) where
	drink0.code in (select t_table.Drink_Code from t_table)
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