[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

record count

Posted on 2005-04-29
5
Medium Priority
?
1,018 Views
Last Modified: 2010-04-12
I am using execute_query to display records in block and i want to display the total of record displayed is there any bulid in command for my question.
0
Comment
Question by:rana_m
5 Comments
 
LVL 14

Expert Comment

by:Muhammad Ahmad Imran
ID: 13900203
Select count(*) from your_table_name;
0
 
LVL 8

Expert Comment

by:sapnam
ID: 13901240
You can have a display item in your form.  After doing execute_query, then you have to code select count(1) into :item_name from table;
0
 
LVL 4

Expert Comment

by:kripa_odba
ID: 13902875
Try to use this command.....

INSCNT := sql%rowcount;


which will assign the number of records affected by ur operation to a variable.   You can use this variable to display the number of records affected.The sql%rowcount is a predefined implicit cursor variable frm where you can find the number of records affected by ur operation......

regds


0
 

Author Comment

by:rana_m
ID: 13902903
I have tried all the three answers. Thanks for sending but all didn't work.
I don't want to display the number of records in the table.
I want to count the total records display by execute_query for a certian condition. Not all the records displayed.
I tired the thired answer but still it didn't work.
0
 
LVL 13

Accepted Solution

by:
riazpk earned 150 total points
ID: 13904048
use count_query built-in:'


from documentation:

In an On-Count trigger, performs the default Form Builder processing for identifying the number of rows that a query will retrieve for the current block, and clears the current block.  If there are changes to commit in the block, Form Builder prompts the end user to commit them during COUNT_QUERY processing.  Form Builder returns the following message as a result of a valid call to COUNT_QUERY:

FRM-40355:  Query will retrieve <number> records.

This built-in is included primarily for applications that will run against a non-ORACLE data source.

Syntax

PROCEDURE COUNT_QUERY;
Built-in Type   restricted procedure
Enter Query Mode  yes

Parameters

none


Count_Query Examples
---------------------------


Example 1

/*  

** Built-in:  COUNT_QUERY
** Example:   Display the number of records that will be retrieved
**            by the current query.
*/
BEGIN
  Count_Query;
END;

Example 2

/*  
** Built-in:  COUNT_QUERY
** Example:   Perform Form Builder count query hits processing.
**            Decide whether to use this Built-in or a user
**            exit based on a global flag setup at startup by
**            the form, perhaps based on a parameter.
** Trigger:   On-Count
*/
BEGIN
  /*
  ** Check the global flag we set during form startup
  */
  IF :Global.Using_Transactional_Triggers = 'TRUE' THEN
    /*
    ** User exit returns query hits count back into the
    ** CONTROL.HITS item.
    */
    User_Exit('my_count');
    /*
    ** Deposit the number of query hits in the appropriate
    ** block property so Form Builder can display its normal
    ** status message.
    */
    Set_Block_Property(:System.Trigger_Block,QUERY_HITS,
                     :control.hits);
  /*
  ** Otherwise, do the right thing.
  */
  ELSE
    Count_Query;
  END IF;
END;
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Working with Network Access Control Lists in Oracle 11g (part 2) Part 1: http://www.e-e.com/A_8429.html Previously, I introduced the basics of network ACL's including how to create, delete and modify entries to allow and deny access.  For many…
Cursors in Oracle: A cursor is used to process individual rows returned by database system for a query. In oracle every SQL statement executed by the oracle server has a private area. This area contains information about the SQL statement and the…
Via a live example show how to connect to RMAN, make basic configuration settings changes and then take a backup of a demo database
This video shows how to configure and send email from and Oracle database using both UTL_SMTP and UTL_MAIL, as well as comparing UTL_SMTP to a manual SMTP conversation with a mail server.
Suggested Courses
Course of the Month19 days, 13 hours left to enroll

872 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question