Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Oracle Reports Developer - Before Report Trigger
I'm working in Oracle 9i Reports Developer. I have two queries that are
the source for one of my reports. These two queries are connected by
two "data links". Each "Data link" connects 1 column from "Query #1" to
another column in "Query #2". I want to create a "Before Report" report
trigger that checks whether there are records returned from my report
source, if no records are returned I will spit out a message to the
user letting them know that the report contains no data. I understand
how you would normally do this when you have 1 basic simple query with
no data links, then it's pretty easy. You would just run the same sql
statment that was the report data source, but my report data source is
made up of two queries that are connected by two data links. Normally
you'd just have something similiar to the following:
function BeforeReport return boolean is
v_count Number:=0;
begin
select count(*) from table_a into v_count; if v_count = 0 then
return (FALSE);
end if;
return (TRUE);
end;
Questions:
(1) Is there some way to reference "this" report object so I can get
the sql that is generated from my two sql queries and two data links so
I can put it in a string variable to run the sql that way?
(2) Or do I have to find a equivalent single SQL statement of what ever
sql is generated from the two sql queries and two data links?
If this is so, could you lead me in the right direction. My two
datalinks are described below