Dynamic query configuration in sender jdbc adapter

Hi,
According my undertsnading in XI.3.0 dynamic query in sender JDBC adapter is not possible.
could any one confirms the possibility of this feature in XI 7.0 .
Thanks,
venu

Hi VJ,
sorry for late responding to your answer.
One of our requirements is the query statement that we write in sender communication channel should be changed dynamically, for example in where condition the condition parameters values required to change.
Thanks,
venu

Similar Messages

  • Dynamic select querry in sender jdbc adapter

    Hi,
          We are working on a scenario where in we will be using different source database tables , we were trying to see if it is possible that the select querry can be made dynamic so that the same communication channel can be used for all the different source tables.
         Request all to come up with suggestions as to if this is possible.
    Thanks ,
    Pravesh Puria.

    Hi All,
    Thanks VJ for your reply.
    Let me reframe my question.
    I have multiple database instances at source side. On all instances I have same table name.
    My requirement is to poll all these instances table and fetch data.
    Do I need to create multiple sender agreements or there is a way to dynamically change the datbase name in sender Communication channel.
    Any other solution is also appreciated.
    Same is the case with JMS adapter, Multiple instances of JMS are there at source side sending similar structure data in there own queue.
    Request you to kindly response.
    Regards,
    Pravesh

  • 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

  • Sender JDBC Adapter Select/Update Issue

    Dear All,
    We have configured a Sender JDBC Adapter to Poll data from the DB2 tables. It is working fine and both the select and the update queries written are also getting properly executed and are changing the status of the flag from Y to N once read from database.
    In the communication channel ->
    select * from <table> where flag = 'N'.
    update <table> set flag = 'Y' where flag = 'N'.
    But I have one doubt after executing the select query some new data comes into the table of status flag 'N"., then will this unselected data will also be updated to 'Y' .
    The question is while we do a select and update from XI on the DB table and at the same time there is an insert happening into the table from the other end how will the adpater behave in this case.Will it result in missing of some records during next select/update transaction from XI..
    Your inputs will be appreciated.
    Regards
    Amit

    Amit
    Did you ever get a solution to your question ?
       Sender JDBC Adapter Select/Update Issue  
    Posted: Apr 24, 2008 2:29 PM           Reply 
    Dear All,
    We have configured a Sender JDBC Adapter to Poll data from the DB2 tables. It is working fine and both the select and the update queries written are also getting properly executed and are changing the status of the flag from Y to N once read from database.
    In the communication channel ->
    select * from <table> where flag = 'N'.
    update <table> set flag = 'Y' where flag = 'N'.
    But I have one doubt after executing the select query some new data comes into the table of status flag 'N"., then will this unselected data will also be updated to 'Y' .
    The question is while we do a select and update from XI on the DB table and at the same time there is an insert happening into the table from the other end how will the adpater behave in this case.Will it result in missing of some records during next select/update transaction from XI..
    Your inputs will be appreciated.
    Regards
    Amit

  • Sender JDBC adapter SELECT / UPDATE issue - updates more rows than selected

    Hi,
    We have configured a Sender JDBC Adapter to poll records from an Oracle table based on a flag field and then update the flag for the selected records. When tested in DEV and QA environments (where test data comes in intermittently and not in huge volumes), itu2019s working fine.
    Both SELECT and UPDATE queries written in the Sender JDBC adapter are getting properly executed and are changing the status of the flag for the selected records from Y to N once read from the database.
    select * from <table> where flag = 'N'.
    update <table> set flag = 'Y' where flag = 'N'.
    But in the PROD environment (with records getting updated in the database every second), after XI executes the SELECT query and just before the UPDATE query is executed, new records come into the Oracle table with status flag 'N". So when the UPDATE query runs just after the SELECT query, then these unselected records also get updated to 'Y'. Thus these records never get into the resultset and hence XI and thus remain unprocessed.
    So when XI does a SELECT and UPDATE on the Oracle DB table and concurrently there is an INSERT happening into the table from the other end, the JDBC sender adapter is picking up a certain number of records but updating the status of more records than it picked up.
    So how does XI deal with such a common scenario without dropping records?
    Thanks,
    Vishak

    The condition being checked is the same for both SELECT and UPDATE statements.
    Initially I tried setting transaction isolation levels on the database to repeatable_read and serializable but it was throwing me a java.sql.SQLException error saying that these transaction levels were not valid.
    I asked for these transaction level permissions for the XI user from my DBA but the DB I am accessing provides only a view into other databases and so it's not possible.

  • Executing an Oracle Stored Procedure from Sender JDBC adapter

    I could really use some help from someone who had done this before. 
    I've read the help about using the JDBC sender adapter, but it's not helping enough.
    I found this line: "Specify an SQL EXECUTE statement to execute a stored procedure, which contains exactly one SELECT statement.
    The expression must correspond to the SQL variant supported by the relevant JDBC driver. It can also contain table JOINs."
    That's definately what we want to do, but we can't figure out the syntax.
    The procedure in oracle looks like this:
    CREATE OR REPLACE PROCEDURE test_ref_cursor
    ( cur_generic IN OUT result_sets.cur_generic)
    as
    BEGIN
    Open cur_generic for
    select
       proposal_number,
       to_char(sequence_number),
       column_name,
       column_value,
       update_timestamp,
       update_user
       from
       coeus.sap_test;
    END test_ref_cursor;
    And we have tried every kind of statement we can think of, but the file adapter always gives us an "invalid sql statement" error.
    Does anyone know what syntax we need to put in the "Query SQL Statement" in the JDBC sender adapter in order to call this procedure?  Or is there something wrong with the procedure that is causing the error?
    <i>I will absolutely return and give points, but PLEASE read my whole post before answering and do not just link me to or quote the help for configuring a sender JDBC adapter or blogs that are about the JDBC adapter in general but do not deal with the issues I am having. Thank you.</i>

    Hi Vanda,
    Unfortunately, the sender JDBC adapter does not support Oracle's store procedure/function.  Unlike stored procedures from other database vendors, Oracle returns a cursor, not a resultset.  The sender JDBC adapter must send a resultset to XI.
    There are 2 possible ways you can accomplish this:
    1.  Use BPM and call the Oracle stored procedure using a receiver adapter via a asynch-synch bridge.
    2.  Develop a user-module for the adapter, which can be used with a sender adapter.
    Thanks
    Prasad

  • Error in XI Sender JDBC adapter for AS/400 DB2

    We are trying to connect to AS/400 DB2 from XI's Sender JDBC Adapter. we got the driver from DataDirect (connectjdbc.jar) and configured it within XI .The configuration according to the manual for this jar file is
    // Register the driver with the driver manager
    Class.forName("com.ddtek.jdbc.db2.DB2Driver");
    // Establish the Connection
    String url = "jdbc:datadirect:db2://corpserver1:50000;LocationName=ACCTNG";
    Connection con = DriverManager.getConnection(url, "test04", "test04");
    In XI we configured this as:
    Driver = com.ddtek.jdbc.db2.DB2Driver
    Connection = jdbc:datadirect:db2://servername;LocationName=NBHAGWAT
    and specified the user id and password
    <b>Note</b>: The Port Number is optional
    When this was done in XI, we got the below error in the Adapter Monitoring:
    Sender Adapter v2108 for Party '', Service 'JDBCtoFile':
    Configured at 2006-12-19 15:45:31 MST
    History:
    - 2006-12-19 15:45:31 MST: Retry interval started. Length: 10.000 s
    - 2006-12-19 15:45:31 MST: Error: Accessing database connection 'jdbc:datadirect:db2://AS400a;LocationName=NBHAGWAT' failed: DriverManagerException: Cannot establish connection to URL 'jdbc:datadirect:db2://AS400a;LocationName=NBHAGWAT': SAPClassNotFoundException: com.ddtek.jdbc.db2.DB2Driver
    - 2006-12-19 15:45:31 MST: Processing started
    Is this because there is something wrong because the way the connection string is specified.
    Anybody who has configured XI Sender JDBC adapter for AS/400 DB2, please send us some information on this.
    Thank you,
    Regards,
    Balaji

    > SAPClassNotFoundException:
    > com.ddtek.jdbc.db2.DB2Driver
    It looks like your JDBC driver is not found. Have you deployed the driver to XI?
    <a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/3867a582-0401-0010-6cbf-9644e49f1a10">https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/3867a582-0401-0010-6cbf-9644e49f1a10</a>

  • About sender jdbc adapter

    can I define multiple query statments in sender jdbc adapter?
    because i wanna get multiple recordsets from database according to multiple querty statements.
    like:
    <recordset1>
          <row>
                  <col1>
                 <col1/>
                 <col2>
                 <col2/>
        <row/>
    <recordset1/>
    <recordset2>
          <row>
                  <col1>
                 <col1/>
                 <col2>
                 <col2/>
                 <col3>
                 <col3/> 
                <col4>
                 <col4/>
         <row/>
    <recordset2/>
    such as:   order and order item scenario.
    in general,how to implement the scenario?
    i have to make use of BPM to resolve the problem?
    ple give some hint and stuff about this. thanks a lot!!!

    Hi Joy ,
    Check out this :
    http://www.codeproject.com/Messages/2516517/Re-How-to-write-the-multiple-query-in-single-store-procedure.aspx
    Hope you will find this discussion informative : http://forums.asp.net/p/1021356/1765680.aspx
    Regards,

  • Configuring sender jdbc adapter

    Hi all,
    I have a requirement in which i have to select certain data from Oracle table and send it to an IDOC via SAP XI.
    Problem is the select can happen from several tables. For example:
    SELECT col1,col2,col3 FROM <tablename>
    The <tablename> has to be variable. I do not need to do any JOIN. At a time select will be only from a single table i.e. col1, col2, col3 will all belong to the same table. But the adapter should poll multiple tables.
    One more requirement is that once a particular record from a particular table has been selected some UPDATE also need to be done on the same record.
    Pls can anybody provide me with a proper solution.
    This requirement is a bit urgent.
    Thanks in advance.
    Regards
    Neetu

    Neetu,
    You need to have the Table name dynamic in the Sender JDBC adapter's Select Query . This is not possible
    You can consider using a Reciver JDBC adapter for which you can have a look at this blog ,
    /people/bhavesh.kantilal/blog/2006/07/03/jdbc-receiver-adapter--synchronous-select-150-step-by-step
    Or, you need a Separate sender JDBC adapter for every table to be polled.
    >><i>One more requirement is that once a particular record from a particular table has been selected some UPDATE also need to be done on the same record.</i>
    If you are using the Sender JDBC adapter, this would be simple using the UPDATE field of the Sender JDBC adapter .
    If you are planning to use Receiver JDBC adapter, then You need a separate Send Step for this Update.
    Better way to go would be to have separate sender JDBC adapters.
    Regards,
    Bhavesh

  • Stored procedure in Sender JDBC Adapter

    Hi All,
    My Scenrio goes like this ...
    Stored Procedure(SQL Server) --- PI  -
    File
    I need to write the results of  stored procedure to File.Here I don't need any mapping.So how many DT , MT and MI need to be created?
    The interface need to run by 6AM from Monday to Thrusday, how can i achieve this ?
    Stored Procedure has only select statement and no Update statement , but it takes Date as Input parameter , so what i need to provide in sender JDBC adapter.
    Thanks,
    Monish

    Hi Monish,
    As per your requirement it is JDBC to File. Please be careful with the structure to be created for sender JDBC. I am unable to understand why you donot require a mapping for this. How XI will send the data to a file then.As per my knowledge if it's file to file and just pick and drop then we can neglect IR and go for ID.But here you are working with JDBC and File so you will be in need of it.
    IR:
    DT: 2
    JDBC_Sender_DT
    File_Output_DT(Optional)
    You can use the JDBC sender data type structure for File output also.
    MT as per your DT
    MI:2
    Outbound MI: JDBC structure
    Inbound MI : File structure
    MM: 1
    IM: 1
    ID as similar to other scenarios.All 1 objects for RD,ID,Sender Agreement and Receiver Agreement.
    Sender JDBC channel:
    Query: Select * from table where date
    But I have a query how are you providing date in input paramerter.It will be dynamically entered into the query right.
    You can mention the Avalibility planning for your interface to work in RWB.
    Go to RWB>Component Monitoring>Adapter Engine->Communication Channel Monitoring>Avaliablity Planning
    Please explain.
    Regards,
    Nutan

  • 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

  • Problem in sender JDBC adapter

    hello,
    I am facing one typical problem in sender JDBC adapter.
    Here is the issue,
    JDBC API method getString threw an exception: java.sql.SQLException: Cursor state not valid.
    Can anyone please help me out in solving this problem?
    Actually after a retry of 3 times the message has been successfully sent. Till then i am getting these error
    On 1st attempt ,
    Error during conversion of query result  to XML java.sql.SQLException: Cursor state not valid
    On 2nd attempt,
    Error during conversion of query result  to XML java.sql.SQLException: Internal driver error                                                                               
    (class.java.lang.InterruptedException)
    On 3rd attempt,
    Processing finished successfully.
    This is the scenario that i can see in the audit log.
    Can you please help me out in solving this issue.
    Thanks,
    Soorya

    Hi gaurav,
    It was a good response from your side.
    I have gone through the FAQ but could not able to find anything.
    Can you please help me out in this regard ?
    Also i am using select query of this kind,
    SELECT
    SEFVHRC.VHRBRCD,SEFVHRC.VHRCUCD,SEFVHRC.VHRVIN,SEFVHRC.VHRMOCD,SEFVHRC.VHRCHAS,
    SEFVHRC.VHRSLOR,SEFVHRC.VHRDIVI,SEFVHRC.VHRMGCD,SEFVHRC.VHRMOCH,SEFVHRC.VHRVHTY,
    SEFVHRC.VHRBDTY,SEFVHRC.VHRMFYR,SEFVHRC.VHRMOYR,SEFVHRC.VHRMODS,
    SEFVHRC.VHRMDTL,SEFVHRC.VHRCLBR,SEFVHRC.VHRRCID,SEFVHRC.VHRARDT,
    SEFVHRC.VHRLUTM,SEFVHRC.VHRLUDT,SEFVHRC.VHRKEYN,SEFVHRC.VHRCTORN,
    SEFVHRC.VHRCTIMP,SEFVHRC.VHRPRDT,SEFVHRC.VHRPRDT,SEFVHRC.VHRRCDT,
    SEFVHFT.VHFCLCD,SEFVHFT.VHFCAT,SEFVHFT.VHFCADSC,SEFVHFT.VHFKEY,SEFVHFT.VHFTEXT1,
    SEFVHFT.VHFTEXT2,SEFVHFT.VHFTEXT3,SEFVHFT.VHFTEXT4
    FROM
    SAPTESTLIB.SEFVHRC,SAPTESTLIB.SEFVHFT
    WHERE
    SEFVHRC.VHRVIN = SEFVHFT.VHFVIN AND SEFVHRC.VHRSTTS = ' '
    and update query of this kind,
    Update SEFVHRC SET VHRSTTS = 'R' WHERE VHRSTTS = ' '
    I am using prity big select query. is there any option to optimize it?
    Can you please help me out in solving this problem
    urs,
    Soorya

  • Stored procedure : how to call SP in sender JDBC adapter for mysql

    HI friends ,
    we have JDBC---->XI--
    >SAP  scenario. For some business requirement, we have to call STORED PROCEDURE , please let me know how to call  SP in sender JDBC adapter for mysql .
    Thanks
    mojib

    Hi Mojib,
    Please create a sample stored procedure like this which contains select statement and in communication channel give
    wite stored procedure name only to sql query statment and in update statement write <test>.
    I am executing this stored procedure successfully.
    Create Proc GetResultX As
    Begin
    Select * From TESTX
    End
    Execute statement for stored procedure is :
    Exec GetResultX
    Regards
    Laxmi Bhushan Jha
    Rewards point if found usful
    I have given same answer to one of the same  thread

  • Sender JDBC Adapter issue.

    Hi folks,
    I would like to know how can I configure a sender JDBC channel without specify a poll interval? I know that I can specify this poll interval with a period of time that I want; it could be in seconds and even in mseconds. But, this can cause a lot of access to the Data Base SQL Server and consequently can cause network slowness.
    I would like to know if there is any data base event that can trigger my jdbc sender adapter or any other workaround that can prevent many accesses to one Data Base.
    Any ideas are appreciated.
    Thanks in advance,
    Ricardo.

    Hi,
    with XI SP19 you can schedule your jdbc adapter easily:
    (in standard)
    /people/shabarish.vijayakumar/blog/2006/11/26/adapter-scheduling--hail-sp-19-
    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>

  • Sender JDBC adapter...problem

    Hi,
    the real problem is Sender JDBC adapter sends data in following format.
    <?xml version="1.0" encoding="UTF-8"?>
    <resultset>
      <row>
         <Associate_ID>16444</Associate_ID>
         <Associate_Name>Sudhir</Associate_Name>
         <Status>false</Status>
      </row>
      </resultset>
    But in Design time mapping...structure of source message will be like
    <?xml version="1.0" encoding="UTF-8"?>
    <ns5:DB2File_DB_MT xmlns:ns5="urn:db2file">
      <Resultset>
        <Row>
          <Associate_ID>16444</Associate_ID>
          <Associate_Name>Sudhir</Associate_Name>
          <Status>false</Status>
        </Row>
      </Resultset>
    </ns5:DB2File_DB_MT>
    How does this tag ... <ns5:DB2File_DB_MT xmlns:ns5="urn:db2file">  get generated in runtime
    and apart from 1 to 1 mappings b/w the three fields above in the row tag...wt other mappings to be performed
    Pls help...
    Sunita

    Hi Sunita,
    what i understood from your query is namespace tag is coming while message mapping. This namespace can be avoided in the message type if you keep the XML namespace field empty while creating message type. But i afraid you have to do the message mapping again.
    Regards,
    Satish

