cancel
Showing results for 
Search instead for 
Did you mean: 

Truncate a database table

Former Member
0 Kudos

Hi Team,

i have a sceanrio JDBC to JDBC. now my requirement is, i have to insert data from source DB (full  extract) to target DB.

So in receiver side before insert data, i have to truncate the target table and then insert data every time. So how can i achieve this with JDBC receiver

please suggest.

do we have any document format for Truncate in JDBC? apart from INSERT, UPDATE, UPDATE_INSERT, DELETE, or SELECT

Best Regards,vasu.

Accepted Solutions (0)

Answers (2)

Answers (2)

rajasekhar_reddy14
Active Contributor
0 Kudos

Hi Vasu,

Defining  SQL_QUERY statement right idea to handle your requirement , but if you are performaing mass data base operation(high load) then you might face performance issues.

So better to handle it using stored procesdure .

Regards,

Raj

Former Member
0 Kudos

Hi RajaSekhar,

As my requirement is at receiver side, do i need to mention as SQL_QUERY or SQL_DML.

Also  will this SQL_QUERY / SQL_DML statement work, if any of the field is having PK in my target table.

So for use the SQL_DML, i have to assign

SQL_DML for the node "action"

update query with place holders (example: UPDATE Customers SET CompanyName=’$NAME$’, Address=’$ADDRESS$' WHERE CustomerID='$KEYFIELD$’) for the node "ACCESS"

please clarify..

Best Regards...vasu

iaki_vila
Active Contributor
0 Kudos

Hi Vasu,

You could use a native SQL: http://help.sap.com/saphelp_nw73/helpdata/en/44/7c24a75cf83672e10000000a114a6b/frameset.htm

or define a SQL_QUERY statement: http://help.sap.com/saphelp_nw73/helpdata/en/44/7b7855fde93673e10000000a114a6b/content.htm

I never try this statement, i dont know if it will work, but if you have any problem you will always have the DELETE statement.

Regards.