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

Similar Messages

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

  • Sender JDBC adapter donot want to update database..

    Hi,
    We have JDBC to RFC scenario. In This we need to read only database table , we should not update it. As in sender JDBC adapter configuration Update SQL Statement is mandatory, so what needs to be done in this case?

    Hi,
    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.
    http://help.sap.com/saphelp_nw04/helpdata/EN/7e/5df96381ec72468a00815dd80f8b63/frameset.htm
    Regards,
    Manjusha

  • Sender jdbc adapter....update query?

    Dear Team,
    we are selecting date from master database and client dont want to add any other field for update query.
    using select option, how to avoid selecting duplication records.
    can i use current date and time for selecting the records for every select statement?
    if yes then how to do it and what we need to update in update query??
    Regards,
    Chinna

    Hi Chinna,
    Check like this below.
    The following SQL statement selects the product name, and price for today from the "Products" table:
    SELECT ProductName, Price, Now() AS PerDate
    FROM Products;
    Similarly,
    UPDATE ProductName, Price, Now() AS PerDate
    FROM Products;
    Regards,
    Loordh.

  • JDBC Adapter Error to conect to SQL Server 2005

    Hi all.
    I´m trying to conect to a SQL Server 2005 database, but facing this error:
    UnsupportedClassVersionError: (com/microsoft/sqlserver/jdbc/SQLServerDriver) bad major version at offset=6'
    The parameters are:
    JDBC Driver: com.microsoft.sqlserver.jdbc.SQLServerDriver
    Connection: jdbc:sqlserver://
    How can I resolve this issue?
    Thanks.

    The jdbc driver seems to be incompatible. Use the compatible version from [http://www.microsoft.com/downloads/details.aspx?familyid=99B21B65-E98F-4A61-B811-19912601FDC9&displaylang=en|http://www.microsoft.com/downloads/details.aspx?familyid=99B21B65-E98F-4A61-B811-19912601FDC9&displaylang=en]

  • Sender jdbc  update sql error

    hello friend ,
    my xi-content scenario is oracle -> xi ->sapr/3
    i am getting erro message in adapter monitor as following 
    Sender Adapter v0915 for Party '', Service 'oracle':
    Configured at 04:26:46 2006-04-03
    Last message processing started 05:17:12 2006-04-03
    Error: SQLException during update 'TEST': java.sql.SQLException: ORA-00900: invalid SQL statement
      last retry interval started 05:17:12 2006-04-03
      length 60,000 secs
    but update sql query  is running fine on DB. still i am getting invalid SQL statement .
    no message in sxmb_moni.
    how should i check my jdbc adapter is running fine if it fine then what is error .
    thanks friends.
    amit ranjan

    Amit,
    You are using a sender JDBC adapter. There are 2 SQL querries you write in a sender adapter(JDBC).
    1. Select querry which selects the fields and fetch it to your XI server.
    2. Update SQL. This is a crucial one coz you can not process same set of rows again and again. So you may want to maintain a flag. This happens here.
    In your case update SQL querry does not seem to work.
    Check it.
    For more help post us the 2 querries(select & update).
    Look into this link for info on config of sender JDBC adapter
    http://help.sap.com/saphelp_nw2004s/helpdata/en/ae/d03341771b4c0de10000000a1550b0/frameset.htm
    <i>(P.S: Reward replies that are helpful)</i>
    Regards,
    Jai Shankar.

  • Problem with a JDBC Adapter when connect to Instance on SQL Server

    Hi,
    Currently I'm setting up a communication channel with the JDBC adapter to work on a SQL Server database. When I use a string without specifying the connection instance, the JDBC driver takes the default instance and connects to a database without problems.
    jdbc: sqlserver: / / Server01; databaseName = IntegraSAP1
    The problem is when I need to connect to another instance of it server.
    jdbc: sqlserver: / / Server01; instanceName = SAP; databaseName = IntegraSAP2
    The JDBC driver, in short, send me the following error:
    Cause Exception: 'Error when attempting
    to get processing resources: com.sap.aii.af.lib.util.concurrent.ResourcePoolException:
    Unable to create new pooled resource: DriverManagerException:
    Can not establish connection:: com.microsoft.sqlserver.jdbc.SQLServerException:
    The connection to the named instance  has failed. Error:
    java.net.UnknownHostException: .
    I appreciate your help,
    Regards,
    Johnny

    Not sure, might be port number is not required in case using instance. Give one more try with :
    jdbc:sqlserver:/ /Server01\SAP; databaseName = IntegraSAP2
    A comment from http://msdn.microsoft.com/en-us/library/ms378428.aspx
    "SQL Server 2000 and SQL Server 2005 allow for the installation of multiple database instances per server. Each instance is identified by a specific name. To connect to a named instance of SQL Server, you can either specify the port number of the named instance (preferred), or you can specify the instance name as a JDBC URL property or a datasource property."
    Regards,
    Sunil Chandra

  • Updating 3rd parties db table using JDBC adapter at sender side

    hi all.
    i just want to know how i can updated the 3rd party db table field.
    my scenario is just to retrieve data from 3rd party DB table where the condition is like " to select records where processed (field name ) = " ".
    but i just need to update this field to x immediately after retrieving data from it.
    so i simply wote the sql statement select REC_NO, ACTN_DAT, METRNO, MET-READ from PHAKAMA_CONN where processed = " ". under jdbc CC query sql stmt  at sender side .
    but i want to know how we can updated the processed (field ) from " " to "x"immeidtely after retrieving.
    so could any body advice me how we can achiev this through UPDATE SQL STMT under sender jdbc cc.i just want to know wat stmt do we need to srite under this.
    waiting for u r response.
    cheers.
    seeta ram.

    Ram,
    Execute your Select statement as needed and in the sender jdbc communication channel in the update SQL statement give this:
    UPDATE <tablename> SET <fieldname> = 'X' WHERE <fieldname>= ' '
    Also just to make sure if you have access to the database just login and execute this statement which should give the results as expected. If this works here successfully then it executes the same in XI also.
    Regards,
    ---Satish

  • Update in JDBC-Adapter (Send)

    Hallo,
    I´m trying to execute a Update in the JDBC-Adapter (Sender). When a Select-Statement results in exactly one entry back from the data-base I wont to Update this entry.
    How refrencing to the enty (for example by an primary key)? I found only documentation for Receive-JDBC-Adapter...
    Thanks in advance,
    Frank

    Hi Frank,
    At last I get your scenario..
    One solution to your problem can be the following though i am not sure if this is a perfect soultion or a viable solution but, it is a workaround solution which you can surely try.
    1. To update the status of your database on the basis on the events that have taken place, you can configure a JDBC Adapter as a receiver.This JDBC adapter will contain the event and the flag value as well as Update condition.
    Just check this blog and SAP help to understand how JDBC receiver adapter works,
    /people/sap.user72/blog/2005/06/01/file-to-jdbc-adapter-using-sap-xi-30
    http://help.sap.com/saphelp_nw04/helpdata/en/64/ce4e886334ec4ea7c2712e11cc567c/content.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/2e/96fd3f2d14e869e10000000a155106/content.htm
    2. In your JDBC sender adapter that is polling over your DB table, you can give the value for UPDATE as <test>. This means that you are not changing anything even after the adapter has picked up intfo from the table. Ofcourse, you would have to increase the polling interval time as the JDBC receiver has to update the DB.
    I know this solution is a long shot and an added headache but if nothing works out, you can always do it this way.
    Hope this helps,
    Regards,
    Bhavesh.

  • Sender JDBC Adapter - Stored procedure

    Hello all, I just read a lot of topics in this forum about this subject.
    I found two indications in contracdictions in the documentation :<a href="http://help.sap.com/saphelp_nw04/helpdata/en/7e/5df96381ec72468a00815dd80f8b63/frameset.htm">Configuring the Sender JDBC Adapter</a>
    1. Concerning Query SQL Statement
    You have the following options:
    &#9679;     Specify a valid SQL SELECT statement to select the data to be sent from the specified database.
    &#9679;     Specify an SQL EXECUTE statement to execute a stored procedure, which contains exactly one SELECT statement.
    2. Concerning Update SQL Statement :
    This is recommended if the data has not only been read, but also changed by a stored procedure entered under Query SQL Statement.
    It is ambigous, isn't it ?
    My question is simple :
    Does somebody already use Sender JDBC Adapter with Stored procedure as Select statement including many steps :
    - update actions on database
    - select query to return data to XI adapter
    (Update statement stay empty or with value <TEST>.
    To provide more information, I have a reference table to read. But this reference table must be updated by a stored procedure before being able to be read accordingly.
    So As I can't do both process with Sender Adapter (call a procedure and execute a select statement) => I want to include both actions (updates and select) in an alone stored procedure.
    Could I get wanted data as a resultset ?

    Hi,
    >><i>Update statement stay empty or with value <TEST>.</i>
    It should be <TEST> if you do not want an Update to happen.
    Regarding Sender JDBC adapter with stored procedures, which DB are you trying to access. Sender JDBC adapter does not support Oracle Stored Procedures as they return Cursors and Sender JDBC adapter can deal with only Resultset.
    As for executing both Update and Select in the SP, though I havent tried, this should surely be possible.
    Regards,
    Bhavesh

  • JDBC Adapter Call a Table-Valued Function

    Hello to all,
    we're using the JDBC adapter to access a MS SQL-Server 2008.
    I have to call a "Table-Valued Function" via JDBC.
    Has anybody done this?
    I've tried to call it like a stored procedure with the following:
    <ns1:LGBuchungSAP_REQ xmlns:ns1="http://xyz.de/pi/mav/kantine">
         <fLGBuchungenSAP>
              <Tablename action="execute">
                   <table>dbo.fLGBuchungenSAP</table>
              </Tablename>
         </fLGBuchungenSAP>
    </ns1:LGBuchungSAP_REQ>
    but I get following error:
    com.sap.engine.interfaces.messaging.api.exception.MessagingException: Error processing request in sax parser:
    Error when executing statement for table/stored proc. 'dbo.fLGBuchungenSAP' (structure 'fLGBuchungenSAP'): com.microsoft.sqlserver.jdbc.SQLServerException:
    Fehler bei der Anforderung für 'fLGBuchungenSAP' (Prozedur), weil 'fLGBuchungenSAP' ein Tabellenwertfunktion-Objekt ist.
    Calling with a select-statement also fails:
    <ns1:LGBuchungSAP_REQ xmlns:ns1="http://xyz.de/pi/mav/kantine">
         <STATEMENT_NAME>
              <Tablename action="SELECT">
                   <table>dbo.fLGBuchungenSAP(&apos;20101101 00:00:00&apos;, &apos;20110101 00:00:00&apos;)</table>
              </Tablename>
         </STATEMENT_NAME>
    </ns1:LGBuchungSAP_REQ>
    with error:
    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <!-- Eingangs-Message -->
    <SAP:Error xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" SOAP:mustUnderstand="1">
         <SAP:Category>XIAdapterFramework</SAP:Category>
         <SAP:Code area="MESSAGE">GENERAL</SAP:Code>
         <SAP:P1></SAP:P1>
         <SAP:P2></SAP:P2>
         <SAP:P3></SAP:P3>
         <SAP:P4></SAP:P4>
         <SAP:AdditionalText>com.sap.engine.interfaces.messaging.api.exception.MessagingException: Error processing request in sax parser: Error when executing statement for table/stored proc. 'dbo.fLGBuchungenSAP('20101101 00:00:00', '20110101 00:00:00')' (structure 'STATEMENT_NAME'): java.lang.IndexOutOfBoundsException: Index: 4, Size: 4</SAP:AdditionalText>
         <SAP:Stack></SAP:Stack>
         <SAP:Retry>M</SAP:Retry>
    </SAP:Error>
    Please advice
    Regards
    Christian

    Hello to all,
    I solved the problem.
    You have to call it this way:
    <ns1:LGBuchungSAP_REQ xmlns:ns1="http://xyzde/pi/mav/kantine">
         <STATEMENT>
              <LGBuchungSAP action="SQL_DML">
                   <access>select * from dbo.fLGBuchungenSAP(&apos;$DatumVon$&apos;, &apos;$DatumBis$&apos;)</access>
                   <key>
                        <DatumVon>20101101 00:00:00</DatumVon>
                        <DatumBis>20110101 00:00:00</DatumBis>
                   </key>
              </LGBuchungSAP>
         </STATEMENT>
    </ns1:LGBuchungSAP_REQ>
    But I get the next error: "A result set was generated for the update task"
    <SAP:Error xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" SOAP:mustUnderstand="1">
         <SAP:Category>XIAdapterFramework</SAP:Category>
         <SAP:Code area="MESSAGE">GENERAL</SAP:Code>
         <SAP:P1></SAP:P1>
         <SAP:P2></SAP:P2>
         <SAP:P3></SAP:P3>
         <SAP:P4></SAP:P4>
         <SAP:AdditionalText>com.sap.engine.interfaces.messaging.api.exception.MessagingException: Error processing request in sax parser: Error when executing statement for table/stored proc. 'LGBuchungSAP' (structure 'STATEMENT'): com.microsoft.sqlserver.jdbc.SQLServerException: Es wurde ein Resultset für den Aktualisierungsvorgang generiert.</SAP:AdditionalText>
         <SAP:Stack></SAP:Stack>
         <SAP:Retry>M</SAP:Retry>
    </SAP:Error>

  • QUESTION abt "SQL_DML" of the Receiver JDBC Adapter

    HI ALL,
    i hav a doubt abt "SQL_DML" of the Receiver JDBC Adapter.
    i wanna use two SQL Statements in the "SQL_DML" structure to manipulate two tables.
    i.e.
    <root>
      <stmt>
        <Customers action="SQL_DML">
          <access>
                          INSERT INTO Customers VALUES (u2019$NAME$u2019, u2019$ADDRESS$', '$KEYFIELD$u2019);
                          INSERT INTO Companys VALUES('$NAME$')    
          </access>
          <key>
            <NAME>Company</NAME>
            <ADDRESS>Street 3 </ADDRESS>
            <KEYFIELD>CO</KEYFIELD>
          </key>
        </Customers>
      </stmt>
    </root>
    BUT i cant ascertain if it permit like this writting above ??
    Requset help in this regards.
    Thx in advance.
    brian

    Hi,
    You need to have two different statements. Each for one insert query. Your query will come under access tag and palceholders under kay tag. Action will remain same as you have given, but under both statements.
    Ex:
    <root>
    <stmt1>
    <Customers action="SQL_DML">
    <access>
    INSERT INTO Customers VALUES (u2019$NAME$u2019, u2019$ADDRESS$', '$KEYFIELD$u2019);
    </access>
    <key>
    <NAME>Company</NAME>
    <ADDRESS>Street 3 </ADDRESS>
    <KEYFIELD>CO</KEYFIELD>
    </key>
    </Customers>
    </stmt1>
    <stmt2>
    <Customers action="SQL_DML">
    <access>
    INSERT INTO Companys VALUES('$NAME$')
    </access>
    <key>
    <NAME>Company</NAME>
    </key>
    </Customers>
    </stmt2>
    </root>
    Hope this helps.
    Regards,
    Siddhesh S.Tawate
    Edited by: siddhesh tawate on Apr 24, 2009 8:10 AM

  • SAX Parser Error in JDBC Adapter

    I am using a JDBC adapter to execute SQL statements during mapping runtime. However, it issues me an error regarding the SAX Parser when I have a '&' character in the SQL statement. I am not able to remove the & since it is in the database that I access and it will result to data inconsistency. I think that when the JDBC adapter of XI converts the SQL string to the XML format, it does not include the amp; string to the &, thus causing the SAX Parser to throw the error.
    Is there someway I can configure the JDBC adapter in such a way that it will replace the & with &amp;. Or is there a way to display how the JDBC adapter converts the SQL statement to its the XML representation of it?
    Thanks a lot.

    Hi,
    For this kind of situation use some unique character combination  like "#@!" for replacing "&" then parse the document and the restore the "&" later .
    For this convert the input stream into Strring and then replace the occurences of "&".
    regards.

  • CLOB Datatype with JDBC Adapter

    Hi,
    we try to fill a Clob Datatype to JDBC Database.
    We try 2 ways with the JDBC Adapter:
    action="SQL_DML" with an SQL Statment and $placeholders$
    But how can i say the key element that it is a CLOB type?
    He used this a VARCHAR and there a not more than 4k Chars allowed.
    second way is action="EXECUTE" to call a Stored Procedure, but there we got the error that CLOB type is an Unsupported feature.
    Any Idea?
    Regards,
    Robin
    Message was edited by: Robin Schroeder

    Ok i will check this...
    But i'm right when i say that the only way to fill CLOB Type is to use a Stored Procedure ?
    or is there any possibility to do this with action="SQL_DML" ?
    Regards,
    Robin

  • Sender JDBC adapter

    Hi All,
    I have 2 tables. First table
    Header
    Name    EmpId  Status
    Jai     5601    0
    Karthik 5579    0
    Item
    Name     Contactnumber
    Jai      9894268913
    Jai      04312432431
    Karthik  98984110335
    Karthik  04222643993
    Now I need to select a single record from Header and all its corresponding records from Item then I need to update the status field to prevent processing the same record and move to next header and all its corresponding Item records. How can I achieve this in a scenario with out BPM? How should I write my SQL and Update SQL in sender commn channel?
    Appreciate your help in this.
    Thanks & Regards,
    Jai Shankar.

    Hi Jai,
    I guess I got it.
    You have to select a single document from the database. The problem is to qualify your select statement.
    a) The solution is to select the MIN record (MIN means you select only ONE)!
    b) On the other hand you want wo select corresponding from a second table.
    So you have to combine a) with b)
    a) select * from table_1 where event_id = (select min(event_id) from table_1 where status = 0)
    b) select * from table_2 t1, table_1 t2 where t1.name = t2.name
    Unfortunately I am not a SQL specialist.
    Somebody else should be able to combine the statements a) and b)
    Regards Mario

Maybe you are looking for

  • How can i secure my mail on the same desktop that is used by my hubby?

    I know that i can create multiple desktops but thats not what i want to do as i have firefox set up for my use & he uses safari. I just would like my mail to be private!

  • WM: Transfer Requirements with just one item

    Hi experts, does anybody know if it is possible to customize WM in order to create just one item per transfer requirement. My problem is that in material staging from PP, I have customized creation of transfer requirements on order release. If OF con

  • CSS justifications are different when I upload my page...

    I used to build websites with GoLive CS2 for number of years. With the purchase of a new laptop, I recently switch from CS2 to CS5. (But have been using CS4 at work). As GoLive is no longer existing, I just switch to Dreamweaver. I had several proble

  • Custom Facelets Handler to add Columns

    Hi, my application uses a custom grid based on Mojarra datatable. The grid has fixed colums on the left side, dynamic scrollable columns in the middle part and fixed colums on the right side. What i like to have is that i can define the fixed column

  • Elements 11 Depth of Field in Guided Mode

    I get black blobs whenever I drag my cursor to mark the area specified to be in focus.   Am I missing a setting to make that blackened area invisible?  When I click "done" the part of the photograph to be in focus is still covered with black.