Update SQL Statement in the JDBC sender

Hello!
I have a AS400/DB2 table which I am polling for my XI scenario using the JDBC sender adapter.
I would like to know if it is possible to use system variables (data/time) in the UPDATE statement field? This because we would like to timestamp the exact date/time we read a table. (We can use stored procedures, I know, but would preferr not if at all possible.) Or is there another way?
Thanks,
Nam

Hello!
a little more detail:
We have a fairly simple scenario. We are polling the AS400/DB2 table for information using the JDBC sender with a SELECT statement in the SQL query. We take the data, map it and push it into SRM.
Bhavesh: What I meant is that for error handlig purposes we would like to update the polled record with date and time at the same time as we poll. Using the system date/time of the db system would be ideal, but XI time would be just fine to. So wondering if there is any way to pick up the system data/time (of either system) and pass it in the UPDATE statement as system variables or some such.
Nimrod: one question.... how do we do the mapping in the poll? Meaning the polling is the trigger of the whole scenario, so there is no mapping preceding it. I am fairly new to XI, especially the mapping bit, any help or advice appreciated!
Thanks!
Nam

Similar Messages

  • Sender JDBC adapter : Update SQL Statement : stored procedure

    Hi,
    Can we use a stored procedure in the sender jdbc adapter in 'Update SQL Statement'.
    The problem i am facing is like, we are selecting data from two tables in 'SQL statement for query' and then in 'Update SQL Statement' , we need to delete that data from these two tables.
    Please let me know if it is possible.
    Thanks,
    Rohit

    you can use a Stored procedure in the
    Query SQL Statement
    You have the following options:
    ·        Specify a valid SQL SELECT statement to select the data to be sent from the specified database.
    ·        Specify an SQL EXECUTE statement to execute a stored procedure, which contains exactly one SELECT statement.
    The expression must correspond to the SQL variant supported by the relevant JDBC driver. It can also contain table JOINs.
    so have your whole select and update as part of this single Stored procedure

  • JDBC Sender update SQL Statement Question.

    I was wondering if there is a way to have the update SQL statement line in the JDBC sender update by time stamp, this would be very helpful.  Does anyone know a method of doing this?

    In the SAP documentation of the adapter it has this example for using the update SQL statement after the query statement:
    SQL statement for query: SELECT * FROM table WHERE processed = 0;
    SQL statement for update: UPDATE table SET processed = 1 WHERE processed = 0;
    What I want is to be able to put processed = (the current date) instead of processed =1 in the update statement, like this example:
    SQL statement for query: SELECT * FROM table WHERE processed = 0;
    SQL statement for update: UPDATE table SET processed = (the current date) WHERE processed = ' ';
    I seems like you can only use a fixed value for the update statements in the JDBC Sender though, I would like to know if you can use a time stamp or variable there.

  • Xi JDBC Adapter - Query SQL Statement & Update SQL Statement

    Hi!
    I configure the JDBC adapter sender (XI) to take data from Oracle database.
    I set the Query and Update SQL Statement in the Processing parameters of the communication channel in this way:
    Query SQL Statement :
    SELECT * FROM XI_TABLE WHERE STATUS = 'WAIT' ORDER BY ROW_NUM
    Update SQL Statement :
    UPDATE XI_TABLE SET STATUS = 'DONE', DATE = SYSDATE WHERE STATUS = 'WAIT'
    My question is :
    If a new record with the field STATUS = 'WAIT' is added to the table (xi_table) during the time between the execution of the query statement and the start of the update statement, what will happen to that record during the update?
    There is a way to avoid the update of that record? or to pass to the update statement only the record selected in the query statement?
    Please, may you give me some example?
    Thanks,
    Francesco

    hi,
    did you check "Isolation Level for Transaction"
    for the sender jdbc adapter?
    http://help.sap.com/saphelp_nw04/helpdata/en/7e/5df96381ec72468a00815dd80f8b63/content.htm
    Regards,
    michal

  • How to examine the generated SQL statement in Receiver JDBC Adapter

    I have been searching this forum how to display te generated sql statement (by the jdbc receiver adapter).
    The only suggestion is to use RWB, but I was unable to find any details about how to do so.
    Any help is appreciated

    Hi,
    To add, u can see the SQL Statements in Audit log of RWB.
    Select Message Monitoring-> Adapter Engine. choose ur entry and click on Details option button, u can see the SQL Statements in Audit Log.
    Regards,
    Sudharshan
    Message was edited by:
            Sudharshan Aravamudan

  • Update SQL statement, date possibilities

    All,
    Is it possible to format the date in the update sql statement of the sender JDBC adapter ?
    the statement curdate() returns the date in this format 09-02-04.
    But, I would like to have it in this format 20090204.
    this is my update statement
       UPDATE table SET status = 'X', date = curdate()
    Anybody knows how to do this or via something else than curdate()
    Michel

    Hi Michel,
    I am sorry i misunderstood the question.. how are you getting the data from curdate() may i ask. What exactly is curdate()?
    Is it a field in the database that you are retrieving?
    What you could do is create another dummy field and maitain the current date in that field, in the format you want it to. Then you could use that field in the update statement as tableName.fieldName.
    Use this to manage your date checks. Only that you would have to modify the date in the database every day.
    Regards,
    Kshitij
    Edited by: Kshitij Sharma on Feb 4, 2009 9:31 AM
    Edited by: Kshitij Sharma on Feb 4, 2009 9:36 AM

  • Sender JDBC adapter -- Update SQL statement NOT work for the last record

    I'm trying to use SAP XI to send records from Oracle database to As/400 using JDBC adapter.  I've defined the communication channel for sender
    (1)  The "Query SQL statement"  = select  a_bgn_dt,  a_end_dt from  PX_PXXD WHERE NOT CU_ACTION_CD='P' 
    (2)   The "Update SQL statement"  = update PX_PXXD set CU_ACTION_CD='P'  WHERE NOT CU_ACTION_CD='P' 
    Supposed that 3 records were retrieved from (1) and successfully updated to AS/400 but only the first 2 records in Oracle database are updated according to (2)
    Any advise.
    Pansy

    Hi Pansy,
    You select and update query is looking like wrong
    kindly check below query,If you are using oracle
    (1) The "Query SQL statement" = select a_bgn_dt, a_end_dt from PX_PXXD WHERE CU_ACTION_CD !='P'
    (2) The "Update SQL statement" = update PX_PXXD set CU_ACTION_CD='P' WHERE  CU_ACTION_CD !='P'
    Thank you
    Sateesh

  • JDBC sender adapter, ...Processing parameters, Update SQL statement

    in JDBC sender adapter, ...Processing parameters, there is an Update SQL statement field, can u tell me ...why this is required,,,,,and in one of the example scenario...it was given as <TEST>..

    Sudheep,
    In the sender JDBC adapter you have the select query to select data from the database.
    Let us summer 2 cases,
    1. You have <test> in  the UPDATE . In this case, during every polling interval the JDBC adapter will end up selecting the same data from the Database. This would not be needed in most f the cases. Why would you want to select the same data over an over again?
    2. If you have an update Statement in the Update field you can make sure that the data selected in the selected statement is updated so that the same rows are not selected again.
    Take a look at this blog,
    /people/yining.mao/blog/2006/09/13/tips-and-tutorial-for-sender-jdbc-adapter
    Regards
    Bhavesh

  • Update sql statement in sender/receiver jdbc adapter

    Hi
    What is the update sql statement we give in the sender/ receiver adapter when
    1) SELECT statement was written in query sql statement
    2) EXECUTE statement was written for a stored procedure in query sql statement
    thanks
    Anitha

    > 1) SELECT statement was written in query sql statement
    your table should have some value "already_processed" which prevents a second processing of that table.
    the update statement sets that value.
    > 2) EXECUTE statement was written for a stored procedure in query sql statement
    the same as above.
    when your stored procedure already does the update, then write a second stored procedure which does nothing.

  • Update SQL statement in JDBC sender (system fields)

    All,
      Is it possible to update more than 1 field via the update sql statement ?
      Also, is it possible to use system fields ? 
      Something like this
      UPDATE database.table SET processed='Y', date = sy-datum
    Regards, Michel

    Hi
    use sysdate as suggested above
    Check your  generated SQL query format is correct
    At runtime you can find the genereated sql statements by doing configuraitons in Receiver JDBC adapter.
    In the JDBC Receiver adapter you have the Advanced Properties .
    Over there enter the following
    left column logSQLStatement
    right column true
    To see the query created ..
    Login to adapter monitoring ..select the relevant jdbc adapter.
    Now when any message is processed by the jdbc adapter in adapter monitoring at that time you will see a message link. When you click on that link a new window will open. In that window if you click on page down you will get to see the sql statement generated by the jdbc adapter.

  • JDBC Adapter - Update SQL Statement - Timestamp

    Hi All,
    I'm using a JDBC Sender channel to bring information from a database, when I bring the data I want to UPDATE a field inserting the date and time (timestamp) when you got the info.
    Sender Communication Channel: JDBC
    Query SQL Statement:  SELECT * FROM PI_Factory
    Update SQL Statement: ????????
    Could you tell me how to do this?

    Hi
    please try the below query in Update sql statement
    update table_name set fieldname = systimestamp where .....
    or
    update table_name set fieldname = current_timestamp where .....
    Regards
    Ramg.

  • Query SQL Statement & Update SQL Statement

    Hi!
    I configure the JDBC adapter sender (XI) to take data from MSSQL database.
    I have to run select like this:
    SELECT
    tblMilestone.Site,
    tblMilestone.Revision,
    tblMilestone.MilestoneNameID,
    tblMilestone.ApprovedDate,
    tblMilestoneName.MilestoneName
    FROM
    tblMilestoneName
    INNER JOIN tblMilestone ON tblMilestoneName.MilestoneNameID = tblMilestone.MilestoneNameID
    WHERE tblMilestone.StatusCode = 1;
    My question is what "Update SQL Statement" I should use in communication channel definition? I only need to update tblMilestone or this two tables?
    Maybe you give me some example.

    Check this from SAP help...
    Update SQL Statement
    You have the following options:
    &#9679;     Enter a valid SQL statement that is to be applied to the database once the data (determined from the Query SQL Statement) has been successfully sent to the Integration Server/PCK.
    It must be an INSERT, UPDATE, or DELETE statement.
    &#9679;     In place of the SQL statement, you can also enter <TEST>. Once the data determined from Query SQL Statement has been successfully sent, the data in the database remains unaltered.
    This is recommended if the data has not only been read, but also changed by a stored procedure entered under Query SQL Statement.

  • How to cofigure the JDBC Sender adaptor

    how to cofigure the JDBC Sender adaptor,
    i want to do the scenario JDBC>XI>SAP
    Thanks & Regards,
    priya reddy

    HI
    Database (JDBC) Adapter
    The JDBC Adapter allows access to any DB that allows a JDBC driver to access the DB. This driver is not supplied with the adapter but must come from the DB provider or a 3rd party. The adapter converts database content to XML and vice versa.
    Database content can be read with any SQL statement using a special XML format. This format enables SQL INSERT, UPDATE, SELECT, DELETE or even stored procedures. A message is always processed in one database transaction.
    Refer the following links for further assistance
    JDBC ADAPTER:
    http://help.sap.com/saphelp_nw2004s/helpdata/en/1d/756b3c0d592c7fe10000000a11405a/frameset.htm
    http://help.sap.com/saphelp_nw04s/helpdata/en/7e/5df96381ec72468a00815dd80f8b63/frameset.htm
    Use thes step by step guidese
    https://wiki.sdn.sap.com/wiki/display/XI/JDBCTOJDBC
    https://wiki.sdn.sap.com/wiki/display/XI/XMLFile2XMLFile
    tutorial /people/yining.mao/blog/2006/09/13/tips-and-tutorial-for-sender-jdbc-adapter
    http://help.sap.com/saphelp_nw2004s/helpdata/en/1d/756b3c0d592c7fe10000000a11405a/frameset.htm for sender side JDBC configuration.
    Follow this link
    /people/luis.melgar/blog/2008/05/13/synchronous-soap-to-jdbc--end-to-end-walkthrough
    cheers
    reward points if found useful

  • Failed to post data to database during "Update": SQL Statement

    Hi,
    I'm getting this error while trying to update a VO via BCBrowser or UI.
    Failed to post data to database during "Update": SQL Statement
    This is a simple & straight forward default VO created on Entity Object (Database Table)
    On the same table & with same DB credentials, I could successfully update the record.
    Any Guess, on what went Wrong??
    Thanks in Advance for any help.
    p.s Jdev 11.1.1.6
    Log:
    oracle.jbo.DMLException: JBO-26041: Failed to post data to database during "Update": SQL Statement "BEGIN UPDATE CAR CarEO SET SEL_ITEM=:1 WHERE TXN_NO=:2 AND LOGID=:3 AND SEQNO=:4 RETURNING DELIVERY_MODE, CERTIFICATION_REQ, SOFT_COPY_IND, SELITEM INTO :5, :6, :7, :8; END;".
      at oracle.jbo.server.OracleSQLBuilderImpl.doEntityDML(OracleSQLBuilderImpl.java:583)
      at oracle.jbo.server.EntityImpl.doDML(EntityImpl.java:8575)
      at oracle.jbo.server.EntityImpl.postChanges(EntityImpl.java:6816)
      at oracle.jbo.server.DBTransactionImpl.doPostTransactionListeners(DBTransactionImpl.java:3290)
      at oracle.jbo.server.DBTransactionImpl.postChanges(DBTransactionImpl.java:3093)
      at oracle.jbo.server.DBTransactionImpl.commitInternal(DBTransactionImpl.java:2097)
      at oracle.jbo.server.DBTransactionImpl.commit(DBTransactionImpl.java:2378)
      at oracle.adf.model.bc4j.DCJboDataControl.commitTransaction(DCJboDataControl.java:1615)
      at oracle.adf.model.binding.DCDataControl.callCommitTransaction(DCDataControl.java:1417)
      at oracle.jbo.uicli.binding.JUCtrlActionBinding.doIt(JUCtrlActionBinding.java:1437)
      at oracle.adf.model.binding.DCDataControl.invokeOperation(DCDataControl.java:2150)
      at oracle.jbo.uicli.binding.JUCtrlActionBinding.invoke(JUCtrlActionBinding.java:740)
      at oracle.jbo.uicli.jui.JUActionBinding.actionPerformed(JUActionBinding.java:193)
      at oracle.jbo.uicli.controls.JUNavigationBar.doAction(JUNavigationBar.java:412)
      at oracle.jbo.jbotester.NavigationBar.doAction(NavigationBar.java:111)
      at oracle.jbo.uicli.controls.JUNavigationBar$NavButton.actionPerformed(JUNavigationBar.java:118)
      at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
      at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
      at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
      at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
      at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236)
      at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:272)
      at java.awt.Component.processMouseEvent(Component.java:6289)
      at javax.swing.JComponent.processMouseEvent(JComponent.java:3267)
      at java.awt.Component.processEvent(Component.java:6054)
      at java.awt.Container.processEvent(Container.java:2041)
      at java.awt.Component.dispatchEventImpl(Component.java:4652)
      at java.awt.Container.dispatchEventImpl(Container.java:2099)
      at java.awt.Component.dispatchEvent(Component.java:4482)
      at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4577)
      at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4238)
      at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4168)
      at java.awt.Container.dispatchEventImpl(Container.java:2085)
      at java.awt.Window.dispatchEventImpl(Window.java:2478)
      at java.awt.Component.dispatchEvent(Component.java:4482)
      at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:644)
      at java.awt.EventQueue.access$000(EventQueue.java:85)
      at java.awt.EventQueue$1.run(EventQueue.java:603)
      at java.awt.EventQueue$1.run(EventQueue.java:601)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
      at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:98)
      at java.awt.EventQueue$2.run(EventQueue.java:617)
      at java.awt.EventQueue$2.run(EventQueue.java:615)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
      at java.awt.EventQueue.dispatchEvent(EventQueue.java:614)
      at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
      at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
      at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
      at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
      at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
      at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
    Caused by: java.sql.SQLException: Invalid column type
      at oracle.jdbc.driver.OracleCallableStatement.registerOutParameterInternal(OracleCallableStatement.java:150)
      at oracle.jdbc.driver.OracleCallableStatement.registerOutParameter(OracleCallableStatement.java:399)
      at oracle.jdbc.driver.OracleCallableStatement.registerOutParameter(OracleCallableStatement.java:581)
      at oracle.jdbc.driver.OracleCallableStatementWrapper.registerOutParameter(OracleCallableStatementWrapper.java:1765)
      at oracle.jbo.server.OracleSQLBuilderImpl.bindUpdateStatement(OracleSQLBuilderImpl.java:2243)
      at oracle.jbo.server.EntityImpl.bindDMLStatement(EntityImpl.java:10524)
      at oracle.jbo.server.OracleSQLBuilderImpl.doEntityDML(OracleSQLBuilderImpl.java:412)
      ... 52 more

    The issue is resolved now.
    new Columns added to the Database table, after creating Entity Object. These latest changes were not picked up in Entity Object.
    I found this difference after comparison of entity object with DB Table.
    And when I added those new columns to EO & VO, I'm not getting this error anymore.
    Thanks to all who tried to help

  • How to retrieve first update SQL statement initiator (locking)

    Hi!
    i have a table called as
    test ( A number, B varchar2(10));
    1) inserted 1000 records
    2) update test set A=A where A=1;
    3) open new session issue update test set B=B where A=1;
    reselt lock;
    opened again a new session and issued this statement
    COLUMN blocker format a15
    COLUMN blockee format a15
    SELECT (SELECT username || '.' || a.SID FROM v$session
    WHERE SID = a.SID ) blocker, ' is blocking ',
    (SELECT username || '.' || b.SID FROM v$session
    WHERE SID = b.SID ) blockee, ' from executing: ',
    (SELECT sql_text FROM sys.V_$SQL
    WHERE address =
    (SELECT sql_address FROM v$session WHERE SID = b.SID ) )
    FROM v$lock a, v$lock b
    WHERE a.BLOCK = 1 AND b.request > 0 AND a.id1 = b.id1 AND a.id2 = b.id2;
    Result as:-
    BLOCKER 'ISBLOCKING' BLOCKEE 'FROMEXECUTING:'
    (SELECTSQL_TEXTFROMSYS.V_$SQLWHEREADDRESS=(SELECTSQL_ADDRESSFROMV$SESSIONWHERESI
    SYS.159 is blocking SYS.144 from executing:
    UPDATE TEST SET B=B WHERE A=1
    question is how can i retrieve my first update sql statement i:e (initiator)....?
    as (UPDATE TEST SET A=A WHERE A=1;)
    Regards,

    Since releasing 10.2.0.1 several years ago Oracle has released patches to 10.2.0.2, 10.2.0.3, and 10.2.0.4. I would highly recommend you read the patch notes and get your system current.
    I note that you did not answer my two follow-up questions leading me to assume you do not have the license to look at the tables and views supporting ASH and AWR. Without them I do not believe you can retrieve the information you seek.
    I no longer have 10gR2 on my laptop so I am not sure but take a look at gv$session.
    Do you have columns named "BLOCKING_SESSION_STATUS", "BLOCKING_INSTANCE" and "BLOCKING_SESSION"? If you do that might lead you to a way you could track it down via gv$sql.

Maybe you are looking for

  • How to fetch content from UCM in WLP using VCR

    Hi, I configured the connection between weblogic portal v10.3.2 and UCM 11g using VCR adapter guide. But i am struck in how to fetch the content from UCM/VCR and display it in Weblogic portal. Please guide me on how to fetch the content from UCM/VCR

  • Rename and sort pics in photos

    Is there a way to (batch-)rename and sort pics by name within an album in photos (Mac)?

  • Download Business Graphics to PDF

    Hi All, Iam using Business Graphics in Web dynpro ABAP, the output business graphics image to be export in PDF file. I have Customizing XML file in MIME object and CL_IGS_CHART_ENGINE class is there. But I dont know how to use that class in Web dynpr

  • Can I use the Tax Payment Wizard to pay the Withholding taxes...?

    For SAP B1 2007 B PL 7--- Can I use the Tax Payment Wizard to pay the Withholding taxes...?

  • Flash Builder failed to lunch after installation.

    Adobe Flash Builder can't lunch after installation completed successfully. it says to uninstall and reinstall again. if problem continues, contact adobe support. and it says: "error: 5" ~ Then after I uninstalled it. Download it again and reinstall a