Hello all, I am having problems with a job and would like to ask everyone's input. I have a job that extracts data from a SQL server and then places the data on a AS400 table. I only need to insert the data if it doesn't already exist. When you use the self create SQL you can only select insert or insert/update, but I need a insert if not exists. I tryied to use a user-defined sql but can't figure out the syntax. Currently it has:
INSERT INTO ACSPRDDTA.APPDWNSC(APACCT, APAGREE, APINSDT, APUSERID) VALUES (?,?,?,?);
But I need it to be more like:
INSERT INTO ACSPRDDTA.APPDWNSC(APACCT, APAGREE, APINSDT, APUSERID) VALUES(from the input file) WHERE APACCT NO IN (SELECT APACCT FROM ACSPRDDTA.APPDWNSC)
Anyone help me with this?
Help On Output SQL
Moderators: chulett, rschirm, roy
Hi,
this was already discussed befor.
in short perform a lookup and use a constraint of NOTFOUND on the lookup input link.
this will cause only new data to pass on to the DB stage.
IHTH,
this was already discussed befor.
in short perform a lookup and use a constraint of NOTFOUND on the lookup input link.
this will cause only new data to pass on to the DB stage.
IHTH,
Roy R.
Time is money but when you don't have money time is all you can afford.
Search before posting:)
Join the DataStagers team effort at:
http://www.worldcommunitygrid.org
Time is money but when you don't have money time is all you can afford.
Search before posting:)
Join the DataStagers team effort at:
http://www.worldcommunitygrid.org
Hi,
you need only bring the key columns, that should be smaller in size.
the other way would be loading the entire thing to a table in the AS400 side and running a user defined SQL something to outer join hte 2 and load only records not in the existing target table.
or something similar
you can also perform a direct odbc lookup ot the AS400 table but that means 1 sql per input row sent to the AS400 which might be a problem.
IHTH,
you need only bring the key columns, that should be smaller in size.
the other way would be loading the entire thing to a table in the AS400 side and running a user defined SQL something to outer join hte 2 and load only records not in the existing target table.
or something similar
you can also perform a direct odbc lookup ot the AS400 table but that means 1 sql per input row sent to the AS400 which might be a problem.
IHTH,
Roy R.
Time is money but when you don't have money time is all you can afford.
Search before posting:)
Join the DataStagers team effort at:
http://www.worldcommunitygrid.org
Time is money but when you don't have money time is all you can afford.
Search before posting:)
Join the DataStagers team effort at:
http://www.worldcommunitygrid.org
Hi,
Lookup means build a hash file with keys and do a lookup via transformer stage and reference link to the hash or directly to the DB stage.
Lookup means build a hash file with keys and do a lookup via transformer stage and reference link to the hash or directly to the DB stage.
Roy R.
Time is money but when you don't have money time is all you can afford.
Search before posting:)
Join the DataStagers team effort at:
http://www.worldcommunitygrid.org
Time is money but when you don't have money time is all you can afford.
Search before posting:)
Join the DataStagers team effort at:
http://www.worldcommunitygrid.org