Multiple select queries for JDBC sender

I am working on JDBc to IDOC scenario.
I need to process two select queries in PI where output of 1st query becomes the input of second.
Now i need to map the output of second to IDOC through XSL mapping also i need to use BPM to process(without using the stored procedure) the scenario.
In my JDBC communication channel i have option for only one select query and second query should fetch the data through BPM.
In BPM i have used the following sequence mentioned below:
Start --> Receive step ( receives all the header lines) --> Transformation (to split the header messages to single message) --> Block Start( To processEachRecord) --> Send Syn (to map the request message i,e. output of first query with Response i,e. structure of the second query)  --> Send Asyn (to send the output of second query to XSLT mapping) -->Block End --> stop
Output of XSLT mapping is the input for IDOC
Now i need to understand how to process the second query?

>> I need to process two select queries in PI where output of 1st query becomes the input of second
Use SQL Nested Queries. 
Example:
SELECT Model FROM Product WHERE ManufacturerID IN (SELECT ManufacturerID FROM Manufacturer
WHERE Manufacturer = 'Dell')
Here first table is Manufacturer .. we do select query in manufacturer to return data and pass it to the first table Product.
>> Now i need to understand how to process the second query?
You dont need at all. In your sender jdbc channel, write sql statement nested query and you will get only output of the second table. you map the second table output to the idoc.
Note: Dont know why do you need BPM for this case..
Jdbc sender adapter  help links
http://help.sap.com/saphelp_srm40/helpdata/en/7e/5df96381ec72468a00815dd80f8b63/content.htm
Check this thread for update statement in jdbc cc
Re: sender jdbc adapter

