Results 1 to 2 of 2
  1. #1
    Join Date
    Jan 2007
    Posts
    8

    Unanswered: 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

  2. #2
    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)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •