PDA

View Full Version : database lookup



kettle_anonymous
04-20-2006, 07:57 AM
Hi,
I started using kettle yesterday.
I had some general questions, might be silly too





This is my task



Step 1-> Extract a raw CSV file (was able to do this and view te rows)



Step2 -> from the extracted rows i would like to compare 2 fields with the fields of a table .i.e i have to compare file-field-1 and file-field-2 with table-field-b and Table-field-c of Table-1



do i have use database lookup here?






Step3 -> after the lookup row needs to be inserted in Table1
conditions:
if table-field-B and table-field-C are already present do nothing



if table-field-B and table-field-C are not present insert a row into Table1 which would be table-field-A , table-field-B,table-field-C. Here table-field-A is a sequene number and a primary key for Table1. so this needs to be generated before insertion.



do i have to use sequencer and/or Insert/update here ?



please let me know if i have to me more specific , all suggestions are welcome guys



do we have any demo on combination lookup ?



Thanks,
sam

MattCasters
04-24-2006, 03:47 AM
Hi Sam,

You probably figured this out, but indeed, you can use a database lookup to lookup values in a database.
See the Weekly Kettle Tips for more explanations.
A certainly a combination lookup is probably the way to go to create new keys in a new table without a natural key.

This subject has also been beaten to dead on the forum lately.
However, if you do feel you have a problem or a question, do feel free to ask.

Enjoy Kettle!

All the best,
Matt