Parameters in select statement in JDBC Sender Adapter

Hi,
Is it possible to construct a SQL select statement with some parameters (for example: #currentdate )?
(for sender JBDC adapter)
Thank you

hi,
you can very well construct a select statement.
The Source data type should be of this format:
<resultset>
<row>
<column-name1>column-value</ column-name1>
<column-name2>column-value</ column-name2>
<column-name3>column-value</ column-name3>
</row>
<row>
<column-name1>column-value</ column-name1>
<column-name2>column-value</ column-name2>
<column-name3>column-value</ column-name3>
</row>
</resultset>
try this link:
  http://help.sap.com/saphelp_nw04/helpdata/en/22/b4d13b633f7748b4d34f3191529946/frameset.htm
regards,
Priyanka

Similar Messages

  • Update- statement in JDBC sender Adapter

    Hi ,
    I have a requirement where I am trying to fetch data from ODS based on some flag and immediately I want to update the flag status . So I used selected and update in JDBC sender adapter .
    But I have one question , in the small timeframe where  XI has done a select and just before  XI could  issue the update statement  if a new record is added to ODS . Then  that new record will also get updated though it wasnot selected in select statement .
    Can someone let me know how to overcome this problem ; as I want to make sure I update only those recrods which are selected in select statement ??
    Thanks & Regards,
    Suvarna

    Hi,
    Check out the following thread. It gives the exact answer to this question.
    JDBC Sender Update Query
    One of the replies in the above thread:
    I put in an OSS note asking this exact question with your specific example, and got a reply. I was referred to OSS note 0000831162, where it is explained very unambiguously that the SELECT and UPDATE queries are run in the same transaction.
    Regards,
    P.Venkat
    Message was edited by:
            Venkataramanan

  • 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

  • Execution time difference between SELECT & UPDATE statement in JDBC Sender.

    Hi Experts,
    In my scenario, I have used the JDBC Sender Adapter with the SELECT and UPDATE statement.
    Now the problem is in between the execution of Select and update statement, few more entries are coming in the same DB Table.
    So result of this is updation take place for those entries which are not even picked up by the select statement.
    Can we avoid this execution time difference between the SELECT & UPDATE statemet on JDBC Sender side???
    Thanks & Regards
    Jagesh

    Hi
    Use serializable option in additional parameters, now all new entries would also be updated.

  • PI 7.1 JDBC sender adapter huge load from DB select

    Hi,
    We have the problem that the JDBC sender adapter is selecting a huge amount of data from a Oracle DB. The Adapter seems to be able to cope the load but when sending to the integration server it causes problems. We found values to adjust but I dont think increasing them is a good solution.
    My question is:
    Is there any way to send the data in blocks with using the PI standard JDBC adapter ?
    Thank you and regards,
    Andreas

    Hi,
    You can use the below parameter in JDBC sender.
       Specify additional Parameter Names and Parameter Values in the table.
    Due to messages of large size it may cause issue
    Following are the parameters to be set in the table to limit the message size per polling:
    ●      msgLimit :
    ●      maxMsgSize :  SAP note 1253826.
    ●      maxRowSize : SAP note 1253826.
    Additional parameters are published in SAP Note 801367.
    Refer the link.
    Defining Additional Parameters in Advanced mode
    http://help.sap.com/saphelp_nw73/helpdata/en/7e/5df96381ec72468a00815dd80f8b63/content.htm

  • JDBC Sender Adapter - Transaction & Parameterized Query?

    Dear Experts,
    I'm curious about the JDBC sender adapter in SAP PI.
    As I see from the document and have been searching in the Internet, The default procedure of the sender JDBC adapter is to first run a SELECT/Store Procedure query then update the records that have been read before.
    Configuring the Sender JDBC Adapter - Advanced Adapter Engine - SAP Library
    What I want to ask is:
    - What is the database transaction used for the SELECT and the UPDATE? I mean what if the SELECT is successful and the records have been sent to the IE, but the UPDATE failed. This way, the next polling run, the same records could be read again. Is it possible? Are the SELECT and UPDATE query atomic (if one fails the other fails too)?
    - Is it possible to have a parameterized query / stored procedure in sender JDBC adapter? Because seeing at the default procedure, there should be at least a field that will be used as a flag (for example the processed field needs to be updated to '1'). Something like:
              - SELECT * FROM table_a WHERE docno > $last_doc_no
                             $last_doc_no is a paramter or variable from PI
              - EXEC sp_do_something ( $param_a, $param_b )
                             $param_a, $param_b are parameters or variable in PI
    Thank you,
    Suwandi C.

    Hi Suwandi,
    all action to database are in one transaction and thats mean if one failed all failed.
    And it is possible to have parameterized storied procedure. You sould send something like
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:mt_proc xmlns:ns0="http://aaaa">
       <statementname>
          <stProc action="EXECUTE"/>
          <TABLE>PROCEDURE NAME</TABLE>
          <access>
             <param_in isInput="1" type="some_type">input param</param_in>
             <param_out isOutput="1" type="some_type"></param_out>
          </access>
       </statementname>
    </ns0:mt_proc>

  • JDBC Sender adapter - can VIEW be used in Query statement

    Hi,
    In JDBC Sender adapter, can we use a VIEW sql query in the "Query SQL Statement" placeholder?
    For eg:
    CREATE VIEW <view name> as SELECT * from <table name> WHERE <condition>
    instead of the usual:
    SELECT * from <table name> WHERE <condition>
    Thanks,
    Vishak

    Hi
    What exactly is your use of creating a view, if you are going to fetch data from different tables, then you can use the view through stored procedures.
    Hope this clears your doubts
    Thanks
    Saiyog

  • JDBC Sender Adapter - SQL-Statement

    Hi,
    I'm using the JDBC-Sender-Adapter and need to use a SQL-Statement like this:
    SELECT * FROM myTable WHERE myDate = <current_date>
    Is such a dynamic-sql possible, or can I only use static sql-statements. And if yes how can I solve this problem.
    many thx

    Hi Werner,
    inside the <b>Query SQL Statement</b> you can use <b>SQL EXECUTE</b>
    which can execute a stored procedure
    in which you can do
    SELECT * FROM myTable WHERE myDate = <current_date>
    http://help.sap.com/saphelp_nw04/helpdata/en/7e/5df96381ec72468a00815dd80f8b63/content.htm
    Regards,
    michal
    <a href="/people/michal.krawczyk2/blog/2005/06/28/xipi-faq-frequently-asked-questions">XI FAQ - Frequently Asked Questions</a>

  • DYnamic select statement in JDBC adapter?

    Hi guys,
                 Is it possible so send dynamic select statement in jdbc adapter?
    XIer

    Aamir,
    The poster did not specify whether this was sender or receiver channel, but it would only make sense that a "dynamic query" must be on the receiver communication channel since if it was on the sender channel, the channel would have to intelligently determine how to do dynamic queries.
    Also, the poster asked if there was a way to "send a dynamic query" to the channel.  This seems to imply that the channel is receiving information from somewhere to determine the query, which could only mean it is a receiver channel.
    If you would like more information on the JDBC sender communication channel, please open a new thread.

  • JDBC Sender Adapter : java.sql.SQLException: Cursor state not valid.

    Hello all,
    We have configured JDBC Sender Adapter which fetches around 10K records with poll interval 1hr  from DB2 System .
    It was working fine,suddenly it started throwing an exception in Adapter Monitoring :
    Error during conversion of query result to XML: java.sql.SQLException: Cursor state not valid.
    It is not fetching any records.
    Without changing any configurations when we tried to fetch to around 1000 records it's working fine.
    For 10K records same exception persists
    What could be the reason ?How to resolve this issue?
    regards
    GangaPrasad

    Hello Christophe ,
    Trace in VA :::
    Date : 05/09/2008
    Time : 11:45:57:750
    Message : Unexpected error converting database resultset to XML, reason: java.sql.SQLException: Cursor state not valid.
         at java.lang.Throwable.<init>(Throwable.java:194)
         at java.lang.Exception.<init>(Exception.java:41)
         at java.sql.SQLException.<init>(SQLException.java:40)
         at com.ibm.as400.access.JDError.throwSQLException(JDError.java:389)
         at com.ibm.as400.access.JDError.throwSQLException(JDError.java:366)
         at com.ibm.as400.access.AS400JDBCResultSet.getValue(AS400JDBCResultSet.java:3580)
         at com.ibm.as400.access.AS400JDBCResultSet.getString(AS400JDBCResultSet.java:3223)
         at sun.reflect.GeneratedMethodAccessor459222074.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:309)
         at com.sap.aii.adapter.jdbc.sql.jdbctrace.TraceInvocationHandler.invoke(TraceInvocationHandler.java:45)
         at com.sap.aii.adapter.jdbc.sql.jdbctrace.$Proxy254.getString(Unknown Source)
         at com.sap.aii.adapter.jdbc.JDBC2XI.convert2XML(JDBC2XI.java:954)
         at com.sap.aii.adapter.jdbc.JDBC2XI.invoke(JDBC2XI.java:492)
         at com.sap.aii.af.service.scheduler.JobBroker$Worker.run(JobBroker.java:475)
         at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
         at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:99)
         at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:119)
    Severity : Error
    Category : /Applications/ExchangeInfrastructure/AdapterFramework/Services/ADAPTER/ADMIN/JDBC
    Location : com.sap.aii.adapter.jdbc.JDBC2XI.convert2XML(ResultSet, ResultSetMetaData)
    Application :
    Thread : XI JDBC2XI[JDBC_SND_DB2_VehicleReceiving/DB2PRD00/]_170
    Datasource : 12428950:/usr/sap/PXI/DVEBMGS01/j2ee/cluster/server0/log/applications/com.sap.xi/xi.log
    Message ID : 00145E742794005E0014980B000000BE00044CC763766C4F
    Source Name : /Applications/ExchangeInfrastructure/AdapterFramework/Services/ADAPTER/ADMIN/JDBC
    Argument Objs : java.sql.SQLException: Cursor state not valid.
         at java.lang.Throwable.<init>(Throwable.java:194)
         at java.lang.Exception.<init>(Exception.java:41)
         at java.sql.SQLException.<init>(SQLException.java:40)
         at com.ibm.as400.access.JDError.throwSQLException(JDError.java:389)
         at com.ibm.as400.access.JDError.throwSQLException(JDError.java:366)
         at com.ibm.as400.access.AS400JDBCResultSet.getValue(AS400JDBCResultSet.java:3580)
         at com.ibm.as400.access.AS400JDBCResultSet.getString(AS400JDBCResultSet.java:3223)
         at sun.reflect.GeneratedMethodAccessor459222074.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:309)
         at com.sap.aii.adapter.jdbc.sql.jdbctrace.TraceInvocationHandler.invoke(TraceInvocationHandler.java:45)
         at com.sap.aii.adapter.jdbc.sql.jdbctrace.$Proxy254.getString(Unknown Source)
         at com.sap.aii.adapter.jdbc.JDBC2XI.convert2XML(JDBC2XI.java:954)
         at com.sap.aii.adapter.jdbc.JDBC2XI.invoke(JDBC2XI.java:492)
         at com.sap.aii.af.service.scheduler.JobBroker$Worker.run(JobBroker.java:475)
         at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
         at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:99)
         at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:119)
    Arguments : java.sql.SQLException: Cursor state not valid.
         at java.lang.Throwable.<init>(Throwable.java:194)
         at java.lang.Exception.<init>(Exception.java:41)
         at java.sql.SQLException.<init>(SQLException.java:40)
         at com.ibm.as400.access.JDError.throwSQLException(JDError.java:389)
         at com.ibm.as400.access.JDError.throwSQLException(JDError.java:366)
         at com.ibm.as400.access.AS400JDBCResultSet.getValue(AS400JDBCResultSet.java:3580)
         at com.ibm.as400.access.AS400JDBCResultSet.getString(AS400JDBCResultSet.java:3223)
         at sun.reflect.GeneratedMethodAccessor459222074.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:309)
         at com.sap.aii.adapter.jdbc.sql.jdbctrace.TraceInvocationHandler.invoke(TraceInvocationHandler.java:45)
         at com.sap.aii.adapter.jdbc.sql.jdbctrace.$Proxy254.getString(Unknown Source)
         at com.sap.aii.adapter.jdbc.JDBC2XI.convert2XML(JDBC2XI.java:954)
         at com.sap.aii.adapter.jdbc.JDBC2XI.invoke(JDBC2XI.java:492)
         at com.sap.aii.af.service.scheduler.JobBroker$Worker.run(JobBroker.java:475)
         at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
         at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:99)
         at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:119)
    Dsr Component :
    Dsr Transaction : d1f629d01d9b11dd984200145e742794
    Dsr User :
    Indent : 0
    Level : 0
    Message Code :
    Message Type : 1
    Relatives : com.sap.aii.adapter.jdbc.JDBC2XI
    Resource Bundlename :
    Session : 0
    Source : /Applications/ExchangeInfrastructure/AdapterFramework/Services/ADAPTER/ADMIN/JDBC
    ThreadObject : XI JDBC2XI[JDBC_SND_DB2_VehicleReceiving/DB2PRD00/]_170
    Transaction : SAP J2EE Engine JTA Transaction : [0ffffffbdffffffa6ffffff960086]
    User : J2EE_GUEST
    Regards
    Ganga Prasad

  • JDBC Sender Adapter - Single Select and Single Delete

    Hi,
    I have the requirement where I have to select the single row (or 1st row) from database through JDBC Sender Adapter and delete that record after selection in single polling.
    Please help me out with proper SQL query or with any other approach.
    Thanks and Regards,
    Vijay

    I think in SQL select statment you have something like Select TOP number....where number is 1,2..
    The detailed syntax for the SELECT clause is as follows:
    SELECT [ALL | DISTINCT] [TOP nExpr [PERCENT]] Select_List_Item [AS Column_Name] [, ...]
    for more details...check out..
    http://msdn2.microsoft.com/en-us/library/95c6ex88(VS.80).aspx
    Document sent on your email id.
    Nilesh

  • Storedprocedure trigger using JDBC sender adapter.

    Hi All,
    How can i execute the storedprocedure using JDBC sender adapter. I need to trigger the storedprocedure once in every hour. so i would like to use the JDBC sender adapter. My question is what is the SQL i need use in the SQLstatement parameter..?? I don't want to send parameters and not expecting any return values. It should just trigger the procedure.
    Thanks in adv.
    Regards,

    Hi Murali,
    it is possible to execute a stored porcedure using a sender JDBC adapter.
    Just Specify an SQL EXECUTE statement to execute a stored procedure, which contains exactly one SELECT statement.
    This will have to be done for your SELECT statement in JDBC adapter. ALso, make the UPDATE as either TEST, if you dont want any updations or give an UPDATE statement for the UPDATE query.
    Set the polling interval of your JDBC adapter to 1 hour and it will work like u want.
    http://help.sap.com/saphelp_nw04/helpdata/en/7e/5df96381ec72468a00815dd80f8b63/content.htm
    Regards,
    Bhavesh

  • How to update two tables in a single call using JDBC Sender adapter

    Hello All,
    The scenario is, database entries have to be selected from two tables and at the same time those tables have to be udpated with the flag.
    We are using JDBC sender adapter and in Select Query, we are fetching the data by joinin the two tables.
    Update Statemtent: We can only update one table using this statement.
    Is it possible to update two tables using the Update Statement without using Stored Procedures.
    Let me know.
    Regards,
    Sreenivas.

    Hi Sreenivas,
    > Is it possible to update two tables using the Update Statement without using Stored Procedures.
    Yes its possible through join statement
    Check this links
    Update in JDBC Sender adapter for more than one table
    data from 2 tables for jdbc sender adapter
    Regards
    Ramesh

  • JDBC Sender Adapter - Records sent one at a time

    Hello everyone,
    Here's a summary of my scenario JDBC > XI > RFC.
    My select statement (JDBC) looks like this:
    SELECT * FROM BATCH WHERE STATUS='Y'
    The problem is, whenever it returns multiple rows, the RFC can only accept one record at a time (1...1), so I need to pick up the records from the DB and send them one at a time.
    Currently, this is how the output XML looks like:
    <?xml version="1.0" encoding="utf-8" ?>
      <ns:SQL_RESP_MT xmlns:ns="http://www.pharmaindustries.com">
      <row>
      <number>200000000472</number>
      <status>Y</status>
      </row>
      <row>
      <number>200000000473</number>
      <status>Y</status>
      </row>
      <row>
      <number>200000000474</number>
      <status>Y</status>
      </row>
    </ns:SQL_RESP_MT>
    Instead, I need each row to be picked up and sent one at a time.
    <?xml version="1.0" encoding="utf-8" ?>
      <ns:SQL_RESP_MT xmlns:ns="http://www.pharmaindustries.com">
      <row>
      <number>200000000472</number>
      <status>Y</status>
    </ns:SQL_RESP_MT>
    <?xml version="1.0" encoding="utf-8" ?>
      <ns:SQL_RESP_MT xmlns:ns="http://www.pharmaindustries.com">
      <number>200000000473</number>
      <status>Y</status>
      </row>
    </ns:SQL_RESP_MT>
    <?xml version="1.0" encoding="utf-8" ?>
      <ns:SQL_RESP_MT xmlns:ns="http://www.pharmaindustries.com">
      <number>200000000474</number>
      <status>Y</status>
      </row>
    </ns:SQL_RESP_MT>
    Does anyone know the changes I need to make in my current SELECT statement or the JDBC Sender Adapter to make this possible.
    Thanks in advance!
    Glenn

    Thank you all for your replies. I'll check out your link in a bit, Phani. Thanks!
    A SpliByValue won't work since the BAPI Header is (1...1).
    Luckily, during testing, I found out that the BAPI (BAPI_PRODORDCONF_CREATE_TT) handles multiple lines in one of the subelements of the header so that was where I mapped the Rows.
    I might need to trigger multiple BAPIs in the future, so I'll take a good look at your suggestions, but for now, I'm marking this question answered.
    Warm regards,
    Glenn

  • How to use sql variables in jdbc send adapter??

    Hi,
    i wanna use a variable in the sql statement in the jdbc send adapter.
    i know i can key sql statement in the "Query SQL Statement" in the jdbc send adapter.but i dont know how to use variables in the sql statement.
    i mean, for example, the sql statement is "SELECT * FROM t_student WHERE READFLAG = 0", but now i wanna instead of "0"(the value of the READFLAG) using a variable.
    and if i can use a variable to replace the "0"(the value of the READFLAG above sql statement), then how can i send a value to the variable??
    request help in the regard.
    thx in advance.
    Brian

    Hi,
    Use the place holders to pass the data at runtime. Check the below structure for more details.
    Hope this helps.
    Thanks and Regards,
    Kalpesh
    <root>
      <stmt>
        <Student action="SQL_QUERY">
          <access> SELECT * FROM t_student WHERE READFLAG = '$FLAG$ </access>
          <key>
            <FLAG>0</FLAG>
          </key>
        </Student>
      </stmt>
    </root>

Maybe you are looking for

  • How do you delete an email address from your iPhone that's not in your contacts?

    How do you delete an email address from your iPhone that's not in your contacts?

  • Best chinese characters font

    I'm currently learning chinese and I noticed the characters look really not ok. From arch wiki, ttf-tw - Kai and Song traditional Chinese font from the Ministry of Education of Taiwan (AUR). wqy-microhei - A Sans-Serif style high quality CJK outline

  • IView issue in anonymous mode

    Dear all, we are using EP 7 with the possibility to change into different portal languages. If I try to open an iView in anonymous mode and portal language English, no content is displayed. After that I change the portal language to German for exampl

  • PO attachments - sending a selected attachment

    Hi, Scenario: Created a PO, added several attachments in PO. Trying to send selected attachment to Vendor but all the attachments are communicated. Need to know how to send a particular attachment in the PO to Vendor of the PO. Is there any customiza

  • REGEX Decipher

    I have been giving this regex code but for cannot decipher what it means "(?¡)\\[Abcde\\].*" Has been applied to outgoing mail policy - conditions as a subject header - contains. Any ideas.