Skip to Content
avatar image
Former Member

Can we use both INSERT and UPDATE at the same time in JDBC Receiver

Hi All,

I would like to know is it possible to use both INSERT and UPDATE at the same time in one interface because I have a requirement in which I have to perform both the task.

user send the file which contains both new and old record and I need to save those in MS SQL database.

If the record exist then use UPDATE otherwise use INSERT.

I looked on sdn but didn't find any blog which perform both the things at the same time.

Interface Requirement

FILE -


> PI -


> JDBC(INSERT & UPDATE)

I am thinking to use JDBC Lookup but not sure if it good to use for bulk record.

Can somebody please suggest me something or send me the link of any blog or anything to solve this problem.

Thanks,

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

4 Answers

  • Sep 04, 2011 at 06:21 AM

    you can perform either insert or update , but insert update in once action not possible but UPDATE_INSERT possible.

    Add comment
    10|10000 characters needed characters exceeded

  • Sep 04, 2011 at 06:35 AM

    go for update_insert:

    http://help.sap.com/saphelp_nw04/helpdata/en/2e/96fd3f2d14e869e10000000a155106/content.htm

    there is one other i.e use Stored procedures on the target side and pass ur soure payload as input to the SP and let SP handle the update/insert operations at the data base level (chk with ur DB team)....

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Sep 05, 2011 at 06:53 AM

    Hi,

    In your scenario you can use jdbc lookup .

    In mapping do a JDBC lookup to the table to find that any data already exist or not.

    Use If then else standrad function to map the Action.

    If Jdbc lookup return data exist then map Update other wise map Insert

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Sep 05, 2011 at 07:09 AM

    You can use UPDATE_INSERT. If fits the bill.

    If you check below link

    http://help.sap.com/saphelp_nw04/helpdata/en/2e/96fd3f2d14e869e10000000a155106/content.htm

    Initially, the same action is executed as for UPDATE. If no update to the database table can be made for this action (the condition does not apply to any table entry), values of the table described in the <access> element are inserted in accordance with the description of the action INSERT. <key> elements are ignored in this case.

    Add comment
    10|10000 characters needed characters exceeded