Sending a dynamic query to DB adapter

Hi,
I am using jdeveloper 10.1.3.4. As per the requirements, I am supposed to have only one DB adapter which will handle all the operations on the database tables. The SQL is created at the runtime depending on the input. Is there any option for DB adapter where I can pass this dynamic query?
Thanks
Taru

Taru,
I assume you're talking about the ESB/SOA Suite DB adapter - in which case, the SOA Suite forum would probably yield you better results.
John

Similar Messages

  • Passing dynamic query to DB adapter

    Hi,
    I am using jdeveloper 10.1.3.4 for configuring a BPEL flow. As per the requirements, I am supposed to have only one DB adapter which will handle all the operations on the database tables. The SQL is created at the runtime depending on the input. Is there any option for DB adapter where I can pass this dynamic query? Is there another way to implement this, if not this way?
    Thanks
    Taru

    Taru,
    I assume you're talking about the ESB/SOA Suite DB adapter - in which case, the SOA Suite forum would probably yield you better results.
    John

  • Dynamic query using DB Adapter

    Experts,
    I am using DB adapter to call a simple database query. I have selected the option of Execute Pure SQL and the query is -
    SELECT DEPT_NAME,EMPLOYEE FROM DEPARTMENT WHERE EMP_ID IN ( SELECT EMPID FROM EMPLOYEE WHERE (DEPT_ID=#DEPTID))
    When I run the query standalone on database passing the value of dept_id, it works perfect.
    Additionally when I hardcode the value of #DEPTID in db adapter, it works succesfully. But if I use the above query passing DEPTID as input from my bpel process, it returns nothing.
    Can anyone tell me where I am going wrong?
    Thanks

    It is better to have your query in stored procedure. It would help in avoiding deployments in case of a change.
    Cheers!

  • 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

  • Build dynamic SQL query in Database Adapter.

    Hi All,
    I have a requirement to build dynamic sql query at Database Adapter.
    My BPEL process is getting search spec as input from siebel. I need to process this searchspec in BPEL and need to build the SQL query dynamically at Database Adapter to fetch the records from DB.
    it goes like this....
    1. Sieble Search Spec: city1 OR city2 OR city3 OR city4 .....
    I need to build query as
    select * from S_ADDR_PER where city like 'city1' OR city like 'city2' OR city like 'city3' OR city like 'city4' ......
    2. Siebel Search spec: city1 AND country1 AND state1....
    I need to build query as
    Select * from S_ADDR_PER where city like 'city1' AND country like 'country1' AND state like 'state1' ....
    3. Siebel Search spec: state
    I need to build query as
    select * from S_ADDR_PER where state like '%state%';
    Is it feasible in Database Adapter? if its Yes.
    Any guidelines to achieve this?
    Thank you
    Chandra

    Hi All,
    I have a requirement to build dynamic sql query at Database Adapter.
    My BPEL process is getting search spec as input from siebel. I need to process this searchspec in BPEL and need to build the SQL query dynamically at Database Adapter to fetch the records from DB.
    it goes like this....
    1. Sieble Search Spec: city1 OR city2 OR city3 OR city4 .....
    I need to build query as
    select * from S_ADDR_PER where city like 'city1' OR city like 'city2' OR city like 'city3' OR city like 'city4' ......
    2. Siebel Search spec: city1 AND country1 AND state1....
    I need to build query as
    Select * from S_ADDR_PER where city like 'city1' AND country like 'country1' AND state like 'state1' ....
    3. Siebel Search spec: state
    I need to build query as
    select * from S_ADDR_PER where state like '%state%';
    Is it feasible in Database Adapter? if its Yes.
    Any guidelines to achieve this?
    Thank you
    Chandra

  • Dynamically Pass sql query in Database adapter

    hi',
    How can we dynamically pass sql query in Database adapter, is there any way, I am using SOA 11G.
    Thanks
    Yatan

    Hi,
    Tried that too. No luck. Gives me this.
    The selected operation process could not be invoked.
    An exception occured while invoking the webservice operation. Please see logs for more details.
    oracle.sysman.emSDK.webservices.wsdlapi.SoapTestException: Exception occured when binding was invoked.
    Exception occured during invocation of JCA binding: "JCA Binding execute of Reference operation 'selectUsingIn' failed due to: Pure SQL Exception.
    Pure SQL Execute of select interface_id, property_name, property_value from ( (?) ) failed.
    Caused by java.sql.SQLSyntaxErrorException: ORA-00903: invalid table name
    The invoked JCA adapter raised a resource exception.
    Please examine the above error message carefully to determine a resolution.
    Regards,
    Neeraj Sehgal

  • Error while passing URL Dynamically in SOAP AXIS adapter..!!

    Hi ,
    Idoc> XI>SOAP-AXIS
    I am doing a scenario where I need to pass the URL dynamically in SOAP-AXIS adapter by taking the RCVPRN of Idoc.
    If
    RCVPRN = 100 , message has to go to http://10.190.25.16:8210/file/receiver
    RCVPRN = 200 , message has to go to    http://10.190.25.16:8210/file/receiver2
    RCVPRN = 300 , message has to go to    http://10.190.25.16:8210/file/receiver3
    I used the below UDF and it is working correctly and generating the URL dynamically .
    DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey keyHeader1 = DynamicConfigurationKey.create( "http://sap.com/xi/XI/System/SOAP", "TServerLocation");
    conf.put(keyHeader1, a);
    return "";
    The value is coming in SOAP document as expected like below.
    <sap:DynamicConfiguration xmlns:sap="http://sap.com/xi/XI/Message/30" SOAP:mustUnderstand="1">
      <sap:Record namespace="http://sap.com/xi/XI/System/SOAP" name="TServerLocation">http://10.190.25.16:8210/file/receiver3</sap:Record>
      </sap:DynamicConfiguration>
    I used the below Configuration modules in receiver SOAP-AXIS adapter as suggested in Note 1028961.
    AF_Adapters/axis/AFAdapterBean ---> afreq
    AF_Adapters/axis/HandlerBean ---> xireq
    AF_Adapters/axis/HandlerBean ---> dc
    AF_Adapters/axis/HandlerBean ---> remover
    AF_Adapters/axis/HandlerBean ---> trp
    AF_Adapters/axis/HandlerBean ---> xires
    AF_Adapters/axis/AFAdapterBean ---> afres
    xireq -> handler.type-> java:com.sap.aii.axis.xi.XI30OutboundHandler
    dc -> handler.type-> javasap.aii.axis.xi.XI30DynamicConfigurationHandler
    dc ---> key.1 ---> write http://sap.com/xi/XI/System/SOAP TServerLocation
    dc ---> location.1 ---> context
    dc ---> value.1 ---> transport.url
    remover ---> handler.type ---> java:com.sap.aii.axis.soap.HeaderRemovalHandler
    remover ---> namespace ---> http://sap.com/xi/XI/Message/30
    trp ---> handler.type ---> java:com.sap.aii.adapter.axis.ra.transport.http.HTTPSender
    trp ---> module.pivot ---> true
    xires ---> handler.type ---> java:com.sap.aii.axis.xi.XI30OutboundHandler
    and I am getting the below error in SOAP-AXIS channel at the point java:com.sap.aii.adapter.axis.ra.transport.http.HTTPSender.
    2009-03-02 15:23:44 Success Axis: getting handler trp of java:com.sap.aii.adapter.axis.ra.transport.http.HTTPSender
    2009-03-02 15:23:45 Error Axis: error in invocation: (500)internal server error
    2009-03-02 15:23:45 Error MP: Exception caught with cause (500)internal server error
    2009-03-02 15:23:45 Error Exception caught by adapter framework: (500)internal server error
    2009-03-02 15:23:46 Error Delivery of the message to the application using connection SOAP_http://sap.com/xi/XI/System failed, due to: com.sap.aii.af.ra.ms.api.RecoverableException: (500)internal server error: (500)internal server error.
    2009-03-02 15:23:46 Error The message status set to NDLV.
    Kindly let me know if anyone has any idea what might be wrong?
    Note : The given URL is correct one because I cross checked by passing them normally by giving directly in adapter and they are all working and the message is going to receiver.
    Thanks
    Deepthi

    Hi Stefan,
    >> dc -> handler.type-> javasap.aii.axis.xi.XI30DynamicConfigurationHandler
    >> dc ---> key.1 ---> write http://sap.com/xi/XI/System/SOAP TServerLocation
    >> dc ---> location.1 ---> context
    >> dc ---> value.1 ---> transport.url
    >> Try read instead of write
    When I tried with this, I am getting the below error "Connection refused ".
    Success Axis: entering HandlerBean
    Success Axis: getting handler trp of java:com.sap.aii.adapter.axis.ra.transport.http.HTTPSender
    Error Axis: error in invocation: java.net.ConnectException: Connection refused
    Error MP: Exception caught with cause java.net.ConnectException: Connection refused
    Error Exception caught by adapter framework: ; nested exception is: java.net.ConnectException: Connection refused
    Error Delivery of the message to the application using connection SOAP_http://sap.com/xi/XI/System failed, due to: com.sap.aii.af.ra.ms.api.RecoverableException: ; nested exception is: java.net.ConnectException: Connection refused: java.net.ConnectException: Connection refused.
    Success The message status set to WAIT.
    It is going successfully when I tried sending directly. Looks like Dynamic Configuration is not working for SOAP-AXIS.
    Any Suggestion?
    Thanks
    Deepthi.

  • Query regarding sftp adapter

    Hi
    Is there any way we can use dynamic configuration with sftp adapter ?
    Requirement is that I need to retrieve input file name and use that somewhere
    but for sftp sender I could not locate adapter specific message attributes.
    Does that mean its impossible to retrieve file name during runtime?

    Hi Akhil
    have  a look on this links
    Standrad File adapter shipped with XI does not support SFTP. You can may be consider using FTPS ( File Transfer Protocol using SSL/TLS ).
    Check this link for further info,
    http://help.sap.com/saphelp_nw04/helpdata/en/0b/9a50465ccf84479e39a6d50c90fb3f/content.htm
    For HTTPS and FTPS, you need to define if your communication will have certificate authentication, user authentication, none or both. User/password you enter in the adapter parameters, it's simple. For certificates, you need to import (load) it on Key Storage service, service_ssl view, on Visual Administrator (or create the key pair certificate on XI and then sign then on some Certification Authority, on the same service). Check http://help.sap.com/saphelp_nw04/helpdata/en/f1/2de3be0382df45a398d3f9fb86a36a/frameset.htm for further information.
    HTTPS / SFTP with XI
    Need Some Pointers for adapter development
    there's a sample adapter shipped with the XI
    /people/gowtham.kuchipudi2/blog/2006/01/04/testing-sample-adapter
    Fle Adapter connection to SFTP server ove SSH
    sftp adapter creation
    Thanks !

  • Update query in JDBC adapter

    Hi guys help me with this
    1) What is the use of update query in jdbc adapter?
    2) Why do we use the flag field in jdbc table ?

    Hi,
    1) What is the use of update query in jdbc adapter?
    The purpose of the Update Query in JDBC is to change the status of the processed records in the table.
    That is when JDBC query is executed  it select the records from the table in the Database and it sends to the Receiver.
    After that it executes the Update query to change the status of the processed records in the Table.
    2) Why do we use the flag field in jdbc table ?
    Flag field in the table is used to identify which record is processed by Jdbc adapter. Initial stage it will have the status as 0 , if it is successfully processed then it will updated to 1.
    Based on this we can identify processed records which is done by update query.
    Regards
    Sridhar Goli

  • Parameter in form for dynamic query in report

    Hello,
    I want to send parameters to report for replacing a dynamic query. I don't know how to make it...
    1.I want my select statement like
    select * from emp
    &p_where_clause
    2.I want to transfer parameters to report to replace the &p_where_clause.
    3.I know I should create a parameter list first, and then use add_parameter built-in to add the parameter, but what I don't know is the correct format of the add_parameter statement.
    4.I know the common format is add_parameter(paramlist,'TEXT_PARAMETER',value) , is it the same format if I want to transfer a select statement to report such as "where deptno in ('25','28','30')" for replacing &p_where_clause in report?
    Thanks in advance
    Joseph

    I appreciate your reply, but I am still a little confused...
    Actually, I want to pass the where clause to report by different condition. Such as when the user choose the deptment 1, then I can transfer the "where dept_no = '1' and empno > 500", or user choose the deptment 2, I can transfer "where dept_no = '2' and company = '0001'". What I want is to pass different where clause to report according to different condition.
    So is it right the statement should be like
    DECLARE
    vWhere1 varchar2 := 'where dept_no = "1" and empno > 500';
    vWhere2 varchar2 := 'where dept_no = "2" and company = "0001"';
    BEGIN
    IF choose = 1 THEN
    ADD_PARAMETER(&P_WHERE_CLAUSE, TEXT_PARAMETER, vWhere1);
    ELSIF choose = 2 THEN
    ADD_PARAMETER(&P_WHERE_CLAUSE, TEXT_PARAMETER, vWhere2);
    END IF;
    END;
    THANKS AGAIN!!
    Joseph

  • Help on performance with dynamic query

    Hi All,
      We are using SQL Server 2008R2. In our one of report we are using Dynamic query and it is taking more time to retrieve the data. to retrieve 32 records it is taking 13-15 secs. In my observation in a table variable, created more than 60 columns. In
    the SP called one more sp with insert statement.
    Please let me know how i can improve performance of the SP.
    I know that i have to provide the SP  for observation but unfortunately I cannot provide the SP. Please guide me how i can achieve this .
    I tried with temp tables by creating indexes on temp tables but i couldn't find improvement in performance. 
    Waiting for valuable replies.

    First of all a "dynamic query" is not "a query" - it is a multitude of them. Some of them may be fast, others may be slow.
    There is of course no way we can give specific suggestions without seeing the code, the table and index definitions etc.
    We can only give the generic suggestions. As for the code, make sure that you are using parameterised SQL and you are not building a complete SQL string with parameters and all. If nothing else, this helps to make the code more readable and maintainable.
    It also protects you against SQL injection. And it also helps to prevent performance issue due to implicit conversion.
    You will need to look at the query plan to see where the bottlenecks may be. You should look at the actual query plan. Note that the thickness of the arrows are more relevant than the percentages you see; the percentages are only estimates, and estimates
    are often off. Next step is to see if you can add indexes to alleviate the situation. You should also analyse if there are problems in the query, for instance indexed columns that are entangled in expression. If you are using views, make sure that you don't
    have views built on top of views etc. This can often result a table appearing multiple times in a query, when one would be enough.
    Erland Sommarskog, SQL Server MVP, [email protected]

  • How to find table name(s) in a dynamic query

    In one of our (9iAS PORTAL)applications, any user can able to run their query statment and get output. All queries will be executed as dynamic SQL thru' a common shema/user who has 'SELECT' privilege on all tables but all users don't have this privilege on all tables. Now, before executing any query I need to find out what are the table name(s) used in this query to check the privilege for the respective user. How do I extract all table names being used in a dynamic query?.
    Thanks
    -Krishnamurthy

    I guess that his users log in to application first, then application uses one account to log in to database, so application are not direct database user since all users share the same account to database. If so, when a user lgins in, you may write it down from application to a database audit table, and you need to write down the dynamic query to the database audit table too, then you may query that audit table to find out. up to here, it looks that your application has to do more to assign what role to a user running the application, since database does not know what user is assessing it.

  • SAP MII 14.0 SP5 Patch 11 - Error has occurred while processing data stream Dynamic Query role is not assigned to the Data Server

    Hello All,
    We are using a two tier architecture.
    Our Corp server calls the refinery server.
    Our CORP MII server uses user id abc_user to connect to the refinery data server.
    The user id abc_user has the SAP_xMII_Dynamic_Query role.
    The data server also has the checkbox for allow dynamic query enabled.
    But we are still getting the following error
    Error has occurred while processing data stream
    Dynamic Query role is not assigned to the Data Server; Use query template
    Once we add the SAP_xMII_Dynamic_Query role to the data server everything works fine. Is this feature by design ?
    Thanks,
    Kiran

    Thanks Anushree !!
    I thought that just adding the role to the user and enabling the dynamic query checkbox on the data server should work.
    But we even needed to add the role to the data server.
    Thanks,
    Kiran

  • Single quote in dynamic query

    Hi all;
    Can u please help me on the following dynamic query code ? I know I am missing the single quote around 2 dates but could not figure out where to put it ! I have tried putting 2 or 3 quotes around 2 bind vars but to no avail.
    Want to create a dynamic query to simulate the the following:
    select
    EMPNO,ENAME,JOB,MGR,HIREDATE from emp where HIREDATE >= to_date('01/01/1981','MM/DD/YYYY') and HIREDATE <= to_date('12/31/1982','MM/DD/YYYY');
    dynamic code:
    declare
    v_q varchar2(4000);
    begin
    v_q :='select EMPNO,ENAME,JOB,MGR,HIREDATE from emp ';
    V_q := V_Q
    || 'where HIREDATE >= '
    || 'to_date(' || :P_DATE1 || ',' ||'''MM/DD/YYYY''' || ' )'
    || 'and HIREDATE <= '
    || 'to_date(' || :P_DATE2 || ',' ||'''MM/DD/YYYY''' || ' )';
    -- end the sql
    v_q := v_q ||';';
    dbms_output.put_line ('V_Q is ' || V_Q);
    end;
    Thanks.
    Zen

    declare
        v_q varchar2(4000);
        v_rec emp%rowtype;
        v_cur sys_refcursor;
    begin
        v_q :='select EMPNO,ENAME,JOB,MGR,HIREDATE from emp ';
        V_q := V_Q  || 'where HIREDATE >= to_date(:P_DATE1,''MM/DD/YYYY'') and HIREDATE <= to_date(:P_DATE2,''MM/DD/YYYY'')';
        dbms_output.put_line ('V_Q is ' || V_Q);
        open v_cur
          for v_q
          using '01/01/1981',
                '12/31/1982';
        loop
          fetch v_cur
            into v_rec.empno,
                 v_rec.ename,
                 v_rec.job,
                 v_rec.mgr,
                 v_rec.hiredate;
          exit when v_cur%notfound;
          dbms_output.put_line('empno = ' || v_rec.empno);
          dbms_output.put_line('ename = ' || v_rec.ename);
          dbms_output.put_line('job = ' || v_rec.job);
          dbms_output.put_line('mgr = ' || v_rec.mgr);
          dbms_output.put_line('hiredate = ' || to_char(v_rec.hiredate,'MM/DD/YYYY'));
          dbms_output.put_line('====================');
        end loop;
        close v_cur;
    end;
    V_Q is select EMPNO,ENAME,JOB,MGR,HIREDATE from emp where HIREDATE >=
    to_date(:P_DATE1,'MM/DD/YYYY') and HIREDATE <= to_date(:P_DATE2,'MM/DD/YYYY')
    empno = 7499
    ename = ALLEN
    job = SALESMAN
    mgr = 7698
    hiredate = 02/20/1981
    ====================
    empno = 7521
    ename = WARD
    job = SALESMAN
    mgr = 7698
    hiredate = 02/22/1981
    ====================
    empno = 7566
    ename = JONES
    job = MANAGER
    mgr = 7839
    hiredate = 04/02/1981
    ====================
    empno = 7654
    ename = MARTIN
    job = SALESMAN
    mgr = 7698
    hiredate = 09/28/1981
    ====================
    empno = 7698
    ename = BLAKE
    job = MANAGER
    mgr = 7839
    hiredate = 05/01/1981
    ====================
    empno = 7782
    ename = CLARK
    job = MANAGER
    mgr = 7839
    hiredate = 06/09/1981
    ====================
    empno = 7839
    ename = KING
    job = PRESIDENT
    mgr =
    hiredate = 11/17/1981
    ====================
    empno = 7844
    ename = TURNER
    job = SALESMAN
    mgr = 7698
    hiredate = 09/08/1981
    ====================
    empno = 7900
    ename = JAMES
    job = CLERK
    mgr = 7698
    hiredate = 12/03/1981
    ====================
    empno = 7902
    ename = FORD
    job = ANALYST
    mgr = 7566
    hiredate = 12/03/1981
    ====================
    empno = 7934
    ename = MILLER
    job = CLERK
    mgr = 7782
    hiredate = 01/23/1982
    ====================
    PL/SQL procedure successfully completed.
    SQL> SY.

  • Dynamic Query to display a page of records at a time

    I need some help creating procedure with a dynamic query that will query a table and pass out a certain number of records (like records 101 - 200 of 20,000). This procedure will receive the column names, table name, where clause, page number and number of records per page. It will then pass back the requested records to be displayed on a PHP page.
    Pseudo Code:
    Select Dynamic_Columns, ROWNUM
    Into Dynamic_Pl_Sql_Table
    From Dynamic_Table
    Where Dynamic_Where_Clause
    Total_Records_Out := Dynamic_PL_Sql_Table.Count
    Modulus := Mod(Total_Records_Out, Total_Records_Per_Page_In)
    Total_Pages_Out := (Total_Records_Out - Modulus) / Total_Records_Per_Page_In
    If Modulus > 0 Then
    Total_Pages_Out + 1
    End If
    Row_Start = Page_Number_In * Total_Records_Per_Page_In
    Row_End = Row_Start + Total_Records_Per_Page_In
    Results_Out = Dynamic_Pl_Sql_Table(Row_Start ... Row_End)
    Any help with this will be appreciated!

    Maybe this will help you
    1) If the Serial is 0 then page break
    2) total_rows gives you total number of rows selected.
    3) you can apply where clause to this and it will give you appropriate records.
    select empno, ename, sal, 
    mod(row_number() over (order by null),5) serial,
    count(*) over () tot_rows from emp ed
         EMPNO ENAME             SAL     SERIAL   TOT_ROWS
          7369 SMITH             800          1         14
          7499 ALLEN            1600          2         14
          7521 WARD             1250          3         14
          7566 JONES            2975          4         14
          7654 MARTIN           1250          0         14
          7698 BLAKE            2850          1         14
          7934 MILLER           1300          2         14
          7788 SCOTT            3000          3         14
          7839 KING             5000          4         14
          7844 TURNER           1500          0         14
          7876 ADAMS            1100          1         14
          7900 JAMES             950          2         14
          7902 FORD             3000          3         14
          7782 CLARK            2450          4         14
    14 rows selected.SS

Maybe you are looking for

  • Iphone and ipad are with different carriers, can i use the same apple id on both?

    Hi all, I am having some difficulties with setting up my new ipad, i have a different telecommunications carrier for my iphone to my ipad, however my appleID does not allow me to enter another mobile number for my ipad.   When i set up the ipad to my

  • Tables for batchwise stock

    Hello Friends, can anybody tell be the tables used in mmbe report ie batchwise stock for material. i want the tables for the same Regards, Sunny

  • Audio not importing from PP to AE (5.5)

    I am baffled and hope that some one can help. I am working with a third party AE Template (No pluggins) and I have tried several ways but still no audio imports to AE. Original footage is from an HD Camera CF card and was pulled into my Mac as option

  • There's this mysterious appearing/disappearing icon in my Dock...

    ...that every so often spontaneously opens up, then closes right away. I can never get a good look at it, but it appears to be a white "page" (like the TextEdit dock icon) with what looks like a green part in the upper left corner and a black part in

  • Lk 6.2 Crashes when you "Save All" in edit mode

    From Lk 6.2 bugs post.  Thought this needs it's own thread. I've had lots of crashes after "Save All" menu command while in edit mode.  Recently, the crashes were all after draging display objects to panels and/or copying objects between panels.  It