Maximum rows to fetch in a Query Oracle Reports10

Is it possible to limit the number of rows a Query returns by a line calculated i.e. instead of maximum number of rows being e.g. 3 it could be :C_CALLINES?
I tried this but I just get invalid number as an error.

Thanks a lot for that. Here is the before reports trigger where should I put
SRW.SET_MAXROW('Q_1',1);
Function BeforeReport return boolean is
begin
BEGIN
  -- srw.do_sql('alter session set sql_trace = true');
  select displayed_field
  into   :C_continued
  from   po_lookup_codes
  where  lookup_type = 'POXPRPOP'
  and    lookup_code = 'CONTINUED';
  select displayed_field
  into   :C_address_at_top
  from   po_lookup_codes
  where  lookup_type = 'POXPRPOP'
  and    lookup_code = 'ADDRESS AT TOP';
/* Bug 1484478
  The call to initialize is being made in after parameter value trigger and it
  is not necessary to do it here again
  SRW.USER_EXIT('FND SRWINIT');
/* Change the :P_single_po_print parameter value
to 1 if po_from and po_to parameters are same.
Then Query will fetch the correct data for all conditions and uses the
indexes incase of :P_po_num_from=:P_po_num_to and ALPHANUMERIC data
Bug#946470 -- bgopired  */
  If :P_po_num_from = :P_po_num_to THEN
            :P_single_po_print := 1;
  END IF;
  srw.user_exit('FND INSTALLATION OUTPUT_TYPE="STATUS"
                 OUTPUT_FIELD=":P_EC_STATUS"
                 APPS="EC"');
  srw.message ('010', :P_ec_status);
  SRW.USER_EXIT('FND FLEXSQL CODE           ="MSTK"
                             OUTPUT         =":P_FLEX_ITEM"
                             APPL_SHORT_NAME="INV"
                             MODE           ="SELECT"
                             DISPLAY        ="ALL"
                             NUM            ="101"
                             TABLEALIAS     ="MSI"');
/* Check for multilingual installation and take appropriate action. */
/* See Reports PL/SQL for more details. */
  if (MLS_INSTALLED) then
     POPULATE_MLS_LEXICALS;
  end if;
  RETURN TRUE;
END;  return (TRUE);
end;

Similar Messages

  • Need help for SQL SELECT query to fetch XML records from Oracle tables having CLOB field

    Hello,
    I have a scenario wherein i need to fetch records from several oracle tables having CLOB fields(which is holding XML) and then merge them logically to form a hierarchy XML. All these tables are related with PK-FK relationship. This XML hierarchy is having 'OP' as top-most root node and ‘DE’ as it’s bottom-most node with One-To-Many relationship. Hence, Each OP can have multiple GM, Each GM can have multiple DM and so on.
    Table structures are mentioned below:
    OP:
    Name                             Null                    Type        
    OP_NBR                    NOT NULL      NUMBER(4)    (Primary Key)
    OP_DESC                                        VARCHAR2(50)
    OP_PAYLOD_XML                           CLOB       
    GM:
    Name                          Null                   Type        
    GM_NBR                  NOT NULL       NUMBER(4)    (Primary Key)
    GM_DESC                                       VARCHAR2(40)
    OP_NBR               NOT NULL          NUMBER(4)    (Foreign Key)
    GM_PAYLOD_XML                          CLOB   
    DM:
    Name                          Null                    Type        
    DM_NBR                  NOT NULL         NUMBER(4)    (Primary Key)
    DM_DESC                                         VARCHAR2(40)
    GM_NBR                  NOT NULL         NUMBER(4)    (Foreign Key)
    DM_PAYLOD_XML                            CLOB       
    DE:
    Name                          Null                    Type        
    DE_NBR                     NOT NULL           NUMBER(4)    (Primary Key)
    DE_DESC                   NOT NULL           VARCHAR2(40)
    DM_NBR                    NOT NULL           NUMBER(4)    (Foreign Key)
    DE_PAYLOD_XML                                CLOB    
    +++++++++++++++++++++++++++++++++++++++++++++++++++++
    SELECT
    j.op_nbr||'||'||j.op_desc||'||'||j.op_paylod_xml AS op_paylod_xml,
    i.gm_nbr||'||'||i.gm_desc||'||'||i.gm_paylod_xml AS gm_paylod_xml,
    h.dm_nbr||'||'||h.dm_desc||'||'||h.dm_paylod_xml AS dm_paylod_xml,
    g.de_nbr||'||'||g.de_desc||'||'||g.de_paylod_xml AS de_paylod_xml,
    FROM
    DE g, DM h, GM i, OP j
    WHERE
    h.dm_nbr = g.dm_nbr(+) and
    i.gm_nbr = h.gm_nbr(+) and
    j.op_nbr = i.op_nbr(+)
    +++++++++++++++++++++++++++++++++++++++++++++++++++++
    I am using above SQL select statement for fetching the XML records and this gives me all related xmls for each entity in a single record(OP, GM, DM. DE). Output of this SQL query is as below:
    Current O/P:
    <resultSet>
         <Record1>
              <OP_PAYLOD_XML1>
              <GM_PAYLOD_XML1>
              <DM_PAYLOD_XML1>
              <DE_PAYLOD_XML1>
         </Record1>
         <Record2>
              <OP_PAYLOD_XML2>
              <GM_PAYLOD_XML2>
              <DM_PAYLOD_XML2>
              <DE_PAYLOD_XML2>
         </Record2>
         <RecordN>
              <OP_PAYLOD_XMLN>
              <GM_PAYLOD_XMLN>
              <DM_PAYLOD_XMLN>
              <DE_PAYLOD_XMLN>
         </RecordN>
    </resultSet>
    Now i want to change my SQL query so that i get following output structure:
    <resultSet>
         <Record>
              <OP_PAYLOD_XML1>
              <GM_PAYLOD_XML1>
              <GM_PAYLOD_XML2> .......
              <GM_PAYLOD_XMLN>
              <DM_PAYLOD_XML1>
              <DM_PAYLOD_XML2> .......
              <DM_PAYLOD_XMLN>
              <DE_PAYLOD_XML1>
              <DE_PAYLOD_XML2> .......
              <DE_PAYLOD_XMLN>
         </Record>
         <Record>
              <OP_PAYLOD_XML2>
              <GM_PAYLOD_XML1'>
              <GM_PAYLOD_XML2'> .......
              <GM_PAYLOD_XMLN'>
              <DM_PAYLOD_XML1'>
              <DM_PAYLOD_XML2'> .......
              <DM_PAYLOD_XMLN'>
              <DE_PAYLOD_XML1'>
              <DE_PAYLOD_XML2'> .......
              <DE_PAYLOD_XMLN'>
         </Record>
    <resultSet>
    Appreciate your help in this regard!

    Hi,
    A few questions :
    How's your first query supposed to give you an XML output like you show ?
    Is there something you're not telling us?
    What's the content of, for example, <OP_PAYLOD_XML1> ?
    I don't think it's a good idea to embed the node level in the tag name, it would make much sense to expose that as an attribute.
    What's the db version BTW?

  • ADF: Best way to find out how many rows are fetched?

    Hello,
    I have overridden method executeQueryForCollection of ViewObject in which I execute supper.executeQueryForCollection and after that want to find out how many rows are fetched during the execution.
    If I try to use getFetchedRowCount I always get "0", if using getEstimatedRowCount, query are being re-executed.
    What method is better to use for that?
    Thank you,
    Veniamin Goldin
    Forbis, Ltd.

    I have a 'home-made' view called RBS, whose definition is this:
    create view RBS as
    select /*+ RULE  */ substr(s.username,1,10) oracle,
           substr(case when s.osuser like 'oramt%'
                       then nvl(upper(s.client_info),'client_info not set')
                       else substr(s.machine,instr(s.machine, '\')+1,length(s.machine))||':'||s.osuser
                  end
                  ,1,20) CLIENT
    ,      substr(''''||s.sid||','||s.serial#||''''||decode(s.status,'KILLED','*',''),1,12) kill_id
    ,      lpad(to_char(t.xidusn),4) rbs#
    ,      lpad(to_char(t.used_ublk),4) ublk
    ,      lpad(to_char(t.used_urec),8) urecords
    ,      i.block_gets
    ,      lpad(to_number(round((sysdate - to_date(t.start_time,'MM/DD/YY HH24:MI:SS')) * 60 * 60 * 24)),9) time
    ,      upper(substr(s.program,1,20)) PROGRAM
    ,      to_char(s.LOGON_TIME,'HH24:MI:SS DD-MON') LOGIN_TIME
    from   sys.v_$transaction t
    ,      sys.v_$session s
    ,      sys.v_$sess_io i
    ,      sys.v_$process p
    where  s.saddr = t.ses_addr
    and    i.sid = s.sid
    and    p.addr = s.paddr
    /By monitoring the URECORDS column value of the row that corresponds to my session doing a transaction, I can see how it progresses.
    Toon

  • Max rows to fetch

    The max rows to fetch in Reports can only have a number field. When sending a parameter tru from forms how can i handle this option. I don't want to print the same number of records each time I request a report.

    Hi,
    bootstrap wrote:
    Frank Kulash wrote:
    Hi,
    Here's one way, which uses the analytic MAX function to find the greatest seq for each id:
    I hope this answers your question.
    If not, post a little sample data (CREATE TABLE and INSERT statements, relevant columns only), and the results you want from that data.
    Explain how you get those results from that data.
    Always say what version of Oracle you're using.Is my problem clear now ? Please helpSorry, the problem isn't clear.
    Is my answer clear?
    Frank Kulash wrote:
    ... post a little sample data (CREATE TABLE and INSERT statements, relevant columns only), and the results you want from that data.
    Explain how you get those results from that data. ...If you don't post CREATE TABLE and INSERT statements, then the people who want to help you can't test their ideas.
    Point out where the query I posted is giving the wrong results. Say what the right results are in those places, and explain, step by step, how you derive the right right results from the sample data.

  • ViewObject fetch size with non-oracle flavor?

    Hi,
    I've been playing with fetch size / mode settings and I've noticed that SQL92 builder seems to ignore fetch size.
    When I run my page with fetch mode FETCH_AS_NEEDED and size of 1 and Oracle builder, i get a fetch for each row. When I switch to SQL92 it seems real fetch size is 10 and there's nothing I can do about it as settings are ignored.
    Tkprof with Oracle builder
    select *
    from
    order_items
    call     count       cpu    elapsed       disk      query    current        rows
    Parse        1      0.00       0.00          0          0          0           0
    Execute      1      0.00       0.00          0          0          0           0
    Fetch       98      0.01       0.00          0        102          0          97
    total      100      0.01       0.00          0        102          0          97Tkprof with SQL92 builder
    call     count       cpu    elapsed       disk      query    current        rows
    Parse        1      0.00       0.00          0          0          0           0
    Execute      1      0.00       0.00          0          0          0           0
    Fetch       10      0.00       0.00          0         16          0          97
    total       12      0.00       0.00          0         16          0          97Is this documented somewhere? So far I have found nothing on the topic.
    What happens with other databases?
    Edit: it seems fetch size is completely ignored for MS sql server. All rows are fetched and cached from what I can tell.

    Hofespet is right, which is quite unfortunate.
    I also found this in the documentation:
    SQL style: If the generic SQL92 SQL style is used to connect to generic SQL92-compliant databases, then some view object tuning options will not
    function correctly. The parameter that choosing the generic SQL92 SQL style
    affects the most is the fetch size. When SQL92 SQL style is used, the fetch size
    defaults to 10 rows regardless of what is configured for the view object. You can
    set the SQL style when you define the database connection. By default, the SQL
    style will be Oracle. To manually override the SQL style, you can also pass the
    parameter -Djbo.SQLBuilder="SQL92" to the JVM upon startup.

  • Require Maximum Rows & Columns to shown in report once generated....

    Hello,
    My client has a query that when a report is generated through Discoverer via the Oracle Self Service, it displays a limited set of rows and columns. The user has to click on the rows and column link (right above the displayed report) and then enter the values of how many rows or columns to exceed, to which then a whole report is refreshed displaying the desired data.
    The query my client has and wants to know is whether there is a possibility that the whole report, including maximum rows and columns, is displayed in one go, rather than clicking and setting up rows and column in every report again and again...??
    Thanks!

    Hi,
    I assume you talk about the discoverer viewer.
    In order to accomplish the user desire, the owner of the report should set once the columns and rows number to the max and save it like this.
    then every user will get the maximum number of rows (999) and columns.
    Tamir

  • Deleting duplicate rows based on three columns in Oracle 8i

    Hi all,
    The database we use is Oracle 8i.
    The query below raises the too_many_rows exception when I launch an application. So I want to delete the duplicated rows :
    select polarisation_1, polarisation_2
    into v_pol1_tech, v_pol2_tech
    from v_cfh_lien_element
    where nom_lien = p_nom_lien
    AND num_canal_1 = p_num_canal_1
    AND freq_emise_1 = p_freq_emise_1;
    Notice that with many possible values of the parameters p_nom_lien, p_num_canal_1 and p_freq_emise_1 then the exception is raised.
    So how to delete generally the duplicated rows based on the three columns "nom_lien" , "num_canal_1" and "freq_emise_1" ?
    Thank you very much indeed.

    Check the other thread with same question deleting duplicate rows based on three columns in Oracle 8i

  • OCI - Array-Fetch vs. One-row-per-fetch

    Hello guys,
    i have a question about the OCI and the possibilities about fetches.
    Is it possible to get only one row per fetch without setting the array size to 1?
    I have a third party application that shows this behaviour which i have rebuild in sqlplus.
    SQL> create table mytest (a number);
    SQL> begin
      2  for i in 1 .. 1500 loop
      3  insert into mytest values (i);
      4      end loop;
      5  end;
      6  /
    PL/SQL procedure successfully completed.
    SQL> commit;
    Commit complete.
    SQL> set autotrace traceonly;
    -- Now with the default array size of 15 with sqlplus
    SQL> select * from mytest;
         118  consistent gets
         101  SQL*Net roundtrips to/from client
         1500  rows processed
    -- Now with a bigger array size (150)
    SQL> set arraysize 150
    SQL> select * from mytest;
         17  consistent gets
         11  SQL*Net roundtrips to/from client
         1500  rows processed
    -- Now the behaviour of the third party application
    SQL> set arraysize 1
    SQL> select * from mytest;
         757  consistent gets
         751  SQL*Net roundtrips to/from client
         1500  rows processed
    SQL> set arraysize 2
    SQL> select * from mytest;
         757  consistent gets
         751  SQL*Net roundtrips to/from client
         1500  rows processedThe third party application is a c program and i can not take a look at the code.
    So as you can see the consistent gets are the same with arraysize 1 and 2. The sql statement which is executed of the c-program is returning a huge amount of data and it seems like it is run with arraysize 1 or 2 or it is executing a different OCI call.
    So now is my question:
    Which methods does the OCI interface provide to recieve (fetch) data?
    - Is it only array fetching (like sqlplus do) or is it possible to return only one row per fetch with a specific call.
    I can speed up the query by setting the bigger array-size in sqlplus .. but i want to point the programers to the possibilities with the OCI.
    Thanks and Regards
    Stefan

    The following call in OCI can be used to control the fetched rows
    MAX_PREFETCH_ROWS is number of rows you want to fetch in one round trip.
    (void) OCIAttrSet((dvoid *)DBctx->stmthp, (ub4) OCI_HTYPE_STMT,
    (dvoid *)&MAX_PREFETCH_ROWS,(ub4)sizeof(MAX_PREFETCH_ROWS),(ub4) OCI_ATTR_PREFETCH_ROWS, DBctx->errhp);

  • OBIEE 11g: Report not displaying maximum rows per page

    I have an OBIEE report that is not displaying the maximum rows per page. When I click on the UP/DOWN arrow at the bottom of the report there is no change.

    Hi,
    Refer the below link.
    http://satyaobieesolutions.blogspot.in/2012/08/limit-row-in-table-and-graph-in-initial.html
    OR,
    https://supporthtml.oracle.com/ep/faces/secure/km/DocumentDisplay.jspx?id=1198961.1
    Add the following to your instanceconfig and then restart the presentation service.
    file path
    D:\Oracle\Middleware\instances\instance1\config\OracleBIPresentationServicesComponent\coreapplication_obips1\instanceconfig.xml just add below lines
    <Views>
    <Pivot>
    <MaxCells>6500000</MaxCells>
    <MaxVisibleColumns>100</MaxVisibleColumns>
    <MaxVisiblePages>100</MaxVisiblePages>
    <MaxVisibleRows>65000</MaxVisibleRows>
    <MaxVisibleSections>25</MaxVisibleSections>
    <DefaultRowsDisplayed>500</DefaultRowsDisplayed>
    <!--This Configuration setting is managed by Oracle Business Intelligence Enterprise Manager--><DefaultRowsDisplayedInDelivery>75</DefaultRowsDisplayedInDelivery>
    <!--This Configuration setting is managed by Oracle Business Intelligence Enterprise Manager--><DefaultRowsDisplayedInDownload>65000</DefaultRowsDisplayedInDownload>
    <!--This Configuration setting is managed by Oracle Business Intelligence Enterprise Manager--><DisableAutoPreview>false</DisableAutoPreview>
    </Pivot>
    <Table>
    <MaxCells>6500000</MaxCells>
    <MaxVisiblePages>100</MaxVisiblePages>
    <MaxVisibleRows>65000</MaxVisibleRows>
    <MaxVisibleSections>25</MaxVisibleSections>
    <DefaultRowsDisplayed>500</DefaultRowsDisplayed>
    <!--This Configuration setting is managed by Oracle Business Intelligence Enterprise Manager--><DefaultRowsDisplayedInDelivery>75</DefaultRowsDisplayedInDelivery>
    <!--This Configuration setting is managed by Oracle Business Intelligence Enterprise Manager--><DefaultRowsDisplayedInDownload>65000</DefaultRowsDisplayedInDownload>
    </Table>
    </Views>
    Hope this help's
    Thanks,
    Satya

  • Maximum Row Count - dynamically change

    Hi,
    How can I change dynamically (eg. from some item) value "Maximum Row Count" in "Report Attributes -> Layout and Pagination"?
    Is this possible?
    best regards,
    Jarek

    Thank you for your answer, but I want to do something else.
    I want to show all rows from my query in report with pagination.
    The number of rows increases.
    According to documentation, field "Number of Rows" sets the number of rows which I can see on one page and field "Maximum Row Count" sets the maximum number of rows which I can see on all pages (number of rows to query).
    I thougth, that when I set (before page is shown) a variable from eg. query "SELECT count(*) FROM table", I will be able to put this variable name in "Maximum Row Count" field, to see all rows from my query. However this field is the numeric field and I can't put any variable name there :(
    The only way to always show all records from my query is to set "Maximum Row Count" field to very high number? Is this natural way in apex? Is this only way?
    best regards,
    Jarek

  • Maximum rows exceed in SmartView

    I'm running and MDX query in SmartView and got this mesage. "Maximum numbers of rows [5000] Exceeded". Is this the maximum rows can return in SV? If not, where can i increase this limit?
    Thank you.

    In EAS, go to the Hyperion Provider Services node.
    If you don't have a server underneath it, add one -- it can be the same name as your EAS server (well, usually). In 11x, just add the Provider Name and EAS will add the url.
    Navigate within your newly added server, right click on it (this would be the one directly under HPS), and select Edit->Properties.
    Then, go to the Settings field, change the Maximum number of rows to whatever, click on Apply, and you should be good to go.
    It is documented, somewhere, but I can never remember where.
    Regards,
    Cameron Lackpour

  • Dynamically set maximum row count in Interactive Report

    Hi,
    Has anyone worked out a way of dynamically setting (e.g. via select list) the maximum row count value for an Interactive Report, taking into account issues with order by when the report is filtered. I'm aware of solutions like this: http://www.talkapex.com/2010/10/apex-reports-no-limit-downloads.html but as far as I can tell this doesn't work when the report is filtered and the IR is rewritten in the background. Data sets then become unreliable because they are reordered.
    Thanks,
    Mike

    Hi Mike,
    You can do that with javascript
    gReport.search('SEARCH',100)the 100 you can replace for any number you like.I have a report with filter,sorting and groups and it is gives no problem there.
    any number means any number but not higher than the number you set at Maximum Rows Per Page.
    You probably can mix the solution from Martin and the above code.
    Regards,
    Kees Vlek
    <tt>Company: http://www.orcado.nl
    Blog: http://www.orcado.nl/blog/blogger/listings/69-kvlek
    Twitter: http://www.twitter.com/skier66</tt>
    If the question is answered please change it to answered and mark the appropriate post as correct/helpfull.
    Edited by: kvlek on 24-apr-2013 12:29
    Edited by: kvlek on 24-apr-2013 12:35

  • How to display first row value returened from a query as checked as default in a report

    How to display first row value returned from a query as checked as default in a report
    Example
    Parameter 1
    Paramerter2
    ABD
    x(checked)
    Test
    DEF
    JMG
    Mudassar

    Hi Mudassar,
    The issue is caused by the order in which the parameters appear in the report data tab can be difference between our report execution and it failing. In other words, “Parameter2” is execution before parameter “A” due to this issue. We can adjust the parameter’s
    order to solve the issue.
    If “Parameter2” is parameter “A”, we cannot use that expression. Because fields cannot be used in report parameter expression, if we want to display the first value returned from a query as default value, we have to fill the “Specify values” text box with
    the specific value in Default Values dialog box.
    Regards,
    Alisa Tang
    Alisa Tang
    TechNet Community Support

  • NEXT button on report portlet shows 10 rows-maximum rows per page=9999

    I created a report with the DB Provider portlet. I set the maximum rows per page to 9999 when displayed as a portlet and as a full page. I put the portlet on a page and it only shows 10 rows and then the next button.
    If there are exactly 10 rows I get the next button. If I click it the next page loads with no data. If there are less than 10 rows there is no button.
    If I create a new portlet it does not do this. I'm only having the problem with one portlet now but I've seen it in the past. I usually just build the portlet again but I would like to know how to fix it.
    I can't customize the portlet because of bug #3467032.

    Select customize and set the number of rows to 9999. I'm guessing that it's currently set to 10.

  • Export-csv output maximum row size

    Hi all. May I know the maximum row size that can output to .csv using 'export-csv'??

    There's no limit on writing to a CSV file.
    You can try:
    # max rows to export to CSV:
    $i=0
    While ($true) { #Forever
    $i++
    $i
    "Some text" | Export-Csv -Path .\test12.csv -Append -NoTypeInformation
    until you run out of disk space, which may take a while. A million lines using the above script makes a 5 BM file..
    Now reading it back is an entirely different story. Try
    Delimit..
    Sam Boutros, Senior Consultant, Software Logic, KOP, PA http://superwidgets.wordpress.com (Please take a moment to Vote as Helpful and/or Mark as Answer, where applicable)

Maybe you are looking for

  • How do i consolidate my i tunes library if i cant open itunes?

    Itunes wont work after latest update. Keeps coming up with R6034 runtime error. The support section has a fix detailed. First it says consolidate your Itunes library before copying it to an external hard drive. But I cant consolidate my library if IT

  • Where can i find "javax.xml.parsers"

    Hello Every One, H R U Doing I wan 2 parse XML data in JAVA Application, i found an example which was quite clear but that example uses import javax.xml.parsers.*; But at compile time exception is thrown that this package does not exist, Please tell

  • How to display sqlplus result in java?

    I want to call sqlplus to execute some sql commands in java,but how can i print the result of sqlplus? In java code ,i call sqlplus like: Process p; //execute the command p = Runtime.getRuntime().exec(commandString); //print return result of the comm

  • Oracle 10g Express Service not starting Database

    I have a fresh download and install or Oracle 10gExpress and am having issues when I manually start the OracleXE service. The OracleXE Service starts, but the database does not. The error I see is ora-12560. The database and service stops correctly i

  • Valuated and non valuated stock

    Dear Experts, I have 20 thousand PO i need to identify Valuated and non valuated stock, can any body suggest me  how i will go about this Any standard report is there or from tables ? Thanks Raj