Query by exmaple in Apex 3.1

Does Apex 3.1 support query by example? Does Apex 3.1 have query possibilities like Oracle Forms do?
Tnx, in advance.
Dejan

Dejan,
I appreciate your enthusiasm but you need to slow down a bit. Sending you all the examples I have is out of the question. I can give you an example, which I have below. You can take that and work with it to get where you need to be. Here is one of my functions that returns a SQL string.
create or replace
FUNCTION          "SQL_IP_SUBNET" (
p_octet1 in varchar2,
p_octet2 in varchar2,
p_octet3 in varchar2,
p_octet4 in varchar2,
p_slash in varchar2,
p_status in varchar2)
return varchar2
as
l_select varchar2(1000);
l_octet1 varchar2(200);
l_octet2 varchar2(200);
l_octet3 varchar2(200);
l_octet4 varchar2(200);
l_slash varchar2(200);
l_status varchar2(200);
l_cidr varchar2(50);
l_where varchar2(1000);
l_order_by varchar2(100);
l_sql varchar2(32767);
begin
l_select := q'!select id, get_ip_addr(octet1, octet2, octet3, octet4) ip_addr, slash, description, !';
l_select := l_select || q'! octet1, octet2, octet3, octet4 from poc_subnets where 1=1!';
if (p_octet1 is not null) then
l_octet1 := q'! and octet1=!' || p_octet1;
end if;
if (p_octet2 is not null) then
l_octet2 := q'! and octet2=!' || p_octet2;
end if;
if (p_octet3 is not null) then
l_octet3 := q'! and octet3=!' || p_octet3;
end if;
if (p_octet4 is not null) then
l_octet4 := q'! and octet4=!' || p_octet4;
end if;
if (p_slash is not null) then
if substr(p_slash,1,1) != '/' and length(p_slash) = 2 then
  l_cidr := '/'||p_slash;
else
  l_cidr := p_slash;
end if;
l_slash := q'! and slash='!' || l_cidr || q'!'!';
end if;
if length(l_octet1) > 0 then
l_where := l_octet1;
end if;
if length(l_octet2) > 0 then
l_where := l_where || l_octet2;
end if;
if length(l_octet3) > 0 then
l_where := l_where || l_octet3;
end if;
if length(l_octet4) > 0 then
l_where := l_where || l_octet4;
end if;
if length(l_slash) > 0 then
l_where := l_where || l_slash;
end if;
if length(p_status) > 0 then
case
  when p_status = 'YES' then
   l_status := q'! and assigned = 'YES'!';
  when p_status = 'NO' then
   l_status := q'! and assigned = 'NO'!';
  else
   l_status := null;
end case;
end if;
if length(l_status) > 0 then
l_where := l_where || l_status;
end if;
-- do the order by clause
l_order_by := q'! order by octet1, octet2, octet3, octet4!';
if length(l_where) > 0 then
l_sql := l_select||l_where||l_order_by;
else
l_sql := l_select||l_order_by;
end if;
return l_sql;
end sql_ip_subnet;I'm assuming you're familiar with creating and using functions in Oracle. The important thing to realize is that each of the parameters passed into the function are going to be an item on your page. So the call to the function in the report region source looks something like this:
declare
l_sql varchar2(4000);
begin
l_sql := sql_ip_subnet(:P1_OCTET1, :P1_OCTET2, ....);
return l_sql;
end;If you would like to see an example application I would be glad to post one on the apex.oracle.com workspace so you can see it. Just give me a day to put it together there and I'll let you know when it's ready.
Earl

