cancel
Showing results for 
Search instead for 
Did you mean: 

DLETE whole records in JDBC

Former Member
0 Kudos

Hi experts,

I have a scenario where I have to dlete all entries of a table before inserting new records.

I tried to put an empty key so that it deletes all the entries of the table, but it does not work.

Is there a way to do that?

Thanks a lot, any help would be appreciated.

Regards,

Jamal

Accepted Solutions (1)

Accepted Solutions (1)

prateek
Active Contributor
0 Kudos

U have to provide a key. Provide such a key for which all the fields get selected or use multiple keys.

U may also use a stored procedure to empty the table.

Regards,

Prateek

Answers (2)

Answers (2)

Former Member
0 Kudos

hi,

you can easily achive this by writing SQL_DML query in the message mapping level...

First use DELETE in 'action' and later use INSERT INTO in 'access'

make sure you have the data type created in this format.

refer the below link for documnet format for JDBC

http://help.sap.com/saphelp_erp2004/helpdata/en/43/98f63def83c452e10000000a114084/frameset.htm

regards.

former_member238007
Contributor
0 Kudos

Hi,

as with u can go with STORED PROCEDUREs, i.e if u want to do multiple action's with the table u neeed to go with the stored procedure concept..

else

u can do like this .. this might be an idea i was not clear about this..

u can set a variable field flag by default as 'S' for all the records and check if the flag is S delete all the records and then insert the data.. i think this throw some idea..

regards

Kishore