Results 1 to 3 of 3
  1. #1
    Join Date
    Sep 2004
    Location
    Toronto, ON Canada
    Posts
    2

    Record counts in a Form data block

    Hi,
    How do I get the record count from a data block in Oracle Forms?

    Thanks,

    Rushdi

  2. #2
    Join Date
    Jan 2004
    Location
    Croatia, Europe
    Posts
    4,009
    As Anacedent would say ... RTFM

    Online Forms Builder Help offers you, for example, COUNT_QUERY built-in. Play with it a little bit ...

    Or, you could also write a code by yourself:
    Code:
    declare 
      cnt number := 1;
    begin
      go_block('your_block');
      first_record;
    
      while :system.last_record = 'FALSE' 
      loop
         cnt := cnt + 1;
         next_record;
      end loop;
      
      message('There are ' || cnt || ' records in this block');
    end;
    Both have to be used in / called from triggers that allow use of restricted procedures.

  3. #3
    Join Date
    Jun 2004
    Location
    Liverpool, NY USA
    Posts
    2,434
    And one thing to remember, unless you specify all records on the execute query, the count returned by COUNT_QUERY or counting the blocks might be a sub-set of the total rows.
    Bill
    You do not need a parachute to skydive. You only need a parachute to skydive twice.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •