JDBC Receiver Document Format

Hi,
I have to pull the data from DB.
The SQL Query is:
Select field1
       from systemName.table
       where field2 = field1
       order by field1.
Kindly suggest the way to define the data type to realize the SQL query on receiver side.
Regards
Piyush

Hi Piyush,
  Import this .xsd as external definition and proceed.
<xsd:schema elementFormDefault="qualified" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <xsd:element name="Receiver_JDBC" type="Statement1"/>
  <xsd:complexType name="Statement1">
    <xsd:sequence>
      <xsd:element name="statement1">
         <xsd:complexType>
        <xsd:sequence>
            <xsd:element name="Vishal">
              <xsd:complexType>
              <xsd:sequence>
              <xsd:element name="access"/>
              <xsd:element name="key">
              <xsd:complexType>
              <xsd:sequence></xsd:sequence>
             </xsd:complexType>
                  </xsd:element>
                </xsd:sequence>
                <xsd:attribute name="action">
               <xsd:simpleType>
                 <xsd:restriction base="xsd:string">
       <xsd:pattern value="SQL_QUERY|SQL_DML"/>
             </xsd:restriction>
         </xsd:simpleType>
         </xsd:attribute>
       </xsd:complexType>
       </xsd:element>
      </xsd:sequence>
      </xsd:complexType>
      </xsd:element>
    </xsd:sequence>
  </xsd:complexType>
  </xsd:schema>
You can generate this .xsd using xml spy or any other xml tool.
Thanks and Regards
Vishal Kumar

Similar Messages

  • JDBC Receiver: FATAL ERROR document format: invalid level 4

    Hi,
    I am creating an IDOC -JDBC scenario .
    The XML created has action as delete.
    but in the comminication channel i am  getting an error which is
    Message processing failed. Cause: com.sap.aii.af.ra.ms.api.RecoverableException: Error processing request in sax parser: Error when executing statement for table/stored proc. 'T_SAP_WBS' (structure 'statement1'): java.sql.SQLException: FATAL ERROR document format: invalid level 4' found (structure 'statement1')
    does any one have any idea on this?
    Regards,
    Tarun Bahal

    Hi,
    The JDBC format which you are using is incorrect.....please maintain the format as mentioned in this document...there seems to be some mismatch
    http://help.sap.com/saphelp_nw04/helpdata/en/2e/96fd3f2d14e869e10000000a155106/content.htm
    By maintaining the format i mean:
    1) maintain the hierarchy as mentioned in the link
    2) maintain the case (upper/ lower) for the standard elements (you seem to be using statement1 instead of Statement)
    3) If there are no multiple stattements then have the name as Statement
    If still facing the problem....provide your structure in sdn
    Regards,
    Abhishek.

  • XML Document Format for JDBC Receiver(Between operation)

    Hello everybody,
    is there a way to use a BETWEEN operation for the key in a SELECT XML document format????????, I need to filter in the Where for different Statements in teh strcuture as BETWEEN, thanks in advance.
    Regards,
    Julio

    http://help.sap.com/saphelp_nw70/helpdata/en/2e/96fd3f2d14e869e10000000a155106/content.htm
    Not sure but Check the option of
    <key1>
         <col2 compareOperation=u201DLTu201D>val2old</col2>
         <col2 compareOperation=u201DGTu201D>val2old</col2>
    </key1>
    Thanks,
    Beena.

  • JDBC document format

    Hi folks,
    I m using JDBC adapter at the Receiver side, and i m using "XML SQL Format" as message protocol.
    the document format looks like ;
    <root>
    <StatementName1>
    <dbTableName action=”UPDATE” | “UPDATE_INSERT”>
        <table>realDbTableName</table>
    <access>
    <col1>val1</col1>
    <col2>val2new</col2>
    </access>
    <key1>
    <col2>val2old</col2>
    <col4>val4</col4>
    </key1>
    <key2>
    <col2>val2old2</col2>
    </key2>
    </dbTableName>
    </StatementName1>
    </root>
    My question is can't we have multiple <dbtableName> have same action but different values in <table>tag assuming i have three tables to perform UPDATE_INSERT on say like below...and map data from the Same Source message.
    <root>
    <StatementName1>
    <dbTableName action=”UPDATE” | “UPDATE_INSERT”>
        <table>realDbTableName1</table>
    <access>
    <col1>val1</col1>
    <col2>val2new</col2>
    </access>
    <key1>
    <col2>val2old</col2>
    <col4>val4</col4>
    </key1>
    <key2>
    <col2>val2old2</col2>
    </key2>
    </dbTableName><dbTableName action=”UPDATE” | “UPDATE_INSERT”>
        <table>realDbTableName2</table>
    <access>
    <col1>val1</col1>
    <col2>val2new</col2>
    </access>
    <key1>
    <col2>val2old</col2>
    <col4>val4</col4>
    </key1>
    <key2>
    <col2>val2old2</col2>
    </key2>
    </dbTableName>
    <dbTableName action=”UPDATE” | “UPDATE_INSERT”>
        <table>realDbTableName3</table>
    <access>
    <col1>val1</col1>
    <col2>val2new</col2>
    </access>
    <key1>
    <col2>val2old</col2>
    <col4>val4</col4>
    </key1>
    <key2>
    <col2>val2old2</col2>
    </key2>
    </dbTableName>
    </StatementName1>
    </root>

    HI Jeet,
    You can definetly update multiple tables using only one call.
    The only change in your message format is that it should multiple Statement tags. Updating different tables in sql will correspond to different statements.
    example.
    <root>
      <StatementName1>
    <dbTableName action=”UPDATE” | “UPDATE_INSERT”>
        <table></table>
    <access>
    <col1>val1</col1>
    <col2>val2</col2>
    </access>
    <key1>
    <col2>val2</col2>
    <col4>val4</col4>
    </key1>
    <key2>
    <col2>val2old2</col2>
    </key2>
    </dbTableName>
      </StatementName1>
      <StatementName2>
    <dbTableName action=”INSERT”>
    <table>realDbTableName2</table>
    <access>
    <col1>val1</col1>
    <col2>val2</col2>
    </access>
    <access>
    <col1>val11</col1>
    </access>
    </dbTableName> 
      </StatementName2>
    Please refer the following link for more detail.
    http://help.sap.com/saphelp_nw2004s/helpdata/en/22/b4d13b633f7748b4d34f3191529946/frameset.htm
    Regards,
    Yomesh

  • JDBC Receiver Adapter FATAL ERROR

    Hi experts,
    I have a ccBPM to JDBC sync scenario. My Integration Process (IP_Workflow) has a Send Step (Mode = Synchronous, Interface = SIA_Update). This SIA_Update is abstract, synchronous and It´s message type has the following structure:
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:MT_Update xmlns:ns0="http://www.test.com.br/bpm">
       <StatementName>
          <dbTableName action="UPDATE">
             <table>PI_FORNECEDORES</table>
             <access>
                <STATUS>E</STATUS>
             </access>
             <key compareOperation="EQ">
                <NAME>Name01</NAME>
             </key>
             <key compareOperation="EQ">
                <NAME>Name02</NAME>
             </key>
          </dbTableName>
       </StatementName>
    </ns0:MT_Fornecedores_Update>
    I´m expecting this structure to generate the following update:
    UPDATE PI_FORNECEDORES SET STATUS = 'E' WHERE NAME = 'Name01' OR NAME = 'Name02'
    At RWB I receive the following error message:
    Message processing failed. Cause: com.sap.engine.interfaces.messaging.api.exception.MessagingException:
    Error processing request in sax parser:
    Error when executing statement for table/stored proc. 'PI_FORNECEDORES' (structure 'StatementName'):
    java.sql.SQLException: FATAL ERROR document format: invalid level 7' found (structure 'StatementName')
    What is wrong with this scenario?

    Thanks for your response Abhi.
    About "key" field, at SAP Help I found the following: "You can use any number of  elements to formulate your condition." Link: Defining an UPDATE Statement.
    The response structure is as follow:
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:MT_Update_Response xmlns:ns0="http://www.test.com.br/bpm">
       <StatementName_response>
          <update_count>10</update_count>
       </StatementName_response>
    </ns0:MT_Fornecedores_Update_Response>
    I´m not sure but I think the problem is at request, not at response because it´s not even updating the database.
    Any other idea?
    Thanks,
    Gabriela

  • JDBC Receiver Adapter -- Synch Select. ERROR

    Hello,
    We have implemented the scenario described by Bhavesh Kantilal in blog 3928:
    JDBC Receiver Adapter -- Synchronous Select – Step by Step 
    /people/bhavesh.kantilal/blog/2006/07/03/jdbc-receiver-adapter--synchronous-select-150-step-by-step
    but modified to our requirements.
    An Idoc is coming in, mapped to a sync receiver jdbc as described to collect data from a jdbc table.
    Result when connecting the oracle database with the jdbc receiver adapter:
    Error processing request in sax parser: Error when executing statement for table/stored proc. 'T_ST_MAINDRIVER' (structure 'STATEMENT'): java.sql.SQLException: ORA-00942: table or view does not exist
    Oh, like to complete the information by the payload from the jdbc rec. connect:
    <?xml version="1.0" encoding="UTF-8" ?>
    - <ns0:MT_JDBC_LOOPUP_ID xmlns:ns0="http://www.xxx.org/excel">
    - <STATEMENT>
    - <TABLENAME ACTION="SELECT">
      <TABLE>T_ST_MAINDRIVER</TABLE>
      <ACCESS />
    - <KEY>
      <MAINDRIVER compareOperation="=">Optomechanical</MAINDRIVER>
      </KEY>
      </TABLENAME>
      </STATEMENT>
      </ns0:MT_JDBC_LOOPUP_ID>
    The table exists on the database. So, what is our mistake? Do you have any ideas?
    Best regards
    Dirk
    Message was edited by:
            Dirk Meinhard
    Message was edited by:
            Dirk Meinhard

    Hi Anil,
    I am back on my JDBC problem and I am one step further!
    Thank you for this hint. Looks like this is the solution.
    So I like to add my next question !
    My new error is resulting from my query command.
    I have set "=" to find a specific entry as compare operation.
    Error when executing statement for table/stored proc. 'IRIS.T_ST_MAINDRIVER' (structure 'STATEMENT'): java.sql.SQLException: FATAL ERROR document format in structure 'TABLENAME': unexpected value '=' for attribute 'compare' found
    Looks like this is not ok .
    This is my xml of this query:
    <ns0:MT_JDBC_LOOPUP_ID xmlns:ns0="http://www.xxx.org/excel">
       <STATEMENT>
          <TABLENAME ACTION="SELECT">
             <TABLE>IRIS.T_ST_MAINDRIVER</TABLE>
             <ACCESS/>
             <KEY>
                <MAINDRIVER compareOperation="=">Optomechanical</MAINDRIVER>
             </KEY>
          </TABLENAME>
       </STATEMENT>
    </ns0:MT_JDBC_LOOPUP_ID>
    Can you, or anybody else, give the helping idea?
    regards
    Dirk

  • Issue with processing time of JDBC receiver adapter

    Hi all,
    We are using PI 7.1 EHP1.
    We have an issue with JDBC receiver adapter taking too much time to process messages.
    We are using XML SQL format message protocol with INSERT_UPDATE as the document format.
    Each message can contain multiple records, i.e. 1 single message can result in many updates/inserts.
    Currently, time taken to process in 6-12 secs which is quite high considering the messages are not very large in size.
    We sent the statements to Oracle DBA to see if anything about the queries being used is causing issues. Awaiting inputs.
    In the mean time, wanted to check if there is anything that can be done from PI side that will help us improving the processing time.
    Thanks in Advance,
    Sailaja.

    Hi,
           i think the main cause is  query taking long time to execute in DataBase.
          -> increase the read time and response time in the JDBC receiver adapter.
      In the advanced mode table section of sender channel and receiver channel configurations, we can set driver properties for each DB connection. Any such property would have to contain prefix 'driver:'(with out quotes).
    For Oracle Database JDBC thin driver 10.2.0.3 version, the property oracle.jdbc.ReadTimeout helps to set read timeout while reading from the socket. Also for setting login time out in Oracle, we use oracle.net.CONNECT_TIMEOUT. To set these two properties use as follows: driver:oracle.jdbc.ReadTimeout 1000 driver:oracle.net.CONNECT_TIMEOUT 1000 The TimeOut Driver properties like ReadTimeout and CONNECT_TIMEOUT are in milliseconds.
    Refer note 1078420 for more details
    please go through this blog i hope it will help you.
        http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/c059d583-a551-2c10-e095-eb5d95e03747
    regards,
      ganesh
    Edited by: ganesh.nijampudi on Oct 25, 2011 12:00 PM

  • JDBC Receiver Select issue

    Hi,
    in the scnario soap to jdbc i am selecting records from oracle database from the soap request and response as to be sent back to soap.
    here i am getting this error as
    com.sap.engine.interfaces.messaging.api.exception.MessagingException: Error processing request in sax parser: Error when executing statement for table/stored proc. 'table' (structure 'Statement'): java.sql.SQLException: FATAL ERROR document format: structure 'Statement', key element 'DATA_COMPLETE' contains no values
    even i have checked the blog /people/bhavesh.kantilal/blog/2006/07/03/jdbc-receiver-adapter--synchronous-select-150-step-by-step
    kindly suggest
    Regards
    Vijay

    for this i noticed that there are no columns in the statement...
    now to mapp this column names in request as i get only one field as input so that i can only htat filed ..
    Map that field itself to the target structure.....the values in the column wont be populated automatically.
    If the one source field contains concatenated value then using substring populate target columns accordingly.
    Regards,
    Abhishek.

  • JDBC Receiver

    Hi All,
    I have created a JDBC receiver structure in the following format:
    DT_Test
            Table
                   MATERIAL
                             action  (attribute)
                             access
                                     <Field1>
                                     <Field2>
    and  i have created action as an attribute and i have mapped the field Table with <tablename> and action with UPDATE_INSERT, rest of the table field are mapped with corresponding field mapping. But i m getting the following error, when it hits the DB. Let me know if I need to make any changes to the structure
    Message processing failed. Cause: com.sap.engine.interfaces.messaging.api.exception.MessagingException: Error processing request in sax parser: Error when executing statement for table/stored proc. 'MATERIAL' (structure 'Table'): java.sql.SQLException: FATAL ERROR document format: structure 'Table', no key element found
    Error processing request in sax parser: Error when executing statement for table/stored proc. 'MATERIAL' (structure 'Table'): java.sql.SQLException: FATAL ERROR document format: structure 'Table', no key element found
    Regards,
    Nithiyanandam

    Hi
    Please take a look here.
    http://help.sap.com/saphelp_nwpi71/helpdata/en/43/9519abb1146353e10000000a11466f/frameset.htm
    Something is wrong with your message that is send to JDBC Adapter.
    BR
    Maciej

  • JDBC Receiver adapter ( INSERT/UPDATE with SELECT)

    Is it possible to have following kind of SQL Statement comming out JDBC Receiver Adatpter. If yes what would be the corresponding XML Document format for this.
    UPDATE suppliers 
    SET supplier_name = ( SELECT customers.name
    FROM customers
    WHERE customers.customer_id = suppliers.supplier_id)
    This condition also needs to be applied for Insert condition. Any pointer would be useful.
    Thanks,
    Samir

    Hi
    Refer this links,
    http://help.sap.com/saphelp_nw04/helpdata/en/22/b4d13b633f7748b4d34f3191529946/frameset.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/b0/676b3c255b1475e10000000a114084/frameset.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/2e/96fd3f2d14e869e10000000a155106/frameset.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/4d/8c103e05df2e4b95cbcc68fed61705/frameset.htm
    Regards,
    Suryanaryana

  • Error With JDBC receiver adapter

    Hi Guys,
                  I am working with File to Jdbc scenario.at the file side the process is working fine.the file is picked up by the file adapter and send it XI.then XI sends the data to JDBC it shows an error in receiver side.the error is as follws
    Message processing failed. Cause: com.sap.aii.af.ra.ms.api.RecoverableException: Error processing request in sax parser: Error when executing statement for table/stored proc. 'sap_alt_spec' (structure 'Statementname'): java.sql.SQLException: ORA-00928: missing SELECT keyword
    so can any one tell me the solution to resolve the error?its urjent.

    Hi,
    please refer:
    for configuration of JDBC adpt-
    http://help.sap.com/saphelp_nw04/helpdata/en/64/ce4e886334ec4ea7c2712e11cc567c/frameset.htm
    for XML document formats(this is much imp.)-
    http://help.sap.com/saphelp_nw04/helpdata/en/64/ce4e886334ec4ea7c2712e11cc567c/frameset.htm
    Ranjit

  • SQL XML Document format - Sequence of excecution for the sentences

    Hi, I am using XML SQL Document format to send actions to an Oracle database.
    My concern is this:  I need to insert several invoice header lines then after that I need to insert the Invoice position lines and then, at the end, i need to excecute an store procedure.
    If I do all that in one message, each sentence is treated by the DB in order  ? or is it treated  in paralel?
    It is possible to excecute StatementName1 StatementName2 and StatementName3 in that exact order?
    An example of the xml message is this...
    <Message>
    <StatementName1>
    <dbTableName action=u201DINSERTu201D>
    <table>TABLE1</table>
    <access>
    <col1>val1</col1>
    <col2>val2</col2>
    </access>
    <access>
    <col1>val11</col1>
    </access>
    </dbTableName>
    </StatementName1>
    <StatementName2>
    <dbTableName action=u201DINSERTu201D>
    <table>TABLE2</table>
    <access>
    <col1>val1</col1>
    <col2>val2</col2>
    </access>
    <access>
    <col1>val11</col1>
    </access>
    </dbTableName>
    </StatementName2>
    <StatementName3>
    <storedProcedureName action=u201D EXECUTEu201D>
    <table>realStoredProcedureeName</table>
    <param1 [isInput=u201Dtrueu201D] [isOutput=true] type=SQLDatatype>val1</param1>
    </storedProcedureName >
    </StatementName3>
    </Message>

    I just want to clarify I need to execute the sentences serially, also i am using a JDBC adapter in XI to do the connection.
    On the other hand I believe the order of excecution has relation with the DB and not with the SAP program, because once the message is received by de DB, how it treats it is a responsability of the DB.
    Thanks.
    Mariano.

  • JDBC Receiver Adapter with Native SQL String

    Hi experts
    I need to use a JDBC Receiver Adapter with Message Protocol of Native SQL String, but I don´t understand how to create my data type for XML Document Format. I studied the following example from the SAP Library,
    INSERT INTO tableName (column-name1, column-name2, column-name3) VALUES(u2018column-value1u2019, u2018column-value2u2019, u2018column-value3u2019)
    i´ll be very thankful of your recommendations.

    Another simple way is..
    Create receiver data structure like this....
    <StatementName>
    <anyName action=u201DSQL_DMLu201D>
    <access>INSERT INTO tableName (column-name1, column-name2, column-name3) VALUES('$column-value1$', '$column-value2$', '$column-value3$')
    </access>
    <key>
      <column-value1>value1</column-value1>
      <column-value2>value2<column-value2>
       <column-value3>value3<column-value3>
    </key>
    </anyName > 
    </StatementName>
    Rest are all same.

  • Testing JDBC receiver channel

    Hi,
    I am new to XI and I am trying configure JDBC-Receiver channel for testing purpose.
    As documents says native Sql message protocal will be used for testing purpose I have selected that.Note I have given all connection parameters properly.
    In my SQL syntax parameters i have given one query
    'INSERT INTO Test  (name,age,loc) VALUES (‘Prabhakar’, ‘30’, ‘HYD’) '
    and activated the channel.
    Will it directly insert into database with the values in the specified table ?
    or do i need to do any thing else ?
    If it is wrong way,please tell me how to check my receiver channel is working fine or not without going to souruce to target scenario ?

    Hi,
    >>>>Will it directly insert into database with the values in the specified table ?
    no, it won't you need to start it with a message
    have a look at jdbc weblogs in the XI FAQ page documents section
    (link below)
    also have a look at this page:
    http://help.sap.com/saphelp_nw04/helpdata/en/2e/96fd3f2d14e869e10000000a155106/content.htm
    for jdbc document formats (messages which you can send to the jdbc adapter) to update the database
    Regards,
    michal
    <a href="/people/michal.krawczyk2/blog/2005/06/28/xipi-faq-frequently-asked-questions"><b>XI / PI FAQ - Frequently Asked Questions</b></a>

  • Error while updating database using jdbc receiver adapter

    Hi All,
    I am trying to update a single record using jdbc receiver adapter.
    This is my the message that is getting created..
    <?xml version="1.0" encoding="UTF-8" ?>
    - <ns0:Data xmlns:ns0="urn:Test">
    - <STATEMENT>
    - <TABLENAME ACTION="UPDATE_INSERT">
      <TABLE>ORDERS</TABLE>
    - <ACCESS>
      <OrderID>99999</OrderID>
      <CustomerID>VICTE</CustomerID>
      <EmployeeID>3</EmployeeID>
      <ShipAddress>VICTE</ShipAddress>
      </ACCESS>
    - <KEY>
      <OrderID compareOperation="EQ">99999</OrderID>
      <ShipAddress compareOperation="EQ">VICTE</ShipAddress>
      </KEY>
      </TABLENAME>
      </STATEMENT>
      </ns0:Data>
    But in Adapter Monitoring i am getting the following error..
    <i>Error while parsing or executing XML-SQL document: Error processing request in sax parser: Error when executing statement for table/stored proc. 'ORDERS' (structure 'STATEMENT'): java.sql.SQLException: [Microsoft][ODBC SQL Server Driver][SQL Server]Line 1: Incorrect syntax near 'VICTE'.</i>
    Regards,
    Rahul

    Rahul,
    > In this case i believe the interface has to be synch.
    > So what will the response message type be like..
    Not necessary. UPDATE can be asynch as well.
    Can you turn the trace on like pointed by Michal and then you can see the Query in the Audit Log of the adapter montioring. Try to execute the same query from your DB Client like TOAD and see what is the Syntax error you are getiing.!
    The problem looks like some field has some dataype / column name mismatch.
    Regards
    Bhavesh

Maybe you are looking for

  • Increase in file size worse in XI Pro when signing.

    Hello there, We started using AcrobatPro X for making, securing and signing PDF files of our test reports. The validity of these reports is not limited in time. So we include this revocation information at time of signing. We use our Belgian eID-card

  • WRV200 lockup worse with 1.0.39

    The WRV200 would lock about every 24 hours. Flash to 1.0.39 and I will be lucky to get this thread out before it requires a power cycle.  The DHCP function seems to be part of the issue. One look at the table and it seems this part was damaged in the

  • E17 trouble with mazimizing Chromium...

    Hi, I'm using  E17 and I'm currently facing an issue which is really making me go nuts. I have two shelves on the top of my screen, and one on the bottom, when I maximize a window I want it to go under my bottom shelf, but stops its vertical maximiza

  • Gmail questions

    Can anyone help me figure out some issues w/ gmail and my iphone? So, when I send an e-mail from gmail it comes up on my iphone as a new message from me. Additionally, when I send an e-mail from my iphone, I receive that same e-mail in my inbox. Addi

  • Rotating an ImageIcon in Graphics2D

    I am still a beginner where Java programming is concerned. In order to improve my skills I decided to re-invent the wheel and write a pack (deck) of cards Class based around Swing. This in itself is not difficult however I have come across a problem.