Long query on Forms

Hello
I have a datablock, whose datasource is a view (sourceType = 'table'; sourcename =viewName).
All of the datablock items are database items (no calculations, etc..)
The ORDER BY clause has pre-defined values ("date field" DESC)
The default_where property is built in the form's code.
Problem is: if the number of records retrieved is low (a few hundred), the form works fine; if is big, it takes a long time to execute the block's query.
Now, I tried to Optimizer_HInts = 'FIRST_ROWS', and both query_Array_Size and Records_Buffered = 50.
The time used to retrieve data remains high (for the user seems the form "hangs"), and when the data is shown, it is pretty fast to scroll past the data.
Isn't it true that, if the datablock was retrieving 50 records each time, the scrolling would take a bit longer?
My goal is to make the query to execute faster, even if I get less records each time...
I'm using Oracle Forms 10g on Oracle database 10g
Thanks for any help

Hello,
At first sight, this seems to be a Database modelisation issue. I don't think that Forms would go faster, until you correct the problem in the database. See the whole SQL order generated then check your indexes.
Francois

Similar Messages

  • I need to pass a query in form of string to DBMS_XMLQUERY.GETXML package...the parameters to the query are date and varchar ..please help me..

    I need to pass a query in form of string to DBMS_XMLQUERY.GETXML package...the parameters to the query are date and varchar ..please help me build the string .Below is the query and the out put. ( the string is building fine except the parameters are with out quotes)
    here is the procedure
    create or replace
    procedure temp(
        P_MTR_ID VARCHAR2,
        P_FROM_DATE    IN DATE ,
        P_THROUGH_DATE IN DATE ) AS
        L_XML CLOB;
        l_query VARCHAR2(2000);
    BEGIN
    l_query:=  'SELECT
        a.s_datetime DATETIME,
        a.downdate Ending_date,
        a.downtime Ending_time,
        TO_CHAR(ROUND(a.downusage,3),''9999999.000'') kWh_Usage,
        TO_CHAR(ROUND(a.downcost,2),''$9,999,999.00'') kWh_cost,
        TO_CHAR(ROUND(B.DOWNUSAGE,3),''9999999.000'') KVARH
      FROM
        (SELECT s_datetime + .000011574 s_datetime,
          TO_CHAR(S_DATETIME ,''mm/dd/yyyy'') DOWNDATE,
          DECODE(TO_CHAR(s_datetime+.000011574 ,''hh24:'
          ||'mi''), ''00:'
          ||'00'',''24:'
          ||'00'', TO_CHAR(s_datetime+.000011574,''hh24:'
          ||'mi'')) downtime,
          s_usage downusage,
          s_cost downcost
        FROM summary_qtrhour
        WHERE s_mtrid = '
        ||P_MTR_ID||
       ' AND s_mtrch   = ''1''
        AND s_datetime BETWEEN TO_DATE('
        ||P_FROM_DATE||
        ',''DD-MON-YY'') AND (TO_DATE('
        ||P_THROUGH_DATE||
        ',''DD-MON-YY'') + 1)
        ) a,
        (SELECT s_datetime + .000011574 s_datetime,
          s_usage downusage
        FROM summary_qtrhour
        WHERE s_mtrid = '
        ||P_MTR_ID||
        ' AND s_mtrch   = ''2''
        AND s_datetime BETWEEN TO_DATE('
        ||P_FROM_DATE||
        ',''DD-MON-YY'') AND (TO_DATE('
        ||P_THROUGH_DATE||
        ','' DD-MON-YY'') + 1)
        ) B
      where a.S_DATETIME = B.S_DATETIME(+)';
    SELECT DBMS_XMLQUERY.GETXML('L_QUERY') INTO L_XML   FROM DUAL;
    INSERT INTO NK VALUES (L_XML);
    DBMS_OUTPUT.PUT_LINE('L_QUERY IS :'||L_QUERY);
    END;
    OUTPUT parameters are in bold (the issue is they are coming without single quotes otherwise th equery is fine
    L_QUERY IS :SELECT
        a.s_datetime DATETIME,
        a.downdate Ending_date,
        a.downtime Ending_time,
        TO_CHAR(ROUND(a.downusage,3),'9999999.000') kWh_Usage,
        TO_CHAR(ROUND(a.downcost,2),'$9,999,999.00') kWh_cost,
        TO_CHAR(ROUND(B.DOWNUSAGE,3),'9999999.000') KVARH
      FROM
        (SELECT s_datetime + .000011574 s_datetime,
          TO_CHAR(S_DATETIME ,'mm/dd/yyyy') DOWNDATE,
          DECODE(TO_CHAR(s_datetime+.000011574 ,'hh24:mi'), '00:00','24:00', TO_CHAR(s_datetime+.000011574,'hh24:mi')) downtime,
          s_usage downusage,
          s_cost downcost
        FROM summary_qtrhour
        WHERE s_mtrid = N3165 AND s_mtrch   = '1'
        AND s_datetime BETWEEN TO_DATE(01-JAN-13,'DD-MON-YY') AND (TO_DATE(31-JAN-13,'DD-MON-YY') + 1)
        ) a,
        (SELECT s_datetime + .000011574 s_datetime,
          s_usage downusage
        FROM summary_qtrhour
        WHERE s_mtrid = N3165 AND s_mtrch   = '2'
        AND s_datetime BETWEEN TO_DATE(01-JAN-13,'DD-MON-YY') AND (TO_DATE(31-JAN-13,' DD-MON-YY') + 1)
        ) B
      where a.S_DATETIME = B.S_DATETIME(+)

    The correct way to handle this is to use bind variables.
    And use DBMS_XMLGEN instead of DBMS_XMLQUERY :
    create or replace procedure temp (
      p_mtr_id       in varchar2
    , p_from_date    in date
    , p_through_date in date
    is
      l_xml   CLOB;
      l_query VARCHAR2(2000);
      l_ctx   dbms_xmlgen.ctxHandle;
    begin
      l_query:=  'SELECT
        a.s_datetime DATETIME,
        a.downdate Ending_date,
        a.downtime Ending_time,
        TO_CHAR(ROUND(a.downusage,3),''9999999.000'') kWh_Usage,
        TO_CHAR(ROUND(a.downcost,2),''$9,999,999.00'') kWh_cost,
        TO_CHAR(ROUND(B.DOWNUSAGE,3),''9999999.000'') KVARH
      FROM
        (SELECT s_datetime + .000011574 s_datetime,
          TO_CHAR(S_DATETIME ,''mm/dd/yyyy'') DOWNDATE,
          DECODE(TO_CHAR(s_datetime+.000011574 ,''hh24:'
          ||'mi''), ''00:'
          ||'00'',''24:'
          ||'00'', TO_CHAR(s_datetime+.000011574,''hh24:'
          ||'mi'')) downtime,
          s_usage downusage,
          s_cost downcost
        FROM summary_qtrhour
        WHERE s_mtrid = :P_MTR_ID
        AND s_mtrch   = ''1''
        AND s_datetime BETWEEN TO_DATE(:P_FROM_DATE,''DD-MON-YY'')
                           AND (TO_DATE(:P_THROUGH_DATE,''DD-MON-YY'') + 1)
        ) a,
        (SELECT s_datetime + .000011574 s_datetime,
          s_usage downusage
        FROM summary_qtrhour
        WHERE s_mtrid = :P_MTR_ID
        AND s_mtrch   = ''2''
        AND s_datetime BETWEEN TO_DATE(:P_FROM_DATE,''DD-MON-YY'')
                           AND (TO_DATE(:P_THROUGH_DATE,'' DD-MON-YY'') + 1)
        ) B
      where a.S_DATETIME = B.S_DATETIME(+)';
      l_ctx := dbms_xmlgen.newContext(l_query);
      dbms_xmlgen.setBindValue(l_ctx, 'P_MTR_ID', p_mtr_id);
      dbms_xmlgen.setBindValue(l_ctx, 'P_FROM_DATE', to_char(p_from_date, 'DD-MON-YY'));
      dbms_xmlgen.setBindValue(l_ctx, 'P_THROUGH_DATE', to_char(p_through_date, 'DD-MON-YY'));
      l_xml := dbms_xmlgen.getXML(l_ctx);
      dbms_xmlgen.closeContext(l_ctx);
      insert into nk values (l_xml);
    end;

  • Is there a time limit for how long a free form can be used/accessed?

    Is there a time limit for how long a free form that is created can be used/accessed, or is it soely dependent upon when the 50 respondent max has been reached?  I am creating a form now, that will likely be distributed in early January, and I want it to be accessible through the end of June, 2013.  (I am simply using the option to create a single form for free- not the 30-day trial). 

    There is no time limit. The limit is the 50 responses.

  • How to Implement KFF Range (Low and High) in query find form in oracle apps

    Hi,
    Please provide some sample script for using KFF range LOV (Low and High) in one of the query find form in Oracle apps R12.
    I need to customize one of the standard form and add this range functionality for that search form.
    Thanks,
    Prasanna

    Yuvaraaj,
    Your request is unique to the Oracle Enterprise Business Suite (EBS). Please post your question in the General EBS Discussion forum. If you have a general Forms question, by all means, ask it here! ;-)
    Craig...

  • How to run recordset SQL query in FORM DATA event

    How can I run recordset SQL query in FORM DATA event upon clicking on Add button in the document?

    Hi Slamet,
    When you receive a form data event you have a class containing inside it a ObjectKeys xml info regarding the object added/modified,...
    With the objects keys you can then use the DI API method called GetByKeys to obtain the DI Object.
    There is some information about it in the SDK Help file, mainly in the "FormDataEvent" class definition:
    <i>The event provides the unique ID (BusinessObjectInfo.ObjectKey) of the modified business object. You can use the value of this property as an input parameter in the DI API DataBrowser.GetByKeys method to get a DI object.</i>
    Pay attention you don't have this information in the Before=True event of the Add as it is not yet in the database.
    Hope it helps
    Trinidad.

  • Long Query Runtime/Web-template Loading time

    Hi,
    We are having a very critical performance issue, i.e. long query runtime, which is certainly not acceptable by client as well.
    <b>Background Information</b>
    We are using web application designer (WAD) 2004s release to design front end of our reports built in BI 7.0 system.
    <b>Problem Area</b>
    Loading of web template on browser
    <b>Problem Analysis</b>
    Query taking so long time to run, whenever we load it through portal or even directly through web application designer. Current runtime for query is more than a min. And I have noticed that 95% of runtime is taken for loading variable screen. FYI – if I run query through Query Designer or BEx Analyzer, it takes 3-5 seconds to execute.
    We have taken all the statistics and everything proves that query is not taking any time to execute but it’s the loading time which creates bottle neck.
    <b>Possible Cause</b>
    Web template holding 11 data providers, 5 of which are based on queries and rest are on query views. These data providers load into memory in parallel which could cause delay.
    These data providers expose detailed variable screens. Out of 21 input fields, exposed by web template, 8 fields are based on hierarchy node variables and 1 on hierarchy variable. And to my knowledge each time hierarchy/hierarchy node variable loads complete hierarchy into memory whenever they are called (in other words, its not performance efficient to use hierarchies).
    I request you to please consider this as matter of high priority and provide me with suggestions to remove bottle necks and make the application performance efficient. Please let me know, if you need any further information.
    Thanks.
    Shabbar

    I would recommend you see how long the query execution actually takes without running from the web template. If actually the individual query takes long time then you need to do some performance improvement on back-end side (aggregates, indexing,... and so on).
    But the performance issue is only with web templates, then you need to find some notes on it, because, I remember we had to apply some notes in relations  of browser taking too long time to load the selection screen in web reports.
    After exhausting all the option, then I will implement precalculating the query result before hand using broadcaster.
    thanks.
    Wond

  • From Clause query with form variables

    forms 9.0.4 rdbms 9.2
    Is it possible to create a From Clause query with form variables generated from another block (but in the same form)? I am not having any success.
    I searched Metalink. It appears that according to DOC ID # 69884.1, in Forms 6i, this is not possible. Metalink suggest in DOC ID 104771.1 implementating a dynamic From Clause, but when I duplicate the example on my system, I receive an Oracle error. Further investigation from the web form (DISPLAY ERROR) indicates that the system does not see the dynamic value.
    Has anyone else run into this error? Has this been fixed in forms 9.0.4 and I am just missing something? Does a dynamic from clause query work? Can anyone point me to an example or post an example or offer any advise.
    thanks in advance

    As far as I know it is not possible to use block items in a from clause query in forms 9.0.4. Here is my solution for a From-Clause-Query via the 'Query-Data-Source-Name-Property':
    To use the values of the block items in my from clause query I implemented a database package with getter and setter routines for the block item values I needed for the query.
    In the Key-Exeqry-Trigger of the From-Clause-Query-Block I set the global package variables with values of the block-items I am interested in. In the From-Clause-Query I used the values in the where-clause via package functions which return the global package variables.
    Hope my solution will work for your problem.

  • Query Builder Form Hide

    Hi Guys,
    I am working on a requirement for manage attachment functionality. But I am facing one issue in one scenario.
    From Manage attachment screen, User clicks on Search From Repository and in search page there are some default or hidden fields. Like where author is match with the login user and etc. For Expanded form there is no issue. All the hidden fields are not coming and search result is coming fine. But if user changes to Query Builder Form and manually modify the query then user can see all the content.
    So I want to stop the user to show the Query Builder form by which he/she could not modify the query and search. Is there any process by which we can hide the Query Builder Form?
    I have seen one Jonathan blog: https://jonathanhult.com/blog/2012/06/remove-fields-from-query-builder-search-form/
    But I would like to full hide the form.
    Thanks in advance.
    Regards,
    Santanu

    Hi Guys,
    As part of the above solution  (DisabledSearchFormTypes=queryBuilder), the query builder form will never appear. Which is not a good practice.
    Because for development this is very useful.
    My intention was to stop the user access Query builder Form only in Manage attachment screen.
    So I have created one custom component which will override the resource : query_page_menus_setup and check the xIdcProfile value.
    If IdcProfile is PSFTProfile or EBSProfile then it will not appear.
    <$exec rsAppendNewRow("PageMenusData")$>
    <$PageMenusData.nodeId = "QUERY_BUILDER_FORM"$>
    <$PageMenusData.parentId = "SEARCH_FORMS"$>
    <$PageMenusData.label = "wwQueryBuilderActionLabel"$>
    <$PageMenusData.type = "item"$>
    <$if #active.dpDisplayLabel like ("EBSProfile|PSFTProfile")$> 
    <$else$>
    <$PageMenusData.href = "javascript:switchQueryForm('queryBuilder')"$>
    <$endif$>
    I think this is really good.

  • Query find form - customized search on a date field

    Hi All,
    I have a form which has query find behaviour enabled. When the user press on the search(torch light button) The query find form gets opened in a new canvas.
    I have a date field on the query find form. The current functionality is that
    "The form searches for the exact match on the date" but I want to have the results which satisfy <= "entered date".
    How do I achieve it in Query find form.
    Do I need to have the where condition appended in the Pre-Query on the results data block.
    Please help me with an example. Thank you.
    Srinivasa Mouli
    Edited by: 889427 on 4 Oct, 2011 11:43 AM

    Short of adding your own query extensions, you must pass in a Date
    parameter vs some stringified version.
    Paresh wrote:
    I want to query on a date field as follows
    "createDate < '2003-08-20 12:00:00:000' "
    createDate has DataType java.util.Date
    When I try to execute this query it throws UserException.
    If I use a parameter in the query string and pass a date object to execute
    method then it works fine.
    I just want to make sure that there in no way I can make the first
    approach work
    Steve Kim
    [email protected]
    SolarMetric Inc.
    http://www.solarmetric.com

  • Difficulty in querying a form

    hii all
    i have a form on which i have a customer_name field
    it is a non database field
    i am getting the value of the customer_name field from customer id .
    but the customer _id field is not on the form
    i want to query the form based on the customer name
    like in the customer_name field i would query 'm%'
    but customer_name being non database it is not allowing me to query
    please help me to query it if it is possible
    thanks in advance
    Message was edited by:
    bindok mulga

    Hi,
    If U want in Sql Write the query like this :
    Select * from Table_Name Where Customer_Name Like 'M%';
    Other Wise If U want On Customer_Name Text Write The Query In Post text item of the Customer_Name Like:
    I Hope Table Name Is Customer_Dir ,?
    Declare
    Result Number;     
    M_Red_Color Varchar2(100) := Get_Item_Instance_Property(:System.Current_Block||'.'||:System.Current_Item, Current_Record, Visual_Attribute);
    Begin     
         If :Customer_Dir.Customer_Name is not null then
    :Customer_Dir.Customer_Name := Ltrim(:Customer_Dir.Customer_Name);
         Begin
         Select Customer_Cd Into :Customer_Dir.Customer_Cd
         From Customer_Dir
         Where Customer_Name= :Customer_Dir.Customer_Name;
    <<M_LOOP>>
    Loop
    Bscil.Show_Message('Bscil_stop', 'Entry ' ||:Customer_Dir.Customer_Name || ' Does Not Exist. (Please check your entry) ', Null, 'Ok', Null, Null, Result);
    If Result = Alert_Button1 Then
         Bscil.Set_Item_Color(:System.Current_Block||'.'||:System.Current_Item, 'RED_COLOR');
         Raise Form_Trigger_Failure;
    Exit M_Loop;
    End If;
    End Loop;      
    Exception
         When No_Data_Found Then Null;
    End;
         Else
              :Customer_Dir.Customer_Cd := Null;
              End if;
    If M_Red_Color = 'RED_COLOR' Then
    Bscil.Set_Item_Color(:System.Current_Block||'.'||:System.Current_Item, 'WHITE_COLOR');
    End If;
    End;

  • Problem while querying a form

    hi,
    if i query my form with wrong value ie, press F7 give wrong value for EMPNO and press F8. it says Query caused no records to be retrieved. but after that its not coming out of the first row.
    if i press cancel button, the cursor remains in the first record itself.
    i have written      exit_form(NO_VALIDATE) in exit button.
    pls give me solution for this problem.
    Thanks in advance.

    add this code to the exit button .
    BEGIN
    --come of of the enter-query mode
    IF :SYSTEM.MODE = 'ENTER-QUERY' THEN
       EXIT_FORM(NO_VALIDATE);
    END IF;
      --exit the form
    EXIT_FORM(NO_VALIDATE);
    END;you need 2 exit, one if the system is in enter-query mode, to come out of it and the other one for exiting the form.

  • Query Builder Form

    Hi all,
    I built a simple query builder form:
    <cfif IsDefined('form.query')>
    <cfquery name="queryDemo" datasource="TestProduction">
    #form.goQuery#
    </cfquery>
    </cfif>
    FORM
    <ul>
    <cfform name="QueryForm" action="" method="post">
    <li><label>Type Query</label></li>
    <li><cftextarea name="goQuery" cols="100" rows="6"></cftextarea></li>
    <li><cfinput name="query" type="submit" value="Run Query"/></li>
    </cfform>
    </ul>
    <cfif IsDefined('form.query') and queryDemo.recordCount gt 0>
    <cfform action="" name="resultsForm">
    <cfgrid query="queryDemo" griddataalign="center" name="QueryResults" width="700" autowidth="yes" height="700">
    </cfgrid>
    </cfform>
    </cfif>
    When I run a "where" clause such as where type = 'LCR', I get an error. Has anyone tried this before? Please provide insight.
    Thanks.

    Error Code:
    Error Executing Database Query.
    [Macromedia][SQLServer JDBC Driver][SQLServer]Incorrect syntax near 'LCR'.
    The error occurred in C:\inetpub\wwwroot\cfAttica\betaFiles\queryDemo.cfm: line 3
    1 : <cfif IsDefined('form.query')>
    2 : <cfquery name="queryDemo" datasource="TestProduction">
    3 : #form.goQuery#
    4 : </cfquery>
    5 : </cfif>
    VENDORERRORCODE
      102
    SQLSTATE
      HY000
    SQL
      select item from tlkp_item where type = ''LCR''
    DATASOURCE
      TestProduction
    Resources:

  • Problem in querying the form?

    hi everybody ,this group have helped me alot to understand the things better. i have created a form with template .fmb . and i have modified standard apps functionality of saving the form with the standard save button on the toolbar.
    now if i have two previous record with the name sunny and employee no 105 and 106 respectively and if i will press f11 and edit one of the records and make sunny and 107 and press save : it will insert a new row.
    now after that if i will press f11 and then query the form using ctrl-f11. then i am getting first two records:sunny 105 and sunny 106. i am not getting sunny 107 but this record has been inserted into the database.
    kindly let me know what can be the cause?what i can see this is beacuse of some property of the block because i have created a test form and its working fine there.
    so please help me fast as i dont have the time for RnD.
    thanks.

    Hi,
    This isn't R&D but the humble task of fixing your own code.
    Have you checked wether record no 107 is in the database (by means of SQL*Plus/Toad)
    If NO (insert is the problem)
    Check wether there is an on-insert trigger redefining de insert action. Or maybe there's you're inserting a view with an in-stead-of-trigger
    if YES (retrieval is the problem)
    Make all item except one 'non database items' and check wether you can retrieve the record. If you can, make the 'non database items' one by one 'database enabled'. In this way you see which item causes the problem.
    Matthieu

  • Since loading Lion I can no longer burn photos form iPhoto on a dvd for archive purposes

    Since loading Lion on my MacBook Pro, I can no longer burn photos form iphoto for archarving purposes.  I used to load the dvd and it would showup on the screen then drag highlighted photos onto the dvd.  Now, dvd only shows up sometimes and when it does, it tells me the new disk is full.  How can such an easy task become obsolete with this update.   I have also tried using idvd for archiving purposes but this process will only allow viewing.  I want to be able to reload photos back onto the computer at a later date.

    I habe the same problem and cant find a helpful post on the web!
    How can i get it back to work???

  • Execute Query on form opening

    Hi,
    I am developing an application....in that application I have two forms...one is Form A and the other one is Form B ...
    Scenario Is ...Form A has a detail block with the fields like VOUCHERNO, DATE, AMOUNT. I want user to double click on FORM A'S detail block and it should pick that VOUCHERNO (read in global variable ..ive done this already) ...and on FORM 'B' which is a voucher maintenance form...contains that VOUCHER'S MASTER BLOCK and VOUCHER DETAIL BLOCK...fill that voucher no from global variable and automatically EXECUTE QUERY to bring the details of that voucher in form b's detail block.
    My problem is that on NEW FORM INSTANCE of form B ive checked the record status its 'NEW' ..whenever I move the global variable value in voucher no for Form B to execute query it says WANT TO SAVE CHANGES ? YES NO CANCEL...even though I've used clear_form(no_validate)...ive used ENTER_QUERY also...but the problem is remain the same...please help and tell me how to do this. Thanks

    create a PRE QUERY in Form B. There you use the global-variable
    use the query-technique of my one-time-timer http://talk2gerd.blogspot.com/2007/01/one-time-timer.html
    PRE QUERY:
    BEGIN
      IF :global.nameOFglobal IS NOT NULL THEN
        :EMP.ENAME := :global.nameOFglobal;
      END IF;
    END;try it
    Gerd

Maybe you are looking for

  • Creation of Correction Request against Credit memo

    I would like to know if it is possible to create an request of type RK against an Credit billing of type G2? Thanks Lina

  • Ios 6 Wi-Fi GLITCH A WEB PROBLEM

    I Have IOS 6 on my Ipod touch and i can't connect to the internet and i need to know when is apple planning to fix the problem source: http://www.networkworld.com/news/2012/092012-ios6-wifi-262619.html?t51hb&hpg1=mp

  • New LiveUpdate NVIDIA drivers posted

    MSI seems to finally have added versions 61.72 and 61.76 of the nvidia geforce fx graphics drivers on their "live update" software. But the download doesn't work (at least for me)...just gives a cryptic IP error. Anyone else seeing this?

  • [SOLVED] Battery charge percentage reports as 0% in xmobar

    I have an ASUS U36JC laptop running Arch. I'm using xmobar to display information about the battery charge. The estimated remaining lifetime in hours reports correctly, but the charge percentage always reports at 0%. The charge level is reported corr

  • Stock upload (RG23D)

    Hi, Edited by: Mahesh on Jan 5, 2009 2:24 PM