cancel
Showing results for 
Search instead for 
Did you mean: 

Drop few columns before inserting into Oracle table

Siva_Venna
Contributor

I am reading data from csv file before inserting the data into Oracle table,I want to delete or omit unnecessary columns. How to achieve this?Thanks in advance

8 REPLIES 8

dmiller
Admin Admin
Admin

You can use the Mapper Snap.
If you put the source fields in the source column and do not specify a target for those fields, it will drop them in the data flow.


Diane Miller
Community Manager

Using mapper to drop fields is fine. I am asking is it possible to truncate the table before inserting data?. i.e table will have only latest execution data

As I see it, you have 2 options:

  1. Add an “Oracle Delete” Snap without any delete condition (DELETE FROM TableName) before inserting the data.
  2. If you really need to execute the Truncate instead of the Delete, you may try to create a stored procedure (On your Oracle DB) with “EXECUTE IMMEDIATE 'TRUNCATE TABLE ’ || TableName;” statement and then call this stored procedure on SnapLogic with the “Oracle Stored Procedure” Snap.

I would go for option 1 for simplicity.

Thanks pedro.almeida, it worked :+1: