Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to get the number of record fectched by query

Status
Not open for further replies.

roseMay

Programmer
Mar 11, 2005
17
CA
I have a report, user want it to popup a message if there is no records in this report, I'd like to perfome it using Before Report Trigger, but how could I get the number of record fectched by query?

Thanks a lot!
 
You will need to repeat the report query in the trigger and count its output into a variable. Something like;
Code:
function BeforeReport return boolean is
v_count Number:=0;
begin
select count(*) from
[b][the report query repeated here][/b]
into v_count;
  return (TRUE);
end;
 
Hai,
U can add a summary field item and set its property to count of primary key field (or any field of not null data type) of the query.
ex. summary item name : cnt
set the properties of cnt as:
function : count
source : id (any not null column of the query)
resetat : Report

Now U can check the 'cnt' in the before trigger .
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top