Similar Messages

  • Create a query builder in oracle Apex

    Hi
    We have a request to create a query builder in oracle Apex particularly.But it provide the application builder and Utilities when we create the apex workspace.My question is any possibility are to make the application builder and utilizes as invisible
    regards
    apexuser

    hi scott,
    we no need to buid a report.we want generate a sql query using GUI drag and drop query builder.
    our suggestion is provide synonym for all objects and give to clinet,but in apex query builder only show view and table...
    it not show synonym thats the problem..
    simply we want oracle query browser.just want build a query.through synonym schema.
    we cerate a oracle user and provide synonym for live tables.then we provide the synonym user to client place,so they want build a query simpl.
    they dont have sql knowledge.
    regards
    apexuser

  • Querying EBS data from APEX through PL/SQL process

    Hi all,
    I have read through http://www.oracle.com/technetwork/developer-tools/apex/apex-ebs-wp-cabot-consulting-169064.pdf
    and    http://www.oracle.com/technetwork/developer-tools/apex/learnmore/apex-ebs-extension-white-paper-345780.pdf
    But I still do not have much idea on how do I query for data from ebs. What I am trying to achieve is to query for a table in EBS and put the data as a httpresponse
    then parse the data using javascript by creating a html region in APEX.
    Previously, I was creating an application process in the following manner
    declare
    element_List varchar2(4000) := '';
    begin
    begin
    for i in (select END_MEASURE from SCS_ELEMENT_DATA where ATTRIBUTE10 = :P9_ASSET_ID) loop
    element_List := element_List || i.END_MEASURE || ' ';
    end loop;
    exception when no_data_found then null;
    end;
    htp.prn(element_List);
    end;
    My table structure in EBS is something like this:
    XXEAM_LAM_ELEMENTS (lam_element_id, csi_instance_id, element_name, element_desc, label, type, continuous, reference, shared, start_measure, end_measure, lat_long)
    Would appreciate any advice as I'm new to both APEX and EBS.

    Hi Scott and Tom,
    Sorry about this.
    My Apex is installed in the same instance as my EBS. I assume this means they are in the same DB? So if this is the case, can I just query with the EBS table name and the APEX application will know its EBS table and not APEX table?
    Because previously my query was based on APEX tables and now I have query based on my EBS table using an APEX application process. I couldn't really understand what's needed even after looking through the whitepaper. I do not need to create a view/report based on the queried data because my APEX page only has a HTML region where I put all my javascript code in.
    Hope this is clearer. Sorry for not being clear on my issue.
    Regards,
    CS

  • How to pass a value to a bind variable in a query report in oracle apex

    Hi Guys,
    I have requirement to send weekly reports via email to some users. The users should receive their own records in the report. The user details is stored in a table. What I am planning to do is to create a report query in oracle apex to generate the report and then run a function/procedure via a scheduler to email the report to respective users. Now my query is ............. is it possible to pass a value (user name) to the report query to pull records of only that user? I know we can have bind variables in the report query but I have no idea how to pass a value for bind variables from a function/procedure.
    Can anyone help me on this issue or suggest a better approach?
    Thanks,
    San

    You need to use dynamic sql
    But please keep in mind that since you're using Oracle you may be better off posting this in some Oracle forums
    This forum is specifically for SQL Server
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • Report query XML schema error - Apex Listener 2

    I built a simple query: select * from emp in (Shared components > Report Query)
    When I try to download XML schema for this query (Source Query section) resulting xsd file contains this text: String index out of range: -1
    Shared Apex hosting: 4.2.2.0.0.11
    Print server: Apex Listener 2.0.1

    Hey Saymonc, we're you ever able to find the cause of this issue?  I'm having this happen to me as well.  When I begin using the Report Query functionality, the schema downloaded just fine.  I made an update to a query and began receiving this error.  Now I get the error for ALL of my report queries.  I tried removing them and recreating them, and I continue to receive this error in my schema file, no matter how simple the query.  The data will download just fine, and using the Test Report button works as well.
    Thanks,
    Chris

  • How to change report query dynamically in Oracle APEX?

    Hi,
    I want to dynamically change the where condition in APEX report query. Can anyone help me solve my this problem?
    (Just want to change the query which we change in Oracle Reports using lexical parameter to change &Where, &Order by etc. dynamically!!)
    Thanks, Praful

    Hi
    I've been using flexible queries in APEX for a few years now, and your question just added a whole new dimension to the flexible and powerful nature or writing reports in APEX.
    While APEX Interactive reporting has almost completely removed the need the equivalent of Lexicals in Oracle Reports, I thought it might be fun to try and use lexicals in an APEX report.
    Before we start I should summarise the powerful capability of APEX reporting to have oprtional parameters (lots and lots of them if this is needed).
    For each parameter, you simply add a page item which will hold the value of the parameter.
    The item/parameter can be populated by typing in the value, defining an LOV, using a date-picker etc.
    To make the parameter optional simply use an OR in the where clause.
    So for a apge item P200_PARAM1.....include
    WHERE (:P200_PARAM1 IS NULL
    OR COLUMN1 = :P200_PARAM1)
    This way you can either leave the page item null or type in / select a value from a LOV.
    There is a small quirk in APEX LOV's which sometimes returns a value of '%' or '%null%' - depending on the version - when no value is selected.
    See Patrick Wolf's solution for this at Re: Null value handling in LOVs
    I include this Application Process in all my APEX applications ;)
    Now let's look at using the equivalent of Oracle Reports Lexicals......
    First-off - this is based on the APEX SQL report - NOT Interactive Report.
    It relies on the fact that you can let the query be parsed only at runtime.
    1. Define an SQL report entering the 'core' of your query.
    With a query like SELECT ENAME, JOB FROM EMP
    Select 'Generic Columns' option in the 'Column Headings' section
    Finish the report creation
    2. Define a page item - say P200_LEXICAL - type text on the page
    3. Edit the report and update the SQL query to include your lexical page item
    SELECT ENAME, JOB FROM EMP &P200_LEXICAL. (REMEMBER THE '.' AT THE END)
    Ensure that the option "Use Generic Column Names (parse query at runtime only)" is selected at the bottom of the query
    4. Add a button to the page -using 'Create a button displayed among this region's items' the will submit the page.
    5. Run the page - you will see all the employee names and job desdriptions
    6. Enter a where clause into the 'Lexical' textbox - say "WHERE ENAME LIKE 'K%'" and click the 'Go' button
    Voila! your where clause is magically applied.
    Try any variant you like adding an ORDER BY clause etc...... this is FUN!
    7. Clear the value of the LEXICAL and click go.
    Edit the report and move the &P200_LEXICAL. into the selected columns (or add another one)
    SELECT ENAME, JOB &P200_LEXICAL. FROM EMP
    8. Run the page
    Enter ",SAL" in the textbox and "Go"
    We can add as many columns as we like (subject to the "Maximum number of generic report columns:" set below the SQL query in the report edit section)
    Now because we have all the flexibility in APEX of setting page items using SQL or PLSQL you can set the value of the lexical programatically, or just pre-set a few values in an LOV - the options are limitless.
    While I've never had the need to use lexicals - you can see that APEX provides the most Flexible Lexicals in town.
    Eat your heart out "Oracle Reports"!!!
    Have fun
    Mike

  • Query running long in APEX

    Hi ,
    I am using Apex Version 4.1.1.00.23.  I am running an Interactive report in Apex that is running about15- 20 seconds . I take the query out of the report and run the query  in sqldeveloper and it runs in 4 seconds. Why does it run so much slower in APEX. It is a basic
    Interactive report with one query.  I will send query. Is there a way I can tune through APEX and see why it is taking so MUCH longer ?
    select c.rcn
      ,case when logical_level- (select logical_level from cd_customer where rcn = :P132_RCN) = 1 then '. '
           when logical_level - (select logical_level from cd_customer where  rcn = :P132_RCN) = 2 then '. . '
           when logical_level - (select logical_level from cd_customer where  rcn = :P132_RCN) = 3 then '. . . '
           when logical_level - (select logical_level from cd_customer where  rcn = :P132_RCN) = 4 then '. . . . '
           when logical_level - (select logical_level from cd_customer where  rcn = :P132_RCN) = 5 then '. . . . . '
       end || (logical_level - (select logical_level from cd_customer where  rcn = :P132_RCN)) ||
          ' ' || get_name(c.rcn,'D','1') DName
    ,PHYSICAL_LEVEL - (select physical_level from cd_customer where  RCN = :P132_RCN) "LEVEL"
    , nvl(sumpgpv(c.rcn, :P132_START_PERIOD, :P132_END_PERIOD,c.rank),0) PGPV
    , countd(c.rcn,1, :P132_START_PERIOD, :P132_END_PERIOD)   DistCnt
    , countd(c.rcn,5, :P132_START_PERIOD, :P132_END_PERIOD) MACnt,  logical_lbound,c.rank,
    (select wr.abbreviation from  wd_ranknames wr where wr.rank = c.rank and wr.status=c.status) "rnk_abbrv"
    ,&P132_START_PERIOD,&P132_END_PERIOD ,&P132_RCN
    from cd_customer c
      where :P132_END_PERIOD > (select commission_closed from cd_parameters)  and logical_lbound > 0
    and logical_lbound between (select logical_lbound from cd_customer where rcn = :P132_RCN)
                            and (select logical_rbound from cd_customer where  rcn = :P132_RCN)
    and (logical_level - (select logical_level from cd_customer where rcn = :P132_RCN)) <=:P132_LEVELS                 
    union all
    select c.rcn
      ,case when logical_level- (select logical_level from wd_customer where pvperiod = :P132_END_PERIOD and rcn = :P132_RCN) = 1 then '. '
           when logical_level - (select logical_level from wd_customer where pvperiod = :P132_END_PERIOD and rcn = :P132_RCN) = 2 then '. . '
           when logical_level - (select logical_level from wd_customer where pvperiod = :P132_END_PERIOD and rcn = :P132_RCN) = 3 then '. . . '
           when logical_level - (select logical_level from wd_customer where pvperiod = :P132_END_PERIOD and rcn = :P132_RCN) = 4 then '. . . . '
           when logical_level - (select logical_level from wd_customer where pvperiod = :P132_END_PERIOD and rcn = :P132_RCN) = 5 then '. . . . . '
       end || (logical_level - (select logical_level from wd_customer where pvperiod = :P132_END_PERIOD and rcn = :P132_RCN)) ||
          ' ' || get_name(c.rcn,'D','1') DName
    ,PHYSICAL_LEVEL - (select physical_level from wd_customer where pvperiod = :P132_END_PERIOD AND RCN = :P132_RCN) "LEVEL"
    , sumpgpv(c.rcn, :P132_START_PERIOD, :P132_END_PERIOD,c.rank) PGPV
    ,countd(c.rcn,1, :P132_START_PERIOD, :P132_END_PERIOD) DistCnt
    ,countd(c.rcn,5, :P132_START_PERIOD, :P132_END_PERIOD) MACnt
    ,logical_lbound,c.rank,(select wr.abbreviation from
    wd_ranknames wr where wr.rank = c.rank and wr.status=c.status) "rnk_abbrv"
    ,&P132_START_PERIOD,&P132_END_PERIOD ,&p132_RCN
    from wd_customer c
      where pvperiod = :P132_END_PERIOD and logical_lbound > 0
    and logical_lbound between (select logical_lbound from wd_customer where pvperiod = :P132_END_PERIOD and rcn = :P132_RCN)
                            and (select logical_rbound from wd_customer where pvperiod = :P132_END_PERIOD and rcn = :P132_RCN)
    and (logical_level - (select logical_level from wd_customer where pvperiod = :P132_END_PERIOD and rcn = :P132_RCN)) <=:P132_LEVELS   

    Sorry, my OCD must have kicked in.  Try removing all those in-line queries, although not an answer to why the report takes longer than elsewhere, it might help.
    SELECT c.rcn ,
      CASE
        WHEN c.logical_level - cv.logical_level = 1  THEN '. '
        WHEN c.logical_level - cv.logical_level = 2  THEN '. . '
        WHEN c.logical_level - cv.logical_level = 3  THEN '. . . '
        WHEN c.logical_level - cv.logical_level = 4  THEN '. . . . '
        WHEN c.logical_level - cv.logical_level = 5  THEN '. . . . . '
      END
      || (c.logical_level - cv.logical_level)
      || ' '
      || get_name(c.rcn,'D','1') DName ,
      c.PHYSICAL_LEVEL - cv.physical_level "LEVEL" ,
      NVL(sumpgpv(c.rcn, :P132_START_PERIOD, :P132_END_PERIOD,c.rank),0) PGPV ,
      countd(c.rcn,1, :P132_START_PERIOD, :P132_END_PERIOD) DistCnt ,
      countd(c.rcn,5, :P132_START_PERIOD, :P132_END_PERIOD) MACnt,
      c.logical_lbound,
      c.rank,
      (SELECT wr.abbreviation
        FROM wd_ranknames wr
        WHERE wr.rank = c.rank
          AND wr.status =c.status ) "rnk_abbrv" ,
      &P132_START_PERIOD,
      &P132_END_PERIOD ,
      &P132_RCN
    FROM cd_customer c,
        cd_customer cv
    WHERE cv.rcn = :P132_RCN
      AND :P132_END_PERIOD > (SELECT commission_closed FROM cd_parameters )
      AND c.logical_lbound > 0
      AND c.logical_lbound BETWEEN cv.logical_lbound AND cv.logical_rbound
      AND (clogical_level - cv.logical_level) <=:P132_LEVELS
    UNION ALL
    SELECT c.rcn ,
      CASE
        WHEN c.logical_level - cv.logical_level = 1 THEN '. '
        WHEN c.logical_level - cv.logical_level = 2 THEN '. . '
        WHEN c.logical_level - cv.logical_level = 3 THEN '. . . '
        WHEN c.logical_level - cv.logical_level = 4 THEN '. . . . '
        WHEN c.logical_level - cv.logical_level = 5 THEN '. . . . . '
      END
      || (c.logical_level - cv.logical_level )
      || ' '
      || get_name(c.rcn,'D','1') DName ,
      PHYSICAL_LEVEL - cv.physical_level "LEVEL" ,
      sumpgpv(c.rcn, :P132_START_PERIOD, :P132_END_PERIOD,c.rank) PGPV ,
      countd(c.rcn,1, :P132_START_PERIOD, :P132_END_PERIOD) DistCnt ,
      countd(c.rcn,5, :P132_START_PERIOD, :P132_END_PERIOD) MACnt ,
      c.logical_lbound,
      c.rank,
      (SELECT wr.abbreviation
      FROM wd_ranknames wr
      WHERE wr.rank = c.rank
      AND wr.status =c.status
      ) "rnk_abbrv" ,
      &P132_START_PERIOD,
      &P132_END_PERIOD ,
      &p132_RCN
    FROM wd_customer c,
      wd_customer cv
    WHERE cv.pvperiod    = :P132_END_PERIOD
    AND cv.rcn          = :P132_RCN
    AND c.pvperiod      = :P132_END_PERIOD
    AND c.logical_lbound > 0
    AND c.logical_lbound BETWEEN cv.logical_lbound AND cv.logical_rbound
    AND (logical_level - cv.logical_level ) <= :P132_LEVELS

  • Oracle sql query execute in the apex

    hi:
    my requirement is, in region i have one text area item and query button.
    in this text area i am typing the any sql query and when i am pressing the query button it should display the query output report..
    pls give solution fast as soon as possible....
    Message was edited by:
    anbarasan

    Hi anbarasan,
    Maybe you can create a report of type "SQL query (PL/SQL Function returning query". Then in the region source, something like:
    DECLARE
    v_sql VARCHAR2 (4000);
    BEGIN
    v_sql := :PX_YOUR_ITEM;
    RETURN v_sql;
    END;
    Paulo Vale
    http://apex-notes.blogspot.com

  • 32k Rowsize Limit (ORA-006502) for Report Query Shared Objects in Apex 4.1

    We're trying to move legacy reports off of PlanetPress into Apex. One of the report queries has over 20 tables and attempting to run with the "Test Report" button in the Edit Report Query screen gets the error message:
    Error ORA-06502: PL/SQL: numeric or value error: character string buffer too small
    This problem appears to have been characterized previously here:
    Listener Error - character string buffer too small (ORA-06502)
    If I comment out 13 lines/items in my SELECT clause, the Test Report runs okay. If I add back in an innocuous literal sellect of a 100-character string, it goes back to the 6502 error.
    I was trying to add more literal strings to force APEX to shift internally from a 32k-limit to a CLOB for the row, however, with a 32k literal string in my SQL statement, APEX crashes. I can't strip out columns from my SQL as all are needed for the report.
    I would very much appreciate a work-around or a patch to Apex 4.1 to address this limitation. Thank you.

    Try moving some of your select logic into a view, thus you can select from the views and reduce your code... (Move the joining between tables and such to the view..)
    Thank you,
    Tony Miller
    Webster, TX

  • Query, Performance Problem in apex

    Hi All,
    I am using
    select address1,address2,address3,city,place,pincode,siteid,bpcnum_0, contactname,fax,mobile,phone,website,rn from (select address1,address2,address3,city,place,pincode,siteid,bpcnum_0, contactname,fax,mobile,phone,website,dense_rank() over(order by contactname,address1)as rn, row_number() over (partition by contactname, address1 order by contactname, address1) as rn1 from vw_sub_cl_add1 where siteid=v('P10_SITENO') and bpcnum_0 = v('P10_CLNO')) emp where rn1 =1 and rn >= v('P10_RN')
    the above query to extract the details from a view, in a pl/sql region
    pagination is also working fine.
    ie only 4 records at a time will get displayed.
    Problem is
    it is taking 1min and 5 seconds to display, next set of records.
    please, could any tell me how to reduce the time of rendering the page.?
    Thanks in advance
    bye
    Srikavi

    If it's really true, that when using bind variables the query is fast, than can you rewrite your query in your application to use bind variables?
    Try to rewrite your query to use :P10_SITENO instead of v('P10_SITENO') etc. where possible.
    You can find more details at Patrick Wolf's blog http://www.inside-oracle-apex.com/2006/12/drop-in-replacement-for-v-and-nv.html

  • Mutliple Query String input to APEX RESTful Services

    Does Oracle APEX (latest version via APEX Listener) support passing in multiple query string parameters to support a restful service query? E.g.
    http://ofmindus.induscorp.com:7000/apex/servicetest/animals/dogs/spot
    http://ofmindus.induscorp.com:7000/apex/servicetest/animals/dogs?name=spot
    http://ofmindus.induscorp.com:7000/apex/servicetest/animals/dogs?name=spot?location=Maryland
    As you can see the progression above, the last url will query a dogs table using where name = 'spot' and location = 'Maryland'. Is this possible? If so can someone explain how to setup the URI/Bind Variables? Also, if its possible, do I need templates to support each variation of the input that is possible using a priority setting to help APEX pick the right query to execute?
    Edited by: user2777903 on Feb 11, 2013 10:19 AM

    Hi Nilesh,
    We tried to connect to Oracle Cloud Database using the way you suggested above, but unfortunately it is not working as well.
    Can you let us know the authentication process with Oracle Cloud Database? We found in documentation that it uses OAM (Oracle Access Manager) for authentication. Can you tell us a bit about that? That will be extremely helpful.
    Thanks,
    - Neeraj

  • Multi query PDF report in apex 4.0

    Hi All...
    I have created a report in apex 4.0. it consists of more than 40 queries. Initially it was working fine but now it has a very unpredictable behavior. Some of the queries were not retrieving the data. I just deleted them and then recreate them , the data retrieved. I took the backup of the whole application and imported it on another machine. The queries that were recreated were working fine but most of the other queries were not retrieving the data. This happened several times and each time a new set of queries doesnt retrieve the data...
    What can be the problem? Is there any limitation with the "Report Query" size in in apex4.0?
    Best Regards
    Sajjad

    40 QUERIES???? Why don't you move SOME of those to views in your database, unless they need some sort of parameters passed in, then move them to collections in a procedure... Sounds like a train wreck just waiting to happen....
    A blonde goes to the doctor and as she touches each part of her body with her finger she says: Doc it hurts everywhere. My leg hurts, my arm hurts, my neck hurts, and even my head hurts! Doc what's wrong? The doctor answers: Your finger is broken!
    Thank you,
    Tony Miller
    Webster, TX

  • Query way slower as APEX report than in SQL client

    Hi,
    I know that this topic has been discussed many times. Usually the problem is that the query returns at least thousands of data. Unfortunately, not in my case. The query returns the top 10 applications for the current month only, ordered descending by the number of transactions:
    select APP_KEY, REQUEST_COUNT
    from
        (select APP_KEY, sum(REQUEST_COUNT) as REQUEST_COUNT,
            row_number() over(order by sum(REQUEST_COUNT) desc, APP_KEY) RN
        from YEAR_REQUEST_COUNT
        where (RESPONSE_CODE between 200 and 299 or RESPONSE_CODE < 100) and
            REQUEST_TIME >= trunc(sysdate, 'mm') and
            REQUEST_TIME < trunc(sysdate)
        group by APP_KEY)
    where RN <= 10
    order by RN
    In TOAD it takes approx. 1 minute, in APEX its SQL command tool approx. 80 seconds and as a simple classic report approx. 6 minutes!
    That's the query plan I get with TOAD and APEX:
    | Id  | Operation                     | Name               | Rows  | Bytes |TempSpc| Cost (%CPU)| Time     | Pstart| Pstop |
    |   0 | SELECT STATEMENT              |                    |  7028 |  1976K|       |   300K  (3)| 01:30:13 |       |       |
    |   1 |  SORT ORDER BY                |                    |  7028 |  1976K|  2112K|   300K  (3)| 01:30:13 |       |       |
    |*  2 |   VIEW                        |                    |  7028 |  1976K|       |   300K  (3)| 01:30:10 |       |       |
    |*  3 |    WINDOW SORT PUSHED RANK    |                    |  7028 |   267K|       |   300K  (3)| 01:30:10 |       |       |
    |   4 |     HASH GROUP BY             |                    |  7028 |   267K|       |   300K  (3)| 01:30:10 |       |       |
    |*  5 |      FILTER                   |                    |       |       |       |            |          |       |       |
    |   6 |       PARTITION RANGE ITERATOR|                    |  8703K|   323M|       |   299K  (3)| 01:29:57 |   KEY |   KEY |
    |*  7 |        TABLE ACCESS FULL      | YEAR_REQUEST_COUNT |  8703K|   323M|       |   299K  (3)| 01:29:57 |   KEY |   KEY |
    Predicate Information (identified by operation id):
       2 - filter("RN"<=10)
       3 - filter(ROW_NUMBER() OVER ( ORDER BY SUM("REQUEST_COUNT") DESC ,"APP_KEY")<=10)
       5 - filter(TRUNC(SYSDATE@!,'fmmm')<TRUNC(SYSDATE@!))
       7 - filter("REQUEST_TIME">=TRUNC(SYSDATE@!,'fmmm') AND ("RESPONSE_CODE">=200 AND "RESPONSE_CODE"<=299 OR
                  "RESPONSE_CODE"<100) AND "REQUEST_TIME"<TRUNC(SYSDATE@!))
    I've also tried to rewrite the query, but no positive effects:
    select *
    from (
        select APP_KEY, sum(REQUEST_COUNT) as REQUEST_COUNT
        from YEAR_REQUEST_COUNT
        where (RESPONSE_CODE between 200 and 299 or RESPONSE_CODE < 100) and
            REQUEST_TIME >= trunc(sysdate, 'mm') and
            REQUEST_TIME < trunc(sysdate)
        group by APP_KEY
        order by REQUEST_COUNT desc
    where rownum <= 10
    The APEX debugger shows me that 99% of the time are spent on the step "rows loop: 15 row(s)".
    Any ideas what's going on with this query?
    Carsten

    > I am using the agregation function WMSYS.WM_CONCAT and I figured
    out that the poor PL/SQL performance must be related somehow to this
    function...
    Wrong.
    Who executes the SQL that is created?
    Answer - does not matter where the SQL comes from, from a PL procedure, Java program, SQL*Plus, TOAD or whatever, the SQL is parsed by the SQL engine, execution plan created by the CBO and stored in the SQL Shared Pool.
    An EXECUTE IMMEDIATE is a PL command that sends the string to the SQL engine to be processed. Just as SQL*Plus sends a string to the SQL engine to be processed.
    So how can the very same SQL be faster from SQL*Plus and slower from somewhere else?
    Nothing to do with where it comes from, but everything to do wrt the session that the SQL is being executed in. Issues such as settings for that session (which can be differ from session to session). Scope. Context. Etc.

  • APEX.CONDITION.UNHANDLED_ERROR in Application after Update to 4.2

    following error in an Application (working perfect in Apex 4.0.2) after Update to 4.2.0
    after entering url:
    Error     Error processing condition.
    ORA-00907: missing right parenthesis
    Technical Info (only visible for developers)
    is_internal_error: true
    apex_error_code: APEX.CONDITION.UNHANDLED_ERROR
    ora_sqlcode: -907
    ora_sqlerrm: ORA-00907: missing right parenthesis
    error_backtrace:
    ORA-06512: at "SYS.DBMS_SYS_SQL", line 1325
    ORA-06512: at "SYS.WWV_DBMS_SQL", line 1185
    ORA-06512: at "SYS.WWV_DBMS_SQL", line 1256
    ORA-06512: at "SYS.WWV_DBMS_SQL", line 1294
    ORA-06512: at "APEX_040200.WWV_FLOW_DYNAMIC_EXEC", line 880
    ORA-06512: at "APEX_040200.WWV_FLOW_CONDITIONS", line 331
    Any Ideas?
    regards
    Ralf

    the was an missed ' in an authorization schema (SQL Query) - prior Versions of Apex ignored that error ...

  • The requested URL /apex/wwv_flow.accept was not found on this server

    I'm trying to create a report query in Apex 3.2.1
    Home>Application Builder>Application 100>Shared Components>Report Queries>Edit Report Query
    There are 5 queries and I'm trying to add additional queries, but when I click on Add Query I get the /apex/wwv_flow.accept was not found on this server error message page.
    I've had this message before in tabular view forms, where one cell will contain text that causes the error on update, but when the data is removed the page saves OK.

    Any result to this post?

Maybe you are looking for