Dynamic query in weblogic 7.0?

Hi:
I tried dynamic query in weblogic 7.0 for almost a month but still failed. So I wish someone can help me .
I used dynamic query in a session bean.
QueryHome queryHome = (QueryHome) ctx.lookup("java:comp/env/ejb/BooksEJB");
But this line always returns null for queryHome. I am sure my JNDI for CMP 2.0 BooksEJB is right.
I also set <enable-dynamic-queries>True</enable-dynamic-queries>
in descriptor file followed by instructions in bea documentation.
Thanks !

Ace:
Shall I set this parameter in weblogic descriptor file ? If so, how do I set
? Thanks for your information here !
[email protected] (Ace) wrote:
The parameter for ctx.lookup() is what you have set the JNDI name for
QueryHome in weblogic.
~Ace.
Cottonxu <[email protected]> wrote in message news:<[email protected]>...
Hi:
I tried dynamic query in weblogic 7.0 for almost a month but stillfailed. So I wish someone can help me .
I used dynamic query in a session bean.
QueryHome queryHome = (QueryHome) ctx.lookup("java:comp/env/ejb/BooksEJB");
But this line always returns null for queryHome. I am sure my JNDIfor CMP 2.0 BooksEJB is right.
I also set <enable-dynamic-queries>True</enable-dynamic-queries>
in descriptor file followed by instructions in bea documentation.
Thanks !

