number of rows affected by report

Hi all

I want to show the number of result rows to a query on a report page. my test query returns 52 sets of data (also when I execute the same statement with select count (*)) but the #TOTAL_ROWS variable # said that 11.
I think it's because I put the value in pagination of row 10...

is there a known issue with this? is #TOTAL_ROWS # only supposed to show the number of lines of recoveries?

Thanks in advance hendrik

Hendrik,

This will not work unless you paging system is set (with pagination). You can always count your rows in a separate process and get this value by using the same SQL as in your report.

Denes Kubicek
-------------------------------------------------------------------
http://deneskubicek.blogspot.com/
http://www.Opal-consulting.de/training
http://Apex.Oracle.com/pls/OTN/f?p=31517:1
-------------------------------------------------------------------

Tags: Database

Similar Questions

  • See the number of rows affected the performance of sqlplus to a sql file

    Hello

    It's just we have a sql file that contains a bunch of select/update/insert statements.

    I have a unix script that calls sqlplus on this sql file. However, at the exit I don't get the number of rows affected.

    Without adding any code in the input sql file, how can I change the code of sqlplus shell script to print the number of rows affected for each statement in the sql file?

    ${ORACLE_HOME}/bin/sqlplus -L >> ${LOG_FILE} 2>&1  << EOF
      ${ORAID}/${ORAPASS}@${ORAINS}
      whenever sqlerror exit sql.sqlcode;
      set echo on;
      set feedback off;
      set serveroutput on;
      @${SQL_FILE};
      exit;
    EOF
    RC=$?
    

    The SQL_FILE of entry content is:

    select 12 "col1" from dual;
    select 'abcd' "col2" from dual;
    select;
    select 13 'col3' from dual;
    

    The result of the race of sqlplus is (LOG_FILE):

    SQL*Plus: Release 11.2.0.2.0 Production on Fri Jun 6 14:28:00 2014
    
    Copyright (c) 1982, 2010, Oracle.  All rights reserved.
    
    Enter user-name: 
    Connected to:
    Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
    With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
    Data Mining and Real Application Testing options
    
    SQL> SQL> SQL> SQL> SQL> SQL> select 12 "col1" from dual;
    
          col1
    ----------
            12
    SQL> select 'abcd' "col2" from dual;
    
    col2
    ----
    abcd
    SQL> select;
    select
         *
    ERROR at line 1:
    ORA-00936: missing expression
    
    
    Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
    With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
    Data Mining and Real Application Testing options
    

    Thank you

    Srinivas - y.

    1. echo setting
    2. Set feedback off;

    use

    Set of feedback on

  • to check the number of rows affected by an update query in a procedure

    Hello
    I want to check the number of rows affected by the update script that I used in a procedure and I shoud be able to use this count towards the end of the procedure.
    How can I do?

    for example:
    create or replace procedure p1 is
    Start
    Update table1 set x = 'a', where y = 'b ';.
    end p1;

    Published by: christele CS on May 1, 2012 22:06

    Hello

    Try the below a...

    create or replace procedure p1 is
    Start
    Update table1 set x = 'a', where y = 'b ';.
    dbms_output.put_line (SQL % ROWCOUNT |) ("Lines updated ');
    end p1;

  • Get number of rows affected in SQLPLUS...

    Hello world
    I have a shell script where I am invoking sqlplus, running a query and save the result in a hold file in .csv format. This file now has a trailer container
    number of selected rows. So, I can not use SQL % ROWCOUNT and I don't know how to get this number.
    Someone gave me an idea of the number of lines of wc file and add it as a trailer, but I can't do it like in the conduct of the trailer I need to display a number that is an oracle
    sequence. The file format will be something like this-

    01, testing, 5667889, 9999999, AXCCRTR1
    000001, TESTSOURCE, 1--> it's the trailer (oracle_seq, constant varchar, not of selected lines)

    Is there a way I can get the number of rows affected by the last query in sqlplus. Any help will greatly be appricaited.
    I can go ahead and do it with Pl/sql, but I'm not leaving until I'm absolutely sure thery no way on this.

    Thank you
    ru

    Add a hidden column rownum to your query and save its last value:

    SQL>set feedback off
    SQL>column rownum new_value num_rows noprint
    SQL>select rownum, object_name, object_type from all_objects where rownum < 7;
    
    OBJECT_NAME                    OBJECT_TYPE
    ------------------------------ ------------------
    /1005bd30_LnkdConstant         JAVA CLASS
    /10076b23_OraCustomDatumClosur JAVA CLASS
    /10297c91_SAXAttrList          JAVA CLASS
    /103a2e73_DefaultEditorKitEndP JAVA CLASS
    /1048734f_DefaultFolder        JAVA CLASS
    /10501902_BasicFileChooserUINe JAVA CLASS
    SQL>prompt &num_rows
    6
    

    HTH, Urs

  • get the number of rows affected by their table top

    Hello, I need to count the number of rows updated in table form. In the process of ApplyMRU, I can use the string substitution #MRU_COUNT # to show the lines updated in a success message, but I need to get this value and store it on a table. Any help would be much appreciated. Thank you.

    oscarjavier99 wrote:

    Hello, I need to count the number of rows updated in table form. In the process of ApplyMRU, I can use the string substitution #MRU_COUNT # to show the lines updated in a success message, but I need to get this value and store it on a table. Any help would be much appreciated. Thank you.

    For that you would benefit from the APEX$ ROW_STATUS integrated substitution string.

    1. create a page element display only (in my case P15_UPDATED_ROWS) Save Session State set to Yes and the Type of Condition is set to never.

    2. Add a calculation after the shows with a Type of static assignment and calculation value 0 to reset the counter whenever the page is sent.

    3. Add an On submit - after calculations and Validations process of PL/SQL page linked to your tabular presentation with a Status of Type PL/SQL Expression and Expression 1 :apex$row_status = 'U' and the code of the following process :

    :p15_updated_rows := :p15_updated_rows + 1;
    

    If you don't actually means "day" in the strict sense, and then change the status of process to include possible APEX$ ROW_STATUS 'C', 'U', and "D" values as needed. If you want to count all created, updated and deleted lines, do not add the condition to the process, but make sure the extended run is set to createand changed lines.

  • Why is the "Number of Rows" to a report seems to be cached in the session?

    When I change the number of lines in a given report, that this change takes effect immediately. After having much poking around and gnashing of teeth - I found that I have to go in managing Session State and the State of deletion for my session before these changes take effect.

    Can someone explain why this setting would be stored in the users session state and why when I login and get a new session_id this setting seems to persist.

    Thank you
    Jason

    You can always put RP in the argument to delete the Session State in the URL - which will reset the pagination. So, if you include that in your URL, it should work.

  • Rows affected the dynamic SQL


    Hello

    VERSION - Oracle9i Enterprise Edition Release 9.2.0.6.0 - 64 bit Production

    I want the number of rows affected by SQL dynamic, as shown below in the code where insert statement will be repeated for each record in the CURSOR.

    for rec in c1
    loop


    ABC: =' insert into test
    Select a.*,' | recomm. OP_ID |', "' | recomm. OP_NAME | " 'of BL_testI' | recomm. OP_ID: ' where START_DATE > = trunc(sysdate-2) and START_DATE < trunc(sysdate-1)';

    insert into str_test values (abc);

    immediately run abc;

    commit;

    When exit c1% notfound;
    end loop;

    In a normal query I would do it spontaneously SQL COUNT but cannot use it here.

    Thnx in advance

    Just use SQL % ROWCOUNT. What is the problem with that?

    Here is an example.

    SQL > declare
    l_sql 2 varchar2 (4000);
    3. start
    4 l_sql: = ' insert into t select * from emp';
    5. immediately run l_sql;
    6 dbms_output.put_line(l_sql ||) ': Number of inserted rows = ' | to_char(SQL%RowCount));)
    7 end;
    8.

    insert into t select * from EMP: number of inserted rows = 11

    PL/SQL procedure successfully completed.

    SQL >

  • Classic report limit the number of rows displayed

    Hi all

    In my application, I have a classic report that displays data from a simple query. For layout reasons, I want to limit the number of display 5 instead of the default value 15. I looked in several forums and they told me that I have to set the number of lines in the report attributes.

    But it doesn't have what I want. I'm using APEX 4.1.0 on Oracle 11 G database

    My question is: How can I limit the maximum number of lines in a classic SQL report.

    Hamertje16 wrote:
    I tried already to 5 the number of lines and number of lines (point).

    Do not set anything in number of lines (point). This is used to identify an element of the page containing the number of lines to allow users to control it. Remove * 5 * from here.

  • APEX variable for the number of lines of standard report?

    Hi people!

    Pagination to any report APEX, there is this "X-Y-Z" option, with Z showing the number of selected lines. I need this "Z".

    In my report, I have several filter options, and I would like the user to get feedback on the number of rows is selected as "X / Y", with there being a number calculated in advance and X number of rows returned. Now I was run all of the report a second time, by storing the count (*) result in a page item, but if there is a variable that already exist in the APEX (for paging) that would no doubt make things a little easier. I havn't found anything still looking, but more probably, one of the experts here knows how to access this value.

    Thanks and regards,

    Tobi

    You are supposed to be able to get the required information using the #TOTAL_ROWS # and #LAST_ROW_FETCHED # substitution string in the footer region.

    Note that for #TOTAL_ROWS # to work the report must use a paging system that calculates the total number of rows, for example "line ranges X y z (with pagination).

    However, the #FIRST_ROW_FETCHED # and #LAST_ROW_FETCHED # currently no change when I test it. These substitution strings are not compatible with the mechanism of updating now used partial page for pagination of reports, either this is a bug.

  • How to display 30 rows in a report

    Hello

    I use apex.oracle.com to generate a report.

    the report contains 30 rows and tried many things to show all lines without clicking then.

    How can I get it.

    Thanks in advance.

    Chanran

    Hi Chavigny,

    > number 20 lines

    Change the above to any number or assign it so that it displays all of the rows in the report.

    Brgds,
    Mini

    ------------------------
    Mark responds promptly

  • Text box layout problem - and the number of rows displayed

    Hello

    Wonder if you can help with my 2 problems

    1. when I create text boxes, the label is displayed to the left of the text box. How can I display label above the text box
    CGH

    Label
    TextBox

    Instead of

    Text box label

    2. when I ask report showing my data, that it shows that 15 records per page, for the next set of records, I need to click on the following icon at the bottom of the table to go to the next page.
    How can I view all on the same page?

    Thanks for help

    1. simply check this using the Horizontal / Vertical alignment of attribute in the section of the label of the element of the Page definition.

    2. in the report of the attributes, the value of the plan of paging None; and the number of rows and number of maximum lines to more than the number of rows that will be returned by the report query.

    (You should only ignore this last you really know that the number of lines make this a reasonable option.) Nobody is going to want to scroll through thousands of lines or wait 5 minutes for total information overload. You wouldn't be popular with your admins/ISP network due to the excessive bandwidth consumed either.)

  • How to determine the number of rows in the database and save the result to a local variable?

    Hello

    I'm a newbie in the use of TestStand, databases and SQL, and now I've met difficulties. I use TestStand 2014 (32 bit).

    I have a need to know the number of rows in a database and save that number in a local variable. I tried to practice using the database of the Types of step provided with TS. I tried to use the following in a SQL statement:

    Locals.NumberOfRows = ("SELECT COUNT (*) FROM TEST_TABLE")

    It returns an error: specified value is not the expected type. My goal is possible in this way, or I'm doing this completely wrong?

    -RautSa

    Thank you for your response, Norbert. I have a database of who wins new values at random, and sometimes I need the exact number of rows in this table.

    I managed to achieve my goal by using the SQL statement: "SELECT COUNT (*) as Rowcount OF TEST_TABLE", followed by a data GET operation, which records that number of lines in a local variable.

    -RautSa

  • Export of DataPump API - number of rows exported using

    Hello

    I'm working on the procedure to export data in the table before deleting the partition. It will be run by the Scheduler of the data, that's why I want to run the datapump job using the API.

    I wonder, if it is possible to get the number of rows exported. I would compare with the number of rows in a partition before you delete the partition.


    Thank you

    Krystian

    Hello

    Don't know exactly how you want the number of rows per partition that have been exported, but here are a few ideas:

    1. create a log file by using 'add_file ':

    -Add a log file

    dbms_datapump.add_file (h, ' DEPTJOB.log ', a', NULL,)

    dbms_datapump.Ku$ _file_type_log_file);

    It is also in my example included below.  Here is the content after the DEPTJOB.log workload (situated in Oracle Directory object would be "in my example):

    $ cat /tmp/DEPTJOB.log

    Departure 'SCOTT '. "" DEPTJOB ":

    Object type TABLE_EXPORT/TABLE/TABLE processing

    Processing object type TABLE_EXPORT/TABLE/TABLE_DATA

    . . "exported"SCOTT" DEPT': 'SYS_P1581' 5,929 KB 2 lines

    . . "exported"SCOTT" DEPT': 'SYS_P1582' 5,914 KB 1 lines

    . . "exported"SCOTT" DEPT': 'SYS_P1583' 5,906 KB 1 lines

    Table main 'SCOTT '. "' DEPTJOB ' properly load/unloaded

    ******************************************************************************

    Empty the files together for SCOTT. DEPTJOB is:

    /tmp/Dept.dmp

    Job 'SCOTT '. "" DEPTJOB "managed to 00:00

    You can then review or extract the information from the log file.

    2. save the master table and the query for the busy lines.

    Use the parameter "KEEP_MASTER":

    -Keep the main table to be deleted after employment ends

    dbms_datapump.set_parameter(h,'KEEP_MASTER',1);

    Here's my example, the request to the main table is at the end.

    $ sqlplus scott/tiger @deptapi

    SQL * more: version 12.2.0.0.2 Beta on Fri Jan 22 12:55:52 2016

    Copyright (c) 1982, 2015, Oracle.  All rights reserved.

    Last successful login time: Friday, January 22, 2016 12:55:05-08:00

    Connected to:

    Database Oracle 12 c Enterprise Edition Release 12.2.0.0.2 - 64-bit Beta

    With the options of partitioning, OLAP, advanced analytics and Real Application Testing

    Connected.

    SQL > SET FEEDBACK 1

    SQL > SET 10 NUMLARGEUR

    SQL > SET LINESIZE 2000

    SQL > SET TRIMSPOOL ON

    SQL > SET TAB OFF

    SQL > SET PAGESIZE 100

    SQL > SET SERVEROUTPUT ON

    SQL >

    SQL > Rem save on the old table of scott.dept

    SQL > dept and rename it dept_old.

    Renamed table.

    SQL >

    SQL > Rem re-create it with partitions

    SQL > CREATE TABLE dept (deptno NUMBER varchar (14) dname, loc varchar (13)) PARTITION INTO 3 PARTITIONS HASH (deptno)

    2.

    Table created.

    SQL >

    SQL > Rem fill the dept table

    SQL > insert into dept select * from dept_old;

    4 lines were created.

    SQL >

    SQL > Rem now create datapump job export SCOTT. DEPT. using the API

    SQL > DECLARE

    2: NUMBER;         -Handle Datapump

    3 jobState VARCHAR2 (30);   -To keep track of job status

    4 ind NUMBER;         -Index of the loop

    5 the ku$ _LogEntry;   -For error messages and work in PROGRESS

    6 js ku$ _JobStatus;  -The State of the work of get_status

    7 jd ku$ _JobDesc;    -The get_status job description

    8 m ku$ _Status;     -The status returned by get_status object

    9 sql_stmt VARCHAR2 (1024);

    nom_partition 10-VARCHAR2 (50);

    11 rows_completed NUMBER;

    12

    BEGIN 13

    14-

    15 run the Installer based on the operation to perform.

    16-

    17 h: = dbms_datapump.open ('EXPORT', 'TABLE', NULL, 'DEPTJOB', NULL);

    18 dbms_datapump.add_file (h, 'dept.dmp', 'd', NULL,

    dbms_datapump.Ku$ _file_type_dump_file 19, 1);

    20

    21    --- Add a logfile                                                         

    22 dbms_datapump.add_file (h, ' DEPTJOB.log ', a', NULL,)

    23 dbms_datapump.ku$ _file_type_log_file);

    24

    25 dbms_datapump.metadata_filter (h, 'SCHEMA_EXPR', ' IN ("SCOTT") ");

    26 dbms_datapump.metadata_filter (h, 'NAME_LIST', "'DEPT"');

    27

    28

    29-

    30 start work.

    31-

    32 dbms_datapump.set_parameter (h, 'SILENT', 'banner');

    33

    34 -keep the main table to be deleted after employment ends

    35 dbms_datapump.set_parameter(h,'KEEP_MASTER',1);

    36

    37 dbms_datapump.start_job (h);

    38

    39-

    40 - run to grabbing the output of the job and write in the output log.

    41-

    42 jobState: = "UNDEFINED";

    43 WHILE (jobState! = "COMPLETED") AND (jobState! = "STOPPED")

    44 LOOP

    45 dbms_datapump.get_status (h,

    dbms_datapump.Ku$ _status_job_error 46.

    dbms_datapump.Ku$ _status_wip 47, -1, jobState, m);

    48

    49      --

    50. If we received messages WIP or error for the work, display them.

    51      --

    52 IF (BITAND(sts.mask,dbms_datapump.ku$_status_wip)! = 0)

    53 THEN

    54: = sts.wip;

    55 ON THE OTHER

    56 IF (bitand(sts.mask,dbms_datapump.ku$_status_job_error)! = 0)

    57 THEN

    58: = sts.error;

    59 ON THE OTHER

    the 60: = NULL;

    61 END IF;

    62 END IF;

    63

    64 the IS NOT NULL IF

    65 THEN

    66 ind: = the. FIRST;

    67 then AS ind IS NOT NULL

    68 LOOP

    69 dbms_output.put_line ((ind). LogText);

    70 ind: = the. Next (IND);

    LOOP END 71;

    72 END IF;

    73 END LOOP;

    74

    75-

    76 - release work.

    77-

    78 dbms_datapump.detach (h);

    79

    80-

    81. all exceptions that spread at this point will be captured.

    82 - the details are extracted from get_status and displayed.

    83-

    EXCEPTION OF 84

    85, SO THAN OTHERS THEN

    BEGIN 86

    87 dbms_datapump.get_status (h,

    dbms_datapump.Ku$ _status_job_error, 0-88,.

    89 jobState, sts);

    90 IF (BITAND(sts.mask,dbms_datapump.ku$_status_job_error)! = 0)

    91 THEN

    the 92: = sts.error;

    93 the IS NOT NULL IF

    94 THEN

    95 ind: = the. FIRST;

    96 although ind IS NOT NULL

    LOOP OF 97

    98 dbms_output.put_line ((ind). LogText);

    99 ind: = the. Next (IND);

    100 END LOOP;

    101 END IF;

    102 END IF;

    103

    BEGIN 104

    105 DBMS_DATAPUMP. STOP_JOB (m, 1, 0, 0);

    EXCEPTION OF 106

    107. WHEN OTHER NULL THEN;

    END 108;

    109

    110 EXCEPTION

    111, SO THAN OTHERS THEN

    112 dbms_output.put_line ('ORA-00000: an unexpected exception during ' |)

    113 ' Manager of exceptions. ' ||

    114 ' sqlcode = ' | TO_CHAR (SQLCODE));

    END 115;

    END 116;

    117.

    Departure 'SCOTT '. "" DEPTJOB ":

    Object type TABLE_EXPORT/TABLE/TABLE processing

    Processing object type TABLE_EXPORT/TABLE/TABLE_DATA

    . . "exported"SCOTT" DEPT': 'SYS_P1581' 5,929 KB 2 lines

    . . "exported"SCOTT" DEPT': 'SYS_P1582' 5,914 KB 1 lines

    . . "exported"SCOTT" DEPT': 'SYS_P1583' 5,906 KB 1 lines

    Table main 'SCOTT '. "' DEPTJOB ' properly load/unloaded

    ******************************************************************************

    Empty the files together for SCOTT. DEPTJOB is:

    /tmp/Dept.dmp

    Job 'SCOTT '. "" DEPTJOB "managed to 00:00

    PL/SQL procedure successfully completed.

    SQL >

    SQL > table main query Rem for number of lines completed

    SQL > column nom_partition format a10

    SQL > format 9999 column lines

    SQL > SELECT nom_partition, COMPLETED_ROWS FROM SCOTT . DEPTJOB WHERE BASE_OBJECT_NAME = "DEPT";

    PARTITION_ COMPLETED_ROWS

    ---------- --------------

    SYS_P1581 2

    SYS_P1583 1

    SYS_P1582 1

    3 selected lines.

    SQL >

    SQL > "EXIT";

    3. you might even extract information of the call from the command line:

    $ sqlplus scott/tiger @deptapi.sql | grep 'exported ' | AWK ' {print "Table:" $4, 'charge' $7, $8} '

    Table: 'SCOTT '. "" DEPT ":"SYS_P1581"loaded 2 rows

    Table: 'SCOTT '. "' DEPT ': 'SYS_P1583' loaded 1 lines

    Table: 'SCOTT '. "' DEPT ': 'SYS_P1582' loaded 1 lines

  • number of rows in the table

    Hi master,

    I have a requirement. During the passage of a table, I need to get the number of rows in this table. Sometimes, when I spend 2 or more table names, I need to get the same count of result of lines. I got the below function. but it shows all the rows in the table. I want pariticular tabels only. How I can I get it.

    Select table_name, num_rows from all_tables where table_name in ('EMP', 'Department');  I tried.  I need to a procedure or function. who will pass the name of the table as a parameter and 1 or more than the name of a table if I pass, I need to display information from table name and number of lines.

    CREATE OR REPLACE

    TYPE t1_obj AS OBJECT)

    table-name VARCHAR2 (30),

    CNT NUMBER

    )

    /

    CREATE OR REPLACE

    TYPE t1_obj_tbl AS THE t1_obj TABLE

    /

    CREATE OR REPLACE

    FUNCTION (f1)

    p_schema_name VARCHAR2

    )

    RETURN t1_obj_tbl

    PIPELINED

    IS

    v_retval t1_obj: = t1_obj (null, null);

    BEGIN

    FOR v_rec IN (SELECT table_name FROM dba_tables where owner = upper (p_schema_name) and nvl (iot_type, 'X')! = "IOT_OVERFLOW") LOOP

    v_retval.table_name: = v_rec.table_name;

    RUN IMMEDIATELY "SELECT COUNT (*) FROM" | p_schema_name | '.' || v_rec.table_name

    IN v_retval.cnt;

    PIPE ROW (v_retval);

    END LOOP;

    RETURN;

    END;

    Select * from table (f1 ('scott'));

    The above function returns information from the table in SCOTT scheama. I need only perticular table info.

    Please notify.

    AR.

    Hi Sven,

    Front end people ask me the requirement. They wanted a proc or function as I want.

    Please help me.

    Concerning

    AR

  • Count the number of rows in a table (s)

    Hi all

    I have a TKT_PRIORITY_LK table that I want to count the number of rows returned by a priority level... say Low, Medium, High, critical. I want to be able to count how many of each created are they, instead returning ID instead, if making any sense... Can you please help with this.

    Example; Select count (*) in TKT_PRIORITY_LK

    PRIORITY group

    Kind regards

    Sandrine

    Try this

    Select a.PRIORITY, count (*) from TKT_PRIORITY_LK a, TKT_TICKET_MAIN b

    where a.id = b.PRIORITY_ID

    A.PRIORITY group

Maybe you are looking for

  • Snafu at the Bootloader unlock in Xperia Ray

    Dear friends, I read all the discussions, blog & forum to unlock the bootloader... After try was long I found a few tools to unlock. But it does not work... See the screenshot below & help to proceed forward :/

  • B9180 will only print b &amp; w!

    Hello I am trying to print a print in color, but he released under the name b & w. % The lowest for cartridges is 33%, most are around 80%. Any ideas please? See you soon Geoff

  • Fujitsu fi-7160 paperstream IP - freezes when parsing

    Does anyone know of any problems with the new scanner Fujitsu fi-7160. We have recently updated for this scanner and I noticed that it is now using an IP Twain driver VS. the standard Twain driver paperstream. Every now and then the Remote Scan app w

  • Cannot open JP2 and corrupt JPG photos

    Hi all The photos I made four years ago now seem not.  I try to open these JP2 and JPG photos but cannot.  Is there a way to easily change the properties of these by copying and using "save under" and pointing to a new type of file?  If possible, how

  • Connect to Microsoft account

    Separated from this thread. No I can't yet sign on my microsoft account