I am using Kettle Pentaho data integration. I need to skip inserting IdN column from first table (first db) if it already exists int second table (second db).
In my kettle's design I've got Table Input (which returned me some rows).
I've need to select distinct IdN column from that returned rows, and to insert them (all distinct ids) into second table of second database (so I avoid duplicating ids).
I've tried with this code in execute sql statements :
INSERT INTO {SecondTable}
SELECT DISTINCT (IdN)
But returned with error:
Invalid column name 'IdN'.
And what confuses me, is that I have checked parameter IdN into "Field name to be used as argument" under "Execute SQL section" node of my kettle's design, which is valid column name I've got returned from previous table input node.
To be sure I am understanding. You are trying to write a query to select the idN column from one database into a table in another database. If so the query should look like this
Insert into db1.dbo.tableName1(colname)
Select Distinct colname From db2.dbo.tablename2