• Index
  •  » Talend Open Studio for Data Integration » Usage, Operation
  •  » only insert into a dimension table

#1 2012-06-20 18:51:22

daniel.h
New member
Registered: 2012-06-20
Posts: 2

only insert into a dimension table

Hey!

I have a problem and couldn't work around it as of now, so I thought I might ask you guys.
There's a dimension-table with an ID-column and 4 varchar-columns. I want to load this table using a tOracleInput-object which passes on a lot of rows to an tOracleOutput-object. Now in the Output, I want to see if the current row already exists in the dimension-table (then do nothing) or if it does not (then insert). This comparison is being done on all 4 varchar-columns.

An Example:
Let's assume, the table looks like this:
ID | column_1 | column_2 | column_3 | column_4
---------------------------------------------------------
1  | London    | Peter        | Office      | Summer
2  | Paris       | N/A          | Office       | N/A
3  | New York | Steven     | Faculty     | Winter
4  | Tokyo      | N/A         |  N/A         | Winter

The input-object only gives the 4 varchar-fields. The row London - Steven - Office - Summer should be entered (the combination is not yet existing) with a new ID while the row Paris - N/A - Office - N/A should simply be disregarded.

I tried to do this by having ID as an additional column ("advanced settings" in the component) which uses an Oracle Sequence (SEQ_SOMETHING.nextval) and a key on all 4 varchar-columns. Action on data is "Update or insert".
My thought was that only new rows would not match the key and thus be inserted. Existing rows match all columns which will not be changed then.

This doesn't work and I guess my whole thinking was wrong. How would you solve this?

Offline

#2 2012-06-20 18:53:04

daniel.h
New member
Registered: 2012-06-20
Posts: 2

Re: only insert into a dimension table

Can't see the images I uploaded...?!?

Offline

  • Index
  •  » Talend Open Studio for Data Integration » Usage, Operation
  •  » only insert into a dimension table

Board footer

Powered by FluxBB