Similar Messages

  • Multiple select options for an input field

    Hi All,
    We have a requirement where in we need to provide multiple select options for an input field in a BSP application and get output relevant to all the given inputs(do not require range).
    Please do let me know how to solve this.
    Thanks & Regards,
    Lavanya .

    Hi,
    The requirement is : Suppose there is a input field PLANT.
    If we give input for plant it gives related output.
    Now if it is required to give 5 or 6 inputs..like plant1,plant2...plant6 and get the output related to all 6 inputs.
    (Like we implement in ABAP)
    Please do let me know how can this be implemented in BSP.
    Thanks & Regards,
    Lavanya.

  • Executing Multiple Select Queries in a Single attempt

    HI,
    I executed two select queries in a single statement execute. It is executing without any error. Hence there must be two resultset objects within that single statement.
    What the problem is that I m able to fetch the first resultset and its data, But I execute stmt.getMoreResults() to move to the next resultset, it returns false, which means there is no more results. I want to know what is the problem ?? (Record exist in the database for both queries)
    And How can I rertieve both the resultsets. ??
    Plz help me asap.
    For ur convenience I m posting the Java code also which I m trying.
    sql.delete(0, sql.length());
    sql.append("select FIRST_NAME , MIDDLE_NAME , LAST_NAME from USER_MASTER where USER_ID=4;");
    sql.append("select producttransaction_id, product_type from product_transaction where transaction_id=102 order by product_type desc");
    Statement stmt = con.createStatement();
    stmt.execute(sql.toString());
    int resultsetcount =1;
    ArrayList arrlist = new ArrayList();
    rs = stmt.getResultSet();
    if(rs !=null)
    if(rs.next())
    .........// logic here working properly
    //Now when I move to next resultset using the below statement
    //it returns false indicating that there r no more results.
    // Why this is so ?????
    boolean moreresultsets = stmt.getMoreResults();
    System.out.println("MoreResultsets::"+moreresultsets);
    if(moreresultsets)
    rs = stmt.getResultSet();          
    if(rs!=null)
    while(rs.next())
    //...Logic.......
         rs.close();
    Thanks

    I've never seen this used the way you are using it. In my experience the only way to do this would be to execute a single SQL statement that returns multiple result sets - you are trying to append two SQL statements.
    You could define an in-line procedure wrapping your two select statements, or you could define a stored procedure to do the same thing. Then (either way) use CallableStatement to execute the call to the procedure.

  • Multiple select queries used in Excel BI report ,fetching data from Sharepoint DB(SP2010_Prod_ProjectServer) causing blockage on DB ,when more than one workbook(same copy of Excel BI Report) refreshed using Refresh All option.

    I am using mutiple select queries to fetch data from Project Server 2010 DB(its sharepoint DB) and these queries fetch data in Excel BI report by establishing connection with DB using instance name and all. I have enhance all these select queries and data
    is being fetched in secs. but when more than one copy of same Excel BI report is refreshed using 'Refresh All' option, then these select queries cause blockage on DB.
    Please let me know mitigation for this blockage issue.
    Should I use begin transaction and commit transaction statements/ shared lock statements.
    please reply

    Hi,
    run same query at the same time?

  • Data from 2 tables for jdbc sender adapter

    how to pickup data from 2 tables at a time when using a jdbc sender adapter?

    select <fields> from table1 where <condition>
    union
    select <fields> fromt table2 where <condition>
    also u can combine this with joins as pointed

  • Data Types for JDBC Sender/Receiver Adapter

    HI experts,
                    I am very much confused how the data types shoudl be for the Sender/receiver for JDBC.
    And is there any standard format where it should be used, or what is the strucutre to be used,.
    Please let me know in clear and help me out in this regard,
    Edited by: Amruth on Dec 4, 2008 6:11 AM

    HI Nagarjuna,
    If my understanding is correct, When you trigger the Idoc from R/3 it thrown the error in XI.
    If  you want to send the same Idoc then go to WE19 in R/3 system enter the same Idoc number and execute the scenaio. It send the Idoc to XI system, but the message number will change.
    Regards
    Goli Sridhar

  • Multiple selection limitation for SE16

    Dear Experts,
    I have a question regarding the table search using the transaction SE16.
    I have a table zzz and i want to search some data in this table zzz. So I fill in the document field the accounts that I what to do the search.
    But the search is not base on a range of accounts, I want some specific accounts... so next to the document field there's a arrow for e multiple selection and then i place the x numbers of accounts I want to search in the "Select Single Values" tab.
    So i can place:
    1
    2
    3
    N entries
    But looks like it's limited up to 4095 entries, if I exceed more than 4095 entries, it will just return no data found!!!
    If I load 4095 entries it does return the data I want...
    So, is there any configuration for this kind of limitation?
    Regards
    Chun

    Hi All,
    thank you for the interest you had to solve my problem, but actually the problem persist.
    I just noticed something... it only happens when i use 2 fields for search criteria.
    for example.
    Field 1 is the range of the date.
    Filed 2 is the document number.
    So i fill up the range of the date, using 4095 registries in the filed 2 it will show me for example 1000 results. But if I add a additional registry(4096) to the field 2 in the multiple selection, it will return 0 results.
    That's pretty weird.
    Regards,
    Chun

  • JDBC DRIVER for JDBC SENDER

    Hi at All,
    I need to know where I can find the necessary information for my JDBC DRIVER and relative CONNECTION. I must realize a Communication channel for a JDBC SENDER.
    Best Regards
    Giuseppe

    Hi
    The error obteined from the Communication Channel Monitoring is:
    Error during database connection to the database URL 'jdbc:odbc:Driver={Microsoft Access Driver (.mdb)};DBQ=C:\CAMURRI_SENDER\Tabella_Student.mdb' using the JDBC driver 'sun.jdbc.odbc.JdbcOdbcDriver': 'com.sap.aii.adapter.jdbc.sql.DriverManagerException: Cannot establish connection to URL 'jdbc:odbc:Driver={Microsoft Access Driver (.mdb)};DBQ=C:\CAMURRI_SENDER\Tabella_Student.mdb': SQLException: [Microsoft][ODBC Microsoft Access Driver] System resource exceeded.'
    Regards
    Giuseppe

  • Stuck with logical system name for JDBC Sender system!!!!!!!!!!!!!

    Hi All,
    I'm doing a scenario as JDBC2FILE.
    I tried to add my jdbc sender system to SLD. So i created the technical system
    now i'm creating business system...what should i give at logical system name tab? I've created tech system and business system as third party.
    do we need logical system name in this scenario where we are not interacting with any R/3???
    can anyone suggest the way to achieve this scenario?
    Thanks in advance.....
    Santhosh.

    Hi Santhosh,
    I just want to add ons..few more information which it might help you.
      You no need to give logical system when you are using Thirdpaty.
    Please check the below blog you will get more idea how to proceed to achieve the JDBC Scenario.
    /people/sap.user72/blog/2005/06/01/file-to-jdbc-adapter-using-sap-xi-30
    If you have any doubts while proceeding with your scenario plesae let me know..I will try my level best.
    Thanks and Regards,
    Chandu

  • Union among multiple select queries with full outer join

    Hello everyone,
    I have 3 different select queries (used FULL Outer Join) which work fine. Now I want to add Union to the results among them and pick the selected columns from each query in the final result. while doing so, I am getting an error as "right parenthesis missing". I am quite sure, it is not the real cause. I guess might be issue with the query structure.
    select j.pod, j.hostname, portal.hostname,saasc.hostname,a3s.hostname from -- * from
    Select J.Pod,J.Hostname, P.Pod Portal_Pod,P.Hostname Portal_Hostname
    From Total_Pod J
    full outer join Portal_Tmp P On (J.Pod = P.Pod And J.Hostname = P.Hostname) as portal
    Union
    Select J.Pod,J.Hostname, s.Pod saasc_Pod,s.Hostname saasc_Hostname
    From Total_Pod J
    full outer join Saasc_Tmp S  On (J.Pod = s.Pod And J.Hostname = s.Hostname) as saasc
    Union
    Select J.Pod,J.Hostname, a.Pod a3s_Pod,a.Hostname a3s_Hostname
    From Total_Pod J
    Full Outer Join A3s_Tmp A  On (J.Pod = A.Pod And J.Hostname = A.Hostname) as a3s
    )p.s: select * from (INNER QUERY); also does not work.
    Any help appreciated.
    Thanks in advance.

    With T as
    (Select J.Pod,J.Hostname, P.Pod Portal_Pod,P.Hostname Portal_Hostname
    From Total_Pod J
    full outer join Portal_Tmp P On (J.Pod = P.Pod And J.Hostname = P.Hostname) ),
    U as
    (Select J.Pod,J.Hostname, s.Pod saasc_Pod,s.Hostname saasc_Hostname
    From Total_Pod J
    full outer join Saasc_Tmp S  On (J.Pod = s.Pod And J.Hostname = s.Hostname) ),
    V as
    (Select J.Pod,J.Hostname, a.Pod a3s_Pod,a.Hostname a3s_Hostname
    From Total_Pod J
    Full Outer Join A3s_Tmp A  On (J.Pod = A.Pod And J.Hostname = A.Hostname) )
    Select T.Pod,T.Hostname,nvl(T.Portal_Hostname,'Not Available') portal,nvl(U.Saasc_Hostname,'Not Available') saasc,NVL(V.A3s_Hostname,'Not Available') a3s From T,U,V
    Where T.Pod = U.Pod
    And U.Pod = V.Pod
    And T.Hostname = U.Hostname
    And U.Hostname = V.Hostname

  • Proxy to JDBC interface with multiple select queries

    Hi all,
    We have to develop a interface where SAP will be sending a Number based on which we have to fetch the data from the database and send it to back to the SAP system.
    The data in database is spread across 6-7 tables/views and canu2019t be fetched using a single query even with joins.
    Can anyone please suggest the best way to develop this interface.
    As it would be a synchronous interface, I think it is not possible to use multimapping.
    Regards
    Younus

    >They have confirmed that they can't create a stored procedure but can create PL/SQL program or function with the same logic.
    IMO, it is not fully feasible to call the oracle function from PI. I would recommend still to use query and construct the following jdbc data structure.
    <StatementName>
    <anyName action=u201D SQL_QUERYu201D
    <access>SQL-String with optional placeholder(s)</access>
    <key>
      <placeholder1>value1</placeholder1>
      <placeholder2>value2<placeholder2>
    </key>
    </anyName > 
    </StatementName>
    Place your complex join query in the access tag element. Under key tag you can pass values through placeholder element and reference the placeholder element as follows. Sample as follows...
    <statement>
        <Customers action="SQL_QUERY">
          <access> Select x,y,z from customers1 a, customers2 b,customers3  c, where a.CompanyName=u2019$NAME$u2019 and b.CustomerID='$KEYFIELD$u2019
          </access>
          <key>
            <NAME>Company</NAME>
             <KEYFIELD>CO</KEYFIELD>
          </key>
        </Customers>
      </statement>

  • Execute Multiple "select" queries from a java program

    Hi,
    Please take time to see the code below.
    What my problem is:
    All the queries given will be executed one by one. So, if there is large data to be retrieved then each query will take so much of time.
    Is there any way that i can execute all the 3 queries simultaneously so that i can get quicker response time.
    Please send me the way to do it and any sample code if available
    Thanks.........
    public static void main(String argv[])
    float spr=0;
    float spr1=0;
    float spr2=0;
    int db_block_size=0;
    String query1;
    String query2;
    String query3;
    query1="select count(distinct(substr(dbms_rowid.rowid_to_Restricted(rowid,0),1,8))) from table1";
         query2="select count(distinct(substr(dbms_rowid.rowid_to_Restricted(rowid,0),1,8))) from table2";
         query3="select count(distinct(substr(dbms_rowid.rowid_to_Restricted(rowid,0),1,8))) from table3";
    Connection conn;
    Statement stmt;
    String name;
         try {
    Class.forName("com.inet.ora.OraDriver");
              catch(java.lang.ClassNotFoundException e)
                   System.err.print("ClassNotFoundException: ");
                   System.err.println(e.getMessage());
    try
         conn = DriverManager.getConnection("jdbc:inetora:135.112.22.51:1521:S","dacscan","mnc");
    stmt = conn.createStatement();
    ResultSet rset=stmt.executeQuery("select value from v$parameter where name='db_block_size' ");
    rset.next();
         db_block_size=rset.getInt(1);
    System.out.println(db_block_size);
         rset.close();
    rset=stmt.executeQuery(query1);
    rset.next();     
    spr=rset.getFloat(1);
              System.out.println (spr);
         rset.close();
    rset=stmt.executeQuery(query2);
    rset.next();
         spr2=rset.getFloat(1);
              System.out.println (spr2);
         rset.close();
    rset=stmt.executeQuery(query3);
    rset.next();
         spr3=rset.getFloat(1);
              System.out.println (spr3);
         rset.close();
    catch(SQLException ex)
                   System.err.println("SQLException: " + ex.getMessage());
                   ex.printStackTrace();
              }

    Is there any way that i can execute all the 3 queries simultaneously so that i can get quicker response time.
    Yes, you can execute queries #1 and #2 each in its own thread. Execute query #3 in the original thread. Then use Thread.join() to wait for each of the other two queries to finish.
    - Saish

  • Writing Select statement for JDBC Adapter

    Dear frndz,
       Please guide me, i have to pick record form the Oracle D/B,
    and this has to be updated in the Sap Table. For this scenario, tell me where i have to write the select statements to fetch the particular record.I was asked to use the jdbc adapter for this d/b link.
    Thanks in advance
    Karthikeyan

    Hi karthikeyan,
    You have to use a sender JDBC adapter.
    Just follow the instructions in this link:
    http://help.sap.com/saphelp_nw04/helpdata/en/14/80243b4a66ae0ce10000000a11402f/frameset.htm
    Previously, you must install Oracle drivers so that JDBC works properly.
    Regards,
    Carlos

  • Combining multiple WMI Queries for Single Step in Task Sequence?

    Hi there,
    since i couldn't find an answer on google i try to find the information here:
    i would like to use a multiple wmi query in a single step in task sequence.
    hat means i want to query fist if the Computer is a Laptop or not and then if yes, if it is from HP  Manufacturer.
    To find out if Machine is a Laptop i use the following wmi query:
    Select * from Win32_Battery WHERE (Batterystatus <> 0)
    To find out if the Machine is from Manufacturer HP i use the following wmi query:
    Select * from Win32_ComputerSystem WHERE Manufacturer LIKE "%HP%"
    my question: is it possible to combine those 2 queries?
    Like IF this is a Laptop AND IF it comes from HP, then install this type of software package?
    Thanks for your answers!

    unfortunely this did not work.
    i try to install specific software for all HP Laptops:
    but this software won't get installed on any HP Laptop. Message according to the logfile
    "The task sequence execution engine skipped an action because the condition was evaluated to be false"
    If i remove one of the WMI-Queries Installation works successfully.
    Can anyone point me what i might do wrong here?

  • 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

Maybe you are looking for