cancel
Showing results for 
Search instead for 
Did you mean: 

Reg:JDBC Receiver

Former Member
0 Kudos

Hi All,

My scenario is Proxy to JDBC (Asynchronous). I have the requirement to delete the old records i.e. to delete the records of the particular fields that are mapped and then insert the new values from the sender side to the same fields.

My structure at the receiver side has already two statements and I have to implement the above functionality to both the statements.

can anyone suggest me how to implement for the same.

Thanks in Advance,

Lavanya .B

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Lavanya,

Two of your SQL statements would execute seperately on two different tables.

regarding update_insert, it will change a value if it finds records that meets the key or else it will insert those values into that column. please check

http://help.sap.com/saphelp_nwpi711/helpdata/en/44/7b6d32fde93673e10000000a114a6b/frameset.htm

also you can make test to see how exactly it behaves, as your exact SQL query behavior may vary slightly from DB to DB based on its config.

regards,

francis

venkatanarayana_vagu
Active Participant
0 Kudos

Hello Lavanya,

I think this you can achieve this by UPDATE_INSERT. I mean rather deleting the rows you can directly update the rows based on the (KEY) condition.

Also you can think about the LOOK UP functionality.

Former Member
0 Kudos

Hi All,

Thanks for your reply.

1.Can we achieve this without using key?

2.Example: If I have 100 records for a field, which has unbounded occurences and while updating if I get values only for 50 records then what will be the postion of the remaining 50 records?

Can anyone explain in detail.

Lavanya.B

Former Member
0 Kudos

If you get value for only 50 records then only those records will be UPDATED.

Remaining 50 are new and hence they will be INSERTED.

Key has to be used as at runtime, key field value will give the condition to the query ( where clause), based on which records will be updated.

-Supriya.

Former Member
0 Kudos

Hi Supriya,

Thanks for your reply.

By the following statement "Remaining 50 are new and hence they will be INSERTED.",

Is that, the remaining 50 fields will have an empty values or the old values would exists.

Regards,

Lavanya.B

Former Member
0 Kudos

Hi,

I will take an example.

Suppose you have the key field as 'Name'.

At runtime, suppose Name has 2 valuess, A & B and 100 records 50 for A and 50 for B.

Now at the target side, suppose records for A already existing, then these 50 records will UPDATE them in case if any of the field value is different from the already existing ones in database.

And the 50 records pertaining to value B are not there in database at all, so they will be INSERTED.

I hope it is clear now.

Former Member
0 Kudos

Hi Supriya,

Iam clear about the Record A which you have stated as an example but for B , let us assume that already 50 records are existing in database and now if empty values are passed to B,then will the existing records be deleted for B or will remain the same?

Lavanya .B

Former Member
0 Kudos

Firstly B is the value of the Key field Name, its not empty.

As the records for this value are not there in databse, they wil be inserted into it.

Former Member
0 Kudos

Hi All,

Let me state an example say,I have two fields with two different tables and for this 2 statements were used.

TABLE1:

Statement1----


0-U

NAME----


0-1

TABLE2:

Statement2----


0-U

ADDRESS----


0-1

Both Name and Address have values of 10 records .Again 8 records are updated to the Field NAME and no updation for the field Address.

Can anyone tell me what will be the status and how many records will both the fields will have now? while using UPDATE_INSERT action.

Lavanya.B

former_member206760
Active Contributor
0 Kudos

Hi ,

the functionality that u are lokking for is if the reocrds are already existing in thetable then UPDATE them and if they are not existing INSERT them....right????

if yes,,,u can use value UPDATE_INSERT in the action field ..