Similar Messages

  • How to enable dynamic query in weblogic 7.0?

     

    Hi,
    The documentation explains how to enable dynamic queries and set a
    method-permission to control access. If you find the information at the
    following link insufficient, let me know.
    http://e-docs.bea.com/wls/docs70/ejb/cmp.html#1089703
    You enable dynamic queries in your weblogic-ejb-jar.xml file with the following:
    <enable-dynamic-queries>True</enable-dynamic-queries>
    You can set a method permission as follows:
    <security-role>
    <role-name>Admin</role-name>
    </security-role>
    <method-permission>
    <role-name> Admin </role-name>
    <method>
    <ejb-name> EmployeeEJB </ejb-name>
    <method-name> createQuery </method-name>
    </method>
    </method-permission>
    - Matt
    Sanjeev Chopra wrote:
    also posting to EJB newsgroup
    "CottonXu" <[email protected]> wrote in message
    news:[email protected]..
    How to enable dynamic query in weblogic 7.0? The documentation accompanieswith
    Bea doesn't explain it in detail. How to set <method-permission> inejb-jar.xml?
    Thanks in advance.

  • Duplicate records for Dynamic Query in WLS 7

    I am getting duplicate records back when I run a dynamic query. If I run the same
    query via a finder method, I get the correct results.
    Here's the query:
    SELECT DISTINCT OBJECT(a) FROM Company AS a, b IN a.userRole WHERE b.userId = ?1
    AND a.deptId IN ('1', '2', '3')
    Company EJB maps to LU_Company (look up table for company)
    Company to UserRole is a one-to-many relationship.
    The number of duplicates is equal to the number of records I have for the same company_id
    in User_Role table.
    The ids for the object I should get back are 1, 2, 3.
    Instead I get back 1, 1, 2, 2, 2, 2, 2, 3, 3, 3
    In the database, company_id 1 occurs twice in user_role table; company_id 2 occurs
    five times.
    Any ideas of why the dynamic query has this problem whereas the same query for a
    finder method works fine?
    Thanks for your help.

    Thanks Greg, that worked!
    "Greg Nyberg" <greg.nyberg.at.objectpartners.com> wrote:
    You can supply properties on the query request, perhaps there is a
    SQL_SELECT_DISTINCT property:
    Properties p = new Properties();
    p.setProperty("GROUP_NAME", "fieldgroup");
    p.setProperty("INCLUDE_UPDATES", "true");
    p.setProperty("SQL_SELECT_DISTINCT", "true");
    Collection people = myQuery.find(
    "SELECT OBJECT(o) FROM PersonCMPEJB o WHERE o.lastName = 'Smith'", p);
    -Greg
    Check out my WebLogic 6.1 Workbook for O'Reilly EJB Third Edition
    www.amazon.com/exec/obidos/ASIN/1931822468 or www.titan-books.com
    "Mike" <[email protected]> wrote in message
    news:[email protected]...
    Matt,
    <sql-select-distinct> needs to be set in <weblogic-query> element. I amgenerating
    a dynamic query from within a local client. So I don't have a finderdefined for
    this method. (I don't want to define a finder for this method). How doyou suggest
    I can use this? Thanks again for your help.
    Matthew Shinn <[email protected]> wrote:
    Hi Mike,
    I just filed a bug report for this (CR079471). As a work around, you
    can
    use the
    setSQLSelectDistinct flag so the database will weed out the duplicates.
    The only thing to
    look out for when using this flag is that Oracle will not allow the use
    of 'SELECT DISTINCT'
    in conjunction with a 'FOR UPDATE' clause, thus,<sql-select-distinct>True
    CANNOT be used if
    any Bean in the calling chain has a method with <transaction-isolation>
    set to
    <isolation-level>TRANSACTION_READ_COMMITTED_FOR_UPDATE. Sorry for theinconvenience.
    - Matt
    Mike wrote:
    I am getting duplicate records back when I run a dynamic query. If
    I
    run
    the same
    query via a finder method, I get the correct results.
    Here's the query:
    SELECT DISTINCT OBJECT(a) FROM Company AS a, b IN a.userRole WHERE
    b.userId
    = ?1
    AND a.deptId IN ('1', '2', '3')
    Company EJB maps to LU_Company (look up table for company)
    Company to UserRole is a one-to-many relationship.
    The number of duplicates is equal to the number of records I have forthe same company_id
    in User_Role table.
    The ids for the object I should get back are 1, 2, 3.
    Instead I get back 1, 1, 2, 2, 2, 2, 2, 3, 3, 3
    In the database, company_id 1 occurs twice in user_role table;
    company_id
    2 occurs
    five times.
    Any ideas of why the dynamic query has this problem whereas the same
    query
    for a
    finder method works fine?
    Thanks for your help.

  • Re: relationship caching for dynamic query finder

    "Carlos Muchiutti" <[email protected]> wrote:
    I have the same scenario ... is there an answer for this?
    "Haoguang" <[email protected]> wrote in message
    news:3e2e64af$[email protected]..
    Is there any way to using the relationship caching defined in thedeployment descriptor
    for the dynamic query?
    I suppose it should be one of the properties passed to the query findmethod (Query.query.find(String,
    Properties)).
    I was unable to locate any documentation or examples for the question.
    What is the key set the Properties? I know the "GROUP_NAME" is one,which
    I found
    via Google. Bravo to the documentation of bea!
    ps, We are using Weblogic 7 with sp1.
    Your help or comments will be appreciated.
    Try the stuff described in:
    http://e-docs.bea.com/wls/docs70/ejb/EJB_environment.html#1151177

    There is no information related to dynamic query finder with relationship caching.

  • 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

  • Dynamic query in where clause while looping in an internal table.

    Hi,
    Had a small question : How can i make a dynamic query for the WHERE clause while looping at an internal table.
    i want to implement a dynamic where clause query for the below example.
    it_cfx_col is an internal table and wa_cfx_col is a work area for it_cfx_col
      DATA :
      i_cfx_col TYPE TABLE OF cfx_col,
      wa_cfx_col LIKE LINE OF i_cfx_col.
    DATA : count TYPE i VALUE 0.
    DATA : l_where_clause TYPE string,
             l_where_clause2 TYPE string,
             l_name type string.
    l_name = 'NANDANOM'.
    l_scenario = 'collaboration'.
    LOOP AT it_cfx_col INTO wa_cfx_col
    WHERE CREATED_BY = l_name
    AND SCENARIO = l_scenario.
    count = count + 1.
    some business logic implemented using the work area wa_cfx_col
    endloop.
    Now i want to write a dynamic query for the where clause.
    DATA : count TYPE i VALUE 0.
      DATA : l_where_clause TYPE string,
             l_where_clause2 TYPE string,
             l_name type string.
    l_name = 'NANDANOM'.
    l_scenario = 'collaboration'.
      l_where_clause = 'CREATED_BY = l_name'.
      l_where_clause2 = 'AND SCENARIO = l_scenario'.
    if l_scenario is not initial.
      CONCATENATE  l_where_clause l_where_clause2
      INTO l_where_clause SEPARATED BY space.
    endif.
    LOOP AT i_cfx_col INTO wa_cfx_col
    WHERE (l_where_clause).
    count = count + 1.
    some business logic implemented using the work area wa_cfx_col
    endloop.
    when i compile this i get an error message as { Statement concluding with "...(l_where_clause)" ended unexpectedly}
    Even i changed the initilization of the variable  l_where_clause2 to [ l_where_clause2 = 'AND SCENARIO = l_scenario.'. ]
    added the end of line demarkation ".", but still i got the same error message.
    Is it a limtation in ABAP that i cannot write a dynamic query for the where clause while looping at an internal table?
    Regards,
    om

    Hi savita,
    there in no such 1 limitaion in abap for dynamic query .. i think the  error meassge is only beacuse of your synatx delcartaion.
    >> LOOP AT i_cfx_col INTO wa_cfx_col
       WHERE (l_where_clause).
       count = count + 1.
    some business logic implemented using the work     area    wa_cfx_col
       endloop.
    afted delclarataion also , in the where statement you should specify both the field name and value bname
       LOOP AT i_cfx_col INTO wa_cfx_col
       WHERE l_where_clause = 'CREATED_BY = l_name' .
       count = count + 1.
    hope it helps.
    regads
    priya.

  • Invoking a web service from dynamic client in weblogic 7

    Is it possible to invoke a webservice from dynamic client in weblogic 7. Because i tried and it doesn't work. But it works with WL 8.1
    I don't see any samples on the net for weblogic 7.

    Hello rss,
    If you want to invoke a web service from a JCD you will have to build the SOAP message using JAX-RPC or AXIS and then programmatically creat an HTTP connection.
    Or you can leverage the HTTP(S) eWay and then you only have to build the SOAP message.
    Or use eInsight. You can import a WSDL into eInsight and eInsight will offer you a business process Activity to invoke the web service operations defined in the WSDL.

  • Dynamic Query

    Dynamic Query
    When I run the following dynamic query in the stored procedure and try to build the report then I get the following error Rep:1401 Fatal PL/SQL error occured, Ora-00936 Missing expression. When I am generating the report standalone using the following query , everything is working fine but in Stored procedure , it's giving me the above error, pls help.
    create or replace package REP_DELIVERY_LOC_STATISTICS is
    TYPE REP_DELIVERY_LOC_STAT_rec IS RECORD(
    p_coordinating_facility_id sis_education_pgm_session.coordinating_facility_id%TYPE,
    p_PSE_MUNICIPALITY_ID pse_education_pgm_session.PSE_MUNICIPALITY_ID%TYPE,
    p_pse_education_pgm_session_id sis_education_pgm_session.pse_education_pgm_session_id%TYPE,
    p_course_session_id course_session.course_session_id%TYPE);
    TYPE REP_DELIVERY_LOC_STAT_cur IS REF CURSOR RETURN REP_DELIVERY_LOC_STAT_rec;
    Type REP_DELIVERY_LOC_STAT_cur_Dyn is REF CURSOR;
    FUNCTION REP_DELIVERY_LOC_STATISTICS(p_college_id IN pse_education_pgm_session.delivery_institution_id%TYPE,
    p_start_date IN pse_education_pgm_session.session_strt_dte%TYPE,
    p_end_date IN pse_education_pgm_session.session_strt_dte%TYPE,
    p_coord_facility_join IN varchar2) return REP_DELIVERY_LOC_STAT_cur_Dyn;
    end REP_DELIVERY_LOC_STATISTICS;
    create or replace package body REP_DELIVERY_LOC_STATISTICS is
    FUNCTION REP_DELIVERY_LOC_STATISTICS(p_college_id IN pse_education_pgm_session.delivery_institution_id%TYPE,
    p_start_date IN pse_education_pgm_session.session_strt_dte%TYPE,
    p_end_date IN pse_education_pgm_session.session_strt_dte%TYPE,
    p_coord_facility_join varchar2) return REP_DELIVERY_LOC_STAT_cur_Dyn IS
    REP_DELIV_LOC_STAT_CUR_Dyn_Q REP_DELIVERY_LOC_STAT_cur_Dyn;
    BEGIN
    OPEN REP_DELIV_LOC_STAT_CUR_Dyn_Q FOR
    'SELECT distinct
    seps.coordinating_facility_id,
    peps.PSE_MUNICIPALITY_ID,
    seps.pse_education_pgm_session_id,
    cs.course_session_id
    FROM pse_education_pgm_session peps,
    sis_education_pgm_session seps,
    course_session cs,
    facility fac,
    desc_sis_reporting_area depa,
    desc_sis_reporting_type dept,
    pse_education_program pep
    WHERE peps.delivery_institution_id (+) = ' || p_college_id
    || ' and peps.session_strt_dte between ' ||p_start_date||' and ' || p_end_date
    || ' and seps.coordinating_facility_id = fac.facility_id (+)
    and seps.pse_education_pgm_session_id (+) = peps.pse_education_pgm_session_id
    and seps.pse_education_pgm_session_id = cs.pse_education_pgm_session_id (+)
    and pep.pse_education_program_id = peps.pse_education_program_id
    and dept.desc_sis_reporting_area_id = depa.desc_sis_reporting_area_id
    and pep.desc_sis_reporting_type_id = dept.desc_sis_reporting_type_id
    and dept.desc_sis_reporting_area_id = depa.desc_sis_reporting_area_id
    and fac.desc_facility_id in (2,3)' || NVL (p_coord_facility_join, '1=1');
    return REP_DELIV_LOC_STAT_CUR_Dyn_Q;
    END;
    end REP_DELIVERY_LOC_STATISTICS;

    I would sugest to grab a book like
    Inside Microsoft SQL Server 2008 T-SQL Querying (chapter 12 - Graphs, Trees, Hierarchies and Recursive Queries) or
    Joe Celko's Trees and Hierarchies in SQL for Smarties to get familiar with how model hierarchies using SQL.
    What is the meaning of the asterisks in the path?
    Here is a dirty example using the Adjacency List model.
    SET NOCOUNT ON;
    USE tempdb;
    GO
    CREATE TABLE dbo.T1 (
    id int NOT NULL UNIQUE CLUSTERED,
    name varchar(50),
    rootid int NULL
    INSERT INTO dbo.T1 (id,name,rootid)
    SELECT 1, 'animals', NULL
    UNION ALL
    SELECT 2, 'mamal', 1
    UNION ALL
    SELECT 3, 'cephalopod mollusc', 1
    UNION ALL
    SELECT 4, 'salt water fish', 1
    UNION ALL
    SELECT 5, 'fresh water fish', 1
    UNION ALL
    SELECT 6,'whale', 2
    UNION ALL
    SELECT 7,'pirana', 5
    UNION
    SELECT 8,'shark', 4
    UNION
    SELECT 9, 'octopus', 3;
    GO
    WITH Tree AS (
    SELECT
    id, name, rootid,
    CAST('/' + [name] + '/' AS varchar(900)) AS mat_path
    FROM
    dbo.T1
    WHERE
    rootid IS NULL
    UNION ALL
    SELECT
    C.id, C.name, C.rootid, CAST(P.mat_path + C.name + '/' AS varchar(900))
    FROM
    Tree AS P
    INNER JOIN
    dbo.T1 AS C
    ON P.id = C.rootid
    SELECT
    FROM
    Tree
    ORDER BY
    mat_path;
    GO
    DROP TABLE dbo.T1;
    GO
    Excuse my poor knowledge of zoology or animal biology.
    AMB
    Some guidelines for posting questions...
    AYÚDANOS A AYUDARTE, guía básica de consejos para formular preguntas

  • How to create an LOV based on a dynamic query

    Hi,
    Can someone tell me how to query a dynamic query for LOV. On my base page I have a dropdown-box (that will show the table names for searching) and is dynamically populated based on users access e.g. if user A logs in he may see 5 values (these values are basically table names) in a drop down if user B logs in he may see 10 values. I also have two input fields one field a user can enter value and the other field is read only and a torch icon for LOV so the user can search and select values that are populated in the input fields on the base page.
    How can I have my LOV that takes in a value selected in the dropdown and anyvalue entered in one of the input fields and search in the table selected in the dropdown box.
    Basically my LOV should do a search on the table and some search value passed when clicking on the torch icon. So a user can select any table-name in the drop down and my LOV should do a search only on the selected table. Once on the LOV Popup want to have a search field there but it only searched on the table selected in the dropdown on the based page. And the selected value on the LOV Popup page gets populated in fields on the base page.
    Any help is appreciated.
    Thanks

    Hi,
    I have created 4 SQL Based VO's with the following sqls
    SELECT header_id AS ID, to_char(order_number) AS NAME
      FROM oe_order_headers_all
    SELECT party_id AS ID, party_name AS NAME
      FROM hz_parties
    SELECT quote_header_id AS ID,
           (quote_number || CHR (45) || quote_version) AS NAME
      FROM aso_quote_headers
    SELECT sales_lead_id AS ID, to_char(lead_number) AS NAME
      FROM as_sales_leadsI created on LOVRegin and have the following 2 messagestyle items now what do I set in the ViewInstance and View Attribute fields
    srcid
    srcname
    Can you provide some sample code to set ViewUsage and whereclause that I need to put in the controller of LOVRegion.
    Thanks

  • Dynamic Query Doubt

    Hi,
    I need to write a Dynamic Query to get the data from the table by using the Input date parameters.
    LIke,
    SELECT* from table where date_start between to_date('12-14-2004','mm-dd-yyyy') AND
    to_date('12-15-2005','mm-dd-yyyy');
    How can i write the above query in dynamic sql as i will get the two dates as input in my procedure
    Help me in this

    Or more preferably use bind variables with the
    EXECUTE IMMEDIATE as, if the query will be called
    many times, the bind variables will prevent hard
    parsing of the statement each time (i.e. it will be
    quicker to execute).blushadow,
    Yes, the execute immediate using bind variables is better/faster than not using bind variables, but your first example outperforms your second one. This is due to the fact that execute immediate really closes all cursors, and in your first example the cursors are kept open (yes, even though you issue a CLOSE cur_test) in the PL/SQL cursor cache.
    SQL> create table i_links
      2  as
      3  select sysdate - l linkdate from (select level l from dual connect by level <= 10000)
      4  /
    Tabel is aangemaakt.
    SQL> exec dbms_stats.gather_table_stats(user,'I_LINKS')
    PL/SQL-procedure is geslaagd.
    SQL> create or replace procedure test1 (start_date in date, end_date in date) as
      2    CURSOR cur_test IS
      3      SELECT count(*)
      4      FROM   i_links
      5      WHERE  linkdate BETWEEN start_date AND end_date;
      6    v_count NUMBER;
      7  begin
      8    OPEN cur_test;
      9    FETCH cur_test INTO v_count;
    10    CLOSE cur_test;
    11    --DBMS_OUTPUT.PUT_LINE('Count: '||v_count);
    12  end;
    13  /
    Procedure is aangemaakt.
    SQL> create or replace procedure test2 (start_date in date, end_date in date) as
      2    v_count NUMBER;
      3  begin
      4    EXECUTE IMMEDIATE 'SELECT count(*) FROM i_links WHERE linkdate BETWEEN :x1 AND :x2' INTO v_count USING start_date, end_date;
      5    --DBMS_OUTPUT.PUT_LINE('Count: '||v_count);
      6  end;
      7  /
    Procedure is aangemaakt.
    SQL> begin
      2    -- warm up
      3    test1(sysdate-365,sysdate);
      4    test2(sysdate-365,sysdate);
      5    -- begin test
      6    runstats_pkg.rs_start;
      7    for i in 1..1000
      8    loop
      9      test1(sysdate-365,sysdate);
    10    end loop;
    11    runstats_pkg.rs_middle;
    12    for i in 1..1000
    13    loop
    14      test2(sysdate-365,sysdate);
    15    end loop;
    16    runstats_pkg.rs_stop(100);
    17  end;
    18  /
    Run1 draaide in 341 hsecs
    Run2 draaide in 348 hsecs
    Run1 draaide in 97,99% van de tijd
    Naam                                                    Run1      Run2  Verschil
    STAT.session cursor cache hits                             0       998       998
    STAT.opened cursors cumulative                             0     1,000     1,000
    STAT.parse count (total)                                   0     1,000     1,000
    LATCH.shared pool                                      1,047     3,043     1,996
    STAT.recursive calls                                   3,001     1,001    -2,000
    LATCH.library cache pin allocation                         8     2,011     2,003
    LATCH.library cache pin 2,048 6,044 3,996
    LATCH.library cache 2,056 6,060 4,004
    Run1 latches totaal versus run2 -- verschil en percentage
          Run1      Run2  Verschil     Pct
        48,522    60,548    12,026  80.14%
    PL/SQL-procedure is geslaagd.Regards,
    Rob.

  • 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

Maybe you are looking for

  • Can I have more than one album art Image displayed on ipod per song?

    Can someone help? My issue is that in itunes I can add more than one image (album art) to an individual song. While it's playing, in the display album art (bottom left corner) I can flick through all the images a particular song contains. I got exict

  • Error creating RFx in SRM 7.0

    Hi all, When creating a new RFx in SRM, I am getting the following error message: "No status object is available for " This occurs when I try to add a bidder, which is also not added to the list. Does anyone knows why this may occur? Thanks in advanc

  • How to access another control in a page in another xaml file?

    I have a XAML page name GameMainSP.xaml. Can I access a control in that page from a module in the project? I was only trying to change a text block controls Text property. Is this possible? Once you eliminate the impossible, whatever remains, no matt

  • RTPExport problem

    Hi, I'm a newbie to JMF and how to handle media file stream over RTP. What I need to do now is to receive a media stream from RTP, then play it and save it to a file at the same time. I have read throught the example and explanation on the Java Sun w

  • PO Email Notification

    Hi, Can any one give me the program name that is scheduled to run in R/3 after the PO is released, to send an email notification with the URL to the SUS supplier? Thanks, Aakash