Maybe you are looking for

  • My iPhone 5 is eligable for battery replacement but there is no Apple Stores in my country. Any advices what should I do?

    Hello, I live in Montenegro and I bought used iPhone 5 off ebay few months ago. Phone is sim free but I notice really poor battery life. I have to charge it twice a day! Before 5 I used iPhone 4 and I had to charge every night but I could use the pho

  • Data source issue after R3system upgrade

    After our R3 systm upgraded to ECC6 system, I tried to load data into BW system, getting this error. DataSource 0GL_ACCOUNT_ATTR has to be replicated (time stamp, see long text). but in BW system, I replicated all the datasources. any idea what is th

  • Creating attachments from Services for Objects

    Hi, I am trying to create an attachment using the FM BDS_BUSINESSDOCUMENT_CREATEF. But it is giving me sy-subrc 4(ERROR_KPRO). Can anyone explain how to correct this and if u have any better code to attach files to BO's pls post it here. This is my c

  • None of the ports are working

    The headphone jack is not working, I will plug it in and the music will continue to come from the speakers. The USB port charges the tablet, but it won't connect the tablet to the computer. Ever since I updated there was a sd card error that kept pop

  • File transfter issue - Lenovo S860

    Hello Geeks, I have detected one silly but quite serious issue in my lenovo S860 smartphone. Once a while I was trasfering a music file , I have chosen send via 'WhatsApp' option and marked on 'Always'. Now problem is whenever i want  to trasfter any