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.

Similar Messages

  • 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

  • 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

  • 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

  • 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.

  • 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.

  • 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

  • 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.

  • SQL Query in JDBC Sender

    Hi friends,
    Can u plz tell me when exactly we can use "Query SQL Stmt" and "Update SQL Stmt"?

    If you have a scenario that uses the JDBC adapter to connect to the "sending" system and pull data out of it, you will use these options. 
    You formulate a SQL statement that queries the database and gets certain information, the JDBC adapter then uses that information to populate the message type that you built in the integration repository. 
    You then create an update statement with SQL to tell the database what to do after it has grabbed the data it needs and populated the message type for mapping.
    Say for example you wanted to get all the data from the usr01 table in your SAP database (bad example, but bare with me) you could do something like this:
    <b>SQL QUERY STATEMENT:</b>  SELECT * FROM USR01
    And then following that you wanted to change the MANDT table (once again, don't actually run this command)
    <b>UPDATE SQL STATEMENT:</b>  UPDATE USR01 SET MANDT='100' WHERE MANDT='100'
    Message was edited by:
            Ethan West

  • 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 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.

  • 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

  • Stuck with logical system name for JDBC Sender system!!!!!!!!!!!!!

    Hi All,
    I'm doing a scenario as JDBC2FILE.
    I tried to add my jdbc sender system to SLD. So i created the technical system
    now i'm creating business system...what should i give at logical system name tab? I've created tech system and business system as third party.
    do we need logical system name in this scenario where we are not interacting with any R/3???
    can anyone suggest the way to achieve this scenario?
    Thanks in advance.....
    Santhosh.

    Hi Santhosh,
    I just want to add ons..few more information which it might help you.
      You no need to give logical system when you are using Thirdpaty.
    Please check the below blog you will get more idea how to proceed to achieve the JDBC Scenario.
    /people/sap.user72/blog/2005/06/01/file-to-jdbc-adapter-using-sap-xi-30
    If you have any doubts while proceeding with your scenario plesae let me know..I will try my level best.
    Thanks and Regards,
    Chandu

  • Where to see generated SQL statement from jdbc adapter?

    Hi everybody,
    where can I see the generated SQL statement from JDBC adapter?
    Regards Mario

    Yes and True lterally means the same, but alas XI does not understand literature..
    Just checked the note as well, as you are correct!
    Regards
    Bhavesh

Maybe you are looking for

  • Problems on MacBook Hard Disk

    I have a problem of my MacBook. My Mac's hard disk free space is getting smaller and smaller, but i haven't saved new things, download stuffs nor upgrading any of my software. It seems that every time i switch it on and surf the net with safari or ju

  • Overwrite files BUG! Save PDF to Web Receipts Folder

    In Safari, I will often want to save receipts of bank transactions. So I hit Command-P to print, then in the PDF menu button, I'll choose "Save PDF to Web Receipts Folder." When I look in my Web Receipts folder, it has saved the file, but if there wa

  • 11g For Windows and Linux 32 Now available for Download

    for your information only ;)

  • How to remove a SFSB in web page??

    Hi all, I have a question on when should I call remove() when ejb is involved in web pages. I have searched the past threads in this forum and someone suggested to use http binding interface. It is really a great idea. However, I still have two quest

  • InfoObjects Key disappeared after BW support packages applied

    Hi. We have a serious problem, after we applied BW support packages (7.0110) all our infoobjects that are created as text only, no master data, are only displaying the text. The objects key is empty. Do anybody have a solution for this? Koos.