16 Replies Latest reply: Oct 8, 2010 9:38 AM by aJuanJoq RSS

    Howto use field-value previously charged in another sql statement in script

      I want to use the value of a field previously charged from a table by sql, in the next sql-statement. such as

       

      Table1:

      select CodeId, date from outTable1 where date = x;

       

      table2:

      select CodeId, other from outTable2 ...

      and now what I want, use the value of previous Table1.CodeId as selection for table2, sucha as

      where outTable2.CodeId in (select, load, exist wathever Table1.CodeId));

      I don´t know if I make myself understod.

      Supposedly Table1 is now resident, so I should be able to read Table1.CodeId to compare in teh script.

       

      Haven´t found solution.

       

      The hint is that outTable2 doesn´t have Date-field, I have to use the key-field CodeId to make an incremental load, of just new records on outTable1 and outTable2

       

      Thanks

      JuanJo