cancel
Showing results for 
Search instead for 
Did you mean: 

issue while inserting/updating date fields in DB

Former Member
0 Kudos

Hi Experts,

I have a requirement to insert data to DB for columns CreatedDate, UpdatedDate. I am using UPDATE_INSERT; for insertion the value in the two fields will be current system date and time; but while updating only UpdateDate should be modified with latest date, it shouldn't touch the CreatedDate.

If i map the above fields with SysDate then even in Updation also the CreateDate field will get updated which is not expected. Can someone please provide some idea on this. Thank You..

Accepted Solutions (0)

Answers (2)

Answers (2)

iaki_vila
Active Contributor
0 Kudos

Hi Ravindra,

In my opinion creating a stored procedure as Sanjeev suggested is the best option.

You have another choices:

1. If you scenario is async, you can do a multi-mapping with two messages, insert and update. If the insert fails, there will not be a issue.

2. Do two scenarios, the first to do a select and the second depending the first scenario to do an insert or an update. If you have an ABAP system involved, you can do the control between the two scenarios there.

Regards.

former_member194786
Active Contributor
0 Kudos

Hi Ravindra,

Only way I can think of doing this, is through a stored procedure. But I will wait for other experts to reply, to see if there is an alternative.

Regards,

Sanjeev.