Skip to main content

Hey,

 

I’ve an table I hope that is being creating initially using excel import. Now that I want to update the data in the same table. Can anyone please guide me to do that.

 

Thanks in advance

 

Regards

Chethan

Hi ​@Chethan Shetty ,

 

If your new file contains only new data that you wish to append to your existing table you can:

  1. import new file
  2. create new transformation job
  3. insert new values into existing table.

In case the new file contains both old and new data and you need to make sure you get the up-to-date information, you might wanna use MERGE fucntion, something like:

MERGE INTO t1 USING t2 ON t1.id= t2.id
WHEN MATCHED THEN UPDATE SET a = t2.a
WHEN NOT MATCHED THEN INSERT (id, a) VALUES (t2.id, t2.a);

This example updates column “a” in case the id exists in both tables or make an insert in case it’s a new id.

If you need to update more columns, you’ll need to specify them in your update.

 

I hope that helps! 

 

Joao


Thanks Joao.


Reply