JDBC Receiver - Message Protocol = Native SQL String

Hi Friends
Has any one worked on JDBC Receiver with Message Protocol as <b>Native SQL String</b>?
If so, can you please send me a detailed scenario of it...like
the datatypes, message types, mappping.
Because if I use the Native SQL String, then I think I have to pass a simple SQL string to the receiver..
So how can I do that?
Regards,
Raju...

Hi Raju,
This can be done using the following format,
<root>
  <stmt>
    <Customers action="SQL_DML">
      <access> UPDATE Customers SET Name=’$NAME$’ WHERE Number='$NUMBER$’
      </access>
      <key>
        <NAME>ABC</NAME>
        <NUMBER>000</NUMBER>
      </key>
    </Customers>
  </stmt>
</root>
Just pass map the value to the correspondung fields in the KEY FIELD and it will work like you want, dynamically.
Regards,
bhavesh

Similar Messages

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

  • Native SQL string  in Receiver JDBC

    Hi All,
    I have a requirement where in i have to make us of message protocol : Native SQL String .
    SDN explanation is as follow :
    When inserting a line into a table the corresponding document looks as follows:*
    "INSERT INTO tableName  (column-name1, column-name2, column-name3) VALUES(u2018column-value1u2019, u2018column-value2u2019, u2018column-value3u2019) "
    I tried to pass the data as shown below :
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:MT_SrcProxy xmlns:ns0="http://infosys.com/pi/projects/pepsi/n1">
       <Record>
         <input> "INSERT INTO Emp (EmpNO,FirstName,LastName,DOJ,BaseLocation)VALUES('103','abc','xyz','NULL','Blore')" </input>
       </Record>
    </ns0:MT_SrcProxy>
    I am getting the following error in communication channel :
    Message processing failed. Cause: com.sap.engine.interfaces.messaging.api.exception.MessagingException: Error 'com.microsoft.sqlserver.jdbc.SQLServerException: Incorrect syntax near '<'.' executing service raw2sql with SQL statement '<?xml version="1.0" encoding="UTF-8"?> <ns0:MT_SrcProxy xmlns:ns0="http://infosys.com/pi/projects/pepsi/n1">   <Record>     <input>"INSERT INTO Emp (EmpNO,FirstName,LastName,DOJ,BaseLocation)VALUES('103','abc','xyz','NULL','Blore')"</input>   </Record> </ns0:MT_SrcProxy>'
    Can anyone please help me in this regard

    Hi Vinay,
    I have not tried on this  but looks like the output that needs to be passed must be a Non XML and not an XML output.
    Please refer this thread to get more clear idea on this.
    Re: How to use Native SQL String.
    Thanks
    Amit

  • How to use Native SQL String

    Hi all,
    How do i use Native SQL String in the Reciver JDBC Adapter.
    Do i need to change the message format could u suggest me some blogs on the same.
    Also please can anyone let me knw if i can use this for stored procedure.

    hi aditya,
    there shud be no format as such. for sql xml format there are specific structure. but for native sql there shudnt be any specific structure.
    as pointed in sap documentaion:
    Instead of an XML document format, a text is expected that represents any valid SQL statement.
    When inserting a line into a table the corresponding document looks as follows:
    INSERT INTO tableName  (column-name1, column-name2, column-name3) VALUES(‘column-value1’, ‘column-value2’, ‘column-value3’)
    so jus make sure that u give a valid sql statement becoz if will be passed as it is to the database and try ur scenario.
    regards,
    latika.

  • JDBC Receiver does not convert empty string to NULL

    Hello experts,
    I am facing a problem with an INSERT statement to ORACLE DB where some of the fields are empty, for example:
    - <STATEMENT_VLP_CONT_DETAILS>
    - <TABLE_VLP_CONT_DETAILS ACTION="INSERT">
      <TABLE>VLP_CONT_DETAILS</TABLE>
    - <ACCESS>
      <VLP_HDR_ID>43</VLP_HDR_ID>
      <VLP_CONT_LINE_ID>1</VLP_CONT_LINE_ID>
      <QUANTITY>1</QUANTITY>
      <OWNER>CBHU</OWNER>
      <SERIAL_NO>3372739</SERIAL_NO>
      <CONT_ISO_CODE>2300</CONT_ISO_CODE>
      <WEIGHT>6.44</WEIGHT>
      <POL>ILASH</POL>
      <POD>FRFOS</POD>
      <FD>FRFOS</FD>
      <OPER_CODE>COS</OPER_CODE>
      <CUR_STOW_LOC>150102</CUR_STOW_LOC>
      <PRV_STOW_LOC />
      <HAZARDOUS>N</HAZARDOUS>
    In the JDBC Receiver comm channel I selected: Interpretation of Empty String Values = NULL Value.
    It seems the empty strings are not converted to NULL values as can be seen in the reflected SQL statement in RWB:
    INSERT INTO  VLP_CONT_DETAILS (VLP_HDR_ID, VLP_CONT_LINE_ID, QUANTITY, OWNER, SERIAL_NO, CONT_ISO_CODE, WEIGHT, POL, POD, FD, OPER_CODE, CUR_STOW_LOC, PRV_STOW_LOC, HAZARDOUS, EMPTY, REFER, OOG, HAZARD_IMDG, TEMP_SET, TEMP_MIN, TEMP_MAX, FRONT_OVL, REAR_OVL, RIGHT_OVW, LEFT_OVW, OVERHEIGHT, COMMODITY, BOOKING_REF, ALLOTMENT, YARD_LOC, LD_SEQ_CRANEID, LD_SEQ_NUMBER, LD_STATUS, STACKABLE, OPT_PORT_CODE1, OPT_PORT_CODE2, OPT_PORT_CODE3) VALUES (44, 1, 1, CBHU, 3372739 , 2300,  6.44, ILASH, FRFOS, FRFOS, COS,   150102,         , N, N, N, N,      ,      ,      ,      ,    ,    ,    ,    ,    ,     ,             ,    ,           ,    ,    0,    64, N,      ,      ,      )
    So, I am getting the following error:
    Could not execute statement for table/stored proc. "VLP_CONT_DETAILS" (structure "STATEMENT_VLP_CONT_DETAILS") due to java.sql.SQLException: ORA-00936: missing expression
    Help would be appreciated.

    Hi Effi,
    There is a mismatch in the field and thier value.
    Here field id 37
    VLP_HDR_ID, VLP_CONT_LINE_ID, QUANTITY, OWNER, SERIAL_NO, CONT_ISO_CODE, WEIGHT, POL, POD, FD, OPER_CODE, CUR_STOW_LOC, PRV_STOW_LOC, HAZARDOUS, EMPTY, REFER, OOG, HAZARD_IMDG, TEMP_SET, TEMP_MIN, TEMP_MAX, FRONT_OVL, REAR_OVL, RIGHT_OVW, LEFT_OVW, OVERHEIGHT, COMMODITY, BOOKING_REF, ALLOTMENT, YARD_LOC, LD_SEQ_CRANEID, LD_SEQ_NUMBER, LD_STATUS, STACKABLE, OPT_PORT_CODE1, OPT_PORT_CODE2, OPT_PORT_CODE3
    And value is 35
    44, 1, 1, CBHU, 3372739 , 2300, 6.44, ILASH, FRFOS, FRFOS, COS, 150102, , N, N, N, N, , , , , , , , , , , , , , , 0, 64, N, , ,
    Give empty values for nuil fields so that they can be made NULL by jdbc adapter
    Regards
    Suraj

  • PI 7.0 - jdbc receiver issue with MS SQL Server

    Hello Experts,
    I have a jdbc receiver scenario on PI 7.0 for just one table on MS SQL Server and I'm using the update_insert action.
    When the entry does not exist it is created normally and returns insert_count=1 and update_count=0.
    When the entry already exists, it's generated the statements for insert and for update (the 2 statements are visible on RWB) and returns insert_count=0 and update_count=0.
    Any error occurs and in the RWB the log shows the request was processed with success.
    I've already enabled the log for sql statements on the channel, but the statements are correct.
    I've reviewed also the <key> tag on the mapping and it's ok.
    Any suggestion to try fix this issue?
    Thank you very much.

    Can you please check in the database the format of the specified fields in the update statement. Sometime we can have situations that the insert works but the subsequent update fails. An example:
    Suppose key field1 value being passed from XI is  '1234' in characters but in db it is stored as '00001234'.
    Regards,
    Indranil

  • Special character "&" in JDBC receiver - length problem

    Hi,
    Scenario: IDOC -- - XI --- JDBC (insert) (Message Protocol: XML Sql format)
    I have used JAVA mapping to replace "&" with "& amp;" in payload and sending the XML to JDBC receiver. 
    However, interface fails due to additional characters "amp;" which is causing the field length (exceeded) issue. 
    Please help.
    Mallik
    Edited by: mallik kancharla on Feb 3, 2010 7:46 PM
    Edited by: mallik kancharla on Feb 3, 2010 7:47 PM

    I think the JAVA mapping should be designed to pass & as it is and not convert it into &amp.....you should refer the mapping shown here: http://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/9420 [original link is broken] [original link is broken] [original link is broken]
    Regards,
    Abhishek.

  • Message protocol is different for sender and receiver JDBC

    In File adapter the message protocol can be either FTP or NFS for both sender as well as receiver. but for JDBC adapter the message protocol is JDBC and for receiver adapter the message protocol is XML SQL Format or native sql string only. Why this is different ? Why cant we use JDBC as message protocol for receiver also ?
    I thought JDBC is the message protocol for JDBC adapters irrespective of whether they are sender or receiver. Can someone throw light on this ?

    Hi,
    You can find more about JDBC scenario at following links:
    Configuring the Sender JDBC Adapter
    [http://help.sap.com/saphelp_nw04/helpdata/en/7e/5df96381ec72468a00815dd80f8b63/content.htm|http://help.sap.com/]
    [http://help.sap.com/saphelp_nw04/helpdata/en/1d/756b3c0d592c7fe10000000a11405a/content.htm|http://help.sap.com]
    Configuring the Receiver JDBC Adapter
    [http://help.sap.com/saphelp_nw2004s/helpdata/en/b0/676b3c255b1475e10000000a114084/content.htm|http://help.sap.com]
    [http://help.sap.com/saphelp_nw04/helpdata/en/64/ce4e886334ec4ea7c2712e11cc567c/content.htm|http://help.sap.com]
    [https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/6d36d51d-0b01-0010-b3aa-9cb313b63cf4|https://help.sap.com]
    Regards,

  • Message Protocol for JDBC receiver adpater used in mapping lookup

    hi mates,
    I'm trying out the scenario explained in this blog <a href="/people/siva.maranani/blog/2005/08/23/lookup146s-in-xi-made-simpler">Lookup’s in XI made simpler</a>. Since we are building a query string in the UDF and executing it, shouldn't the message protocol in adapter be 'Native SQL String' against that is given in blog 'XML SQL Format' (which is used if MT is created as per the 'Statement' structure)?
    I'm yet to execute my scenario..figuring out JDBC params...will try with both protocols once I get the info..meanwhile was wondering how 'XML SQL' would work in this.
    I appreciate your inputs.
    praveen

    I got the answer...the message protocol doesnt matter in case of lookups..coz all we are doing is getting an accessor to the channel but not passing any payload...
    the message protocol is for payload...
    XML SQL if it contains 'Statement'
    Native SQL if it contains native SQL string..

  • JDBC Receiver adapter Error for insert into DB2 table

    Hi all,
    I want to insert data into a DB2 table on AS400 via a Receiver JDBC adapter.
    The communication channel seems to be ok but when I try to send the message, I obtain the following message on the adapter monitoring :
    Error: TransformException error in xml processor class, rollback:
    Error processing request in sax parser: Error when executing statement for table/stored proc. 'GIK.GDT01' (structure 'Statement'): java.sql.SQLException: La table GDT01 de la bibliothèque GIK est incorrecte pour cette opération.
    Could someone help me?
    In the communication channel I have seen we can choose "native SQL String" as message protocol.
    Do you think it could be a workaround for me? if yes, could someone send me an example about it?
    thanks a lot,
    Philippe

    Hi,
    Try to remove GIK.GDT01 in table tag of your XML structure and put GDT01 alone and see.
    The solution to your problem is found on this particular link.
    http://www.websina.com/bugzero/faq/exception-as400.html
    Tell me if it works
    Best regards,
    Felix

  • What to specify in my JDBC receiver communication channel

    Hi!
    In my Receiver comm channel I have selected
    Adapter Type:JDBC
        Receiver
    Transport protocol: JDBC 2.0
    Message Protocol: XML SQL Format
    Adapter Engine: Integration server
    JDBC driver:??????
    Connection: ??????
    I dont have any idea as what to give here, How do i check which JDBC driver i am using? and also Connection parameters?
    Help me
    Thanks

    Hi Datta,
    Check
    /people/siva.maranani/blog/2005/05/21/jdbc-stored-procedures
    /people/sap.user72/blog/2005/06/01/file-to-jdbc-adapter-using-sap-xi-30
    /people/saravanakumar.kuppusamy2/blog/2005/01/19/rdbms-system-integration-using-xi-30-jdbc-senderreceiver-adapter
    Best regards, Maksim Rashchynski.

  • Escape character for apostrophe ' in JDBC receiver channel

    Hi all,
    We have Proxy to JDBC scenario in our project. This interface is working fine with unicode data but when there is an apostrophe( ' ) coming in any of the field values ( ex: DOWTHERM 'J' MODEL19QAGB1G ) , the message is failing in receiver JDBC channel.
    can anyone please tell us how to handle single quote in JDBC receiver channel.
    I have read in SAP help documentation that apostrophe is a reserved character in SQL syntax and is therefore replaced by an escape character if it occurs within value strings. There is a option to JDBC receiver communication channel under "SQL SYNTAX PARAMETER"  to specify the escape character for apostrophe.
    Can any please tell us which value needs to be maintained in the channel to avoid this error.
    Regards
    Jagruthi

    Hi Prateek,
    Thanks a lot for you inputs.
    This issue is solved now. We have replaced single quote with two single quotes and then did the hasQuote mapping as described in the blog.
    /people/prateek.srivastava3/blog/2009/04/02/unicode-handling-for-ms-sql-server
    No value needs to be maintained in channel(SQL SYNTAX PARAMETER ).
    But just want to understand  the difference between replacing the ' with '' in mapping and using SQL SYNTAX PARAMETER option in communication channel.
    Both should ideally result in same  output. But it didnu2019t work when we tried with two single quotes in SQL SYNTAX PARAMETER (Escape Symbol for Apostrophe) in communication channel without doing anything in mapping.
    Regards
    Jagruthi

  • Broken pipe error in Sync Send JDBC Receiver:   Extremely Serious issue

    Hi forum,
    I have a serious error in a JDBC->XI--> JDBC scenario,
    Step1: I use a sender JDBC channel to select some distinct values from  a table say X, and update the same rows,
    Query SQL Statement: select distinct Branch from dbo.X where status = 0
    Update SQL statement: update dbo.X set Status = 2 where Status = 0
    Step 2: enter BPM
    Step 3: enter a loop
    Step 4:make a synchronous call to the same table X, to fetch some records,
    SQL query: select * from X where status = 0 and Branch = i; Update X set status = 9 where Branch = i
    Step 5: close loop,  this loop iterates for 5 or 6 times depending on i, which is no. of branches selected by the sender JDBC channel
    so all the calls are to the same table, same databsse(SQL Server)
    the problem is when this sync calls happens in the loop, it some times gives following error, which i se in RWB:
    <b>Error Unable to execute statement for table or stored procedure. 'X' (Structure 'STATEMENT_X') due to com.microsoft.sqlserver.jdbc.SQLServerException: An exception occurred during the DBComms.transmit operation. Exception:Broken pipe (errno:32). Context:(2217)</b>
    i have no way to trace the cause of the error, the database is perfect and the error logs in the SQL server shows no trace of any error,
    Note: It works sometimes
    i dont know whom to approach, pls help
    the issue is very very serious as its in production system,

    Hi Sudeep,
    SAP Note 846079 - XI 3.0 JDBC Receiver: # of Retries on SQL Error w/o Effect
    Please check the following SAP note also - 831162
    Some info which i found there and can be relevant in to your scenario.....
    Q: I am using a JDBC Receiver Adapter in conjunction with the  Lotus Domino Driver for JDBC perform an INSERT or UPDATE operation on a database. When sending a message to the receiver, the Adapter Monitoring shows the following error message:
    "java.sql.SQLException: [Lotus][Domino Driver for JDBC]Invalid cursor state"
    Is there a fix for this issue?
    A: To work around this JDBC driver problem, activate the Advanced Mode for the respective JDBC Receiver channel and configure the setting "Number of Retries of Database Transaction on SQL Error" to a value > 0. Additionally, make sure that the setting "Database Auto-Commit Enabled" is also active as the Lotus Domino Driver for JDBC does not support transactions.
    Apply note 846079 before configuring this scenario.
    Q: The TCP/IP connection to my database host is running over an unreliable network connection, i.e. the connection is sometimes interrupted. Consequently, I sporadically receive an SQLException regarding a closed connection in the system trace or audit log or the connection as well as the JDBC Adapter channel are hanging.
    How can I work around this connectivity issue?
    A: Enable the "Advanced Mode" for the respective JDBC Adapter channel and select the option "Disconnect from Database After Processing each Message".
    Note that this might put additional load on your DBMS due to the creation of a new database connection for each message.
    I dont have access to a database right now, so i am not able to check this.
    Also check the JDBC driver compatability as mentioned in the above note.
    Cheer's

  • JDBC(Sender)-XI-RFC (Request) RFC (Response)-XI-JDBC(Receiver)

    Hi All,
    JDBC(Sender)-XI-RFC (Request)
    RFC (Response)-XI-JDBC(Receiver).
    Need some solution for sending email for successfully completion of scenario after updating SQL DB Table.
    Let me explain the scenario:
    We are pooling the SQL DB table to pull the records and map the records to RFC request parameters, after successful Posting the entries in R3 HR, RFC response contain the same with E (Error) S (Success) records status, we are updating the same in SQL DB table, I implemented the complete scenario without BPM with the help of module processor in Sending JDBC Adapter, scenario is working fine but now we have to send the successful mail to our support team with status contain Number of success, Error and total records as email.
    I need the solution how to implement the same requirement in current scenario.
    Is their way to do something with the RFC receiver adapter module addition to send the successful mail or generating Alert with all the description?
    I am at PI 7.0 SP12 with HP unix box.
    Thanks in Advance for creative idea
    With Regards
    Sunil

    Hi Bhavesh,
    Thanks for your help and your blog is really helpful. I implemented the UDF for generating Email Alert but this alert is generating before Updating the SQL Database, is their any way to generate alert after updating the SQL.
    Actually in my scenario we are sending the data from SQL to R3 by RFC and again updating the SQL status whatever the RFC return, after successfully updating SQL we need to send success email to support people but if we are sending the email before updating the DB then their will be problem.
    JDBC receiver after updating the SQL DB returns the response with No. of row updated but how to capture this response, if we can capture this response then we can send email through email adapter even their is one more problem, In my scenario I am counting the number of rows with status “S” and “E” and sending the same in alert email but if are sending email after updating the SQL DB where can hold the row count value and use it while sending the email.
    Implemented the scenario without using BPM..i am using sender JDBC module processor for Syn-Asyn bridge.
    Even I do not find the link to reward point. Please let me know how to do it.
    With Regards
    Sunil

  • JDBC Receiver channel is not showing any payloads

    Hello Experts,
    My interface is ABAP PROXY to JDBC i am facing a strange issue in ECC moni payload is succesful in PI moni also Payload is black colour flag but my Receiver JDBC channel is not showing any thing but it is in green colour (it is not showing neither succes nor error messages logs are empty).Sender chaneels are working only problem with receiver JDBC channels
    In DEV and PROD it it is working in QUAL it is showing this problem.I take the restart of QUAL server still it is behaving like that
    Please throw some light on the issue any help is higlhly apprecaited.
    Regards
    Praveen

    Hi,
    first check in pipe line step call technical routing , mapping execution generated JDBC receiver message pay load or not.
    if it is not generated then check mapping , if is is generated then restart the channel and check what communication channel name you given in receiver agreement.
    monitor the same channel, if all JDBC receiver channels have same behavior then restart the JDBC adapter service in NWA.
    rEGARDS,
    rAJ

Maybe you are looking for

  • RKD_WORD_WRAP with string input

    hi all, I need to split a string with RKD_WORD_WRAP, but it seems it takes only chars as input, so I would like to do this: create a char variable dynamically as long as the string in input and then pass it to the RKD_WORD_WRAP. Can anybody please te

  • Connecting iPhone to Apple Wired Keyboard

    Hello, I pluged my iPhone 5 to my Apple wired Keyboard in one of the two USB slots that it has under neath. Is there a way to type on your iPhone using this method. If so what settings does it consist of to make it work. Thanks, Rosko

  • After iLife 06 Restore the start of any iLife application results in error

    Recently I had to restore my iMac using the restore disc. After installation from the DVD I updated all SW using the Software Updater. After the restore all iLife 06 Application icons where shadowed and overlayed with a symbol. When starting any iLif

  • File Manager Mark/Unmark

    While using E63 File Manager and you want to mark many files (say 40 out of 90 files), do you have to use the menu ? Is there any button or combination of 2 buttons for Mark/Unmark command ? Thank you. E63-1 (410.21.010) 3110c (07.21) Padsticker http

  • Report Security

    Hi Expert I was wondering whether in ByDesign you are able to restrict the data generated within a report. For example I have two line managers who are responsible for their own business unit which is reflected in the organization structure. When the