Re: help : report 2.0

From: Alvin Law <alaw_at_oracle.com>
Date: 3 Jan 95 14:32:29
Message-ID: <ALAW.95Jan3143229_at_ap226sun.oracle.com>


In article <3dtt02$dfb_at_garlic.com> kopari_at_garlic.com (Les Kopari) writes:

> S H CHUA (shchua_at_technet.sg) wrote:
> : I need to print a list of customers which satisfy a condition, say
> : comply_flag = 'Y'.
> : To check whether the customer is to be included in the report, I need a
> : program unit to determine the value of the comply_flag using cursors and
> : some complicated checks against other tables. ( i just can't think of a
> : single select statement to pick out customers with comply_flag='Y')
 

> : How do I write the query to retrieve only customers with comply_flag='Y'?
>
> select customer
> from customers
> where comply_flag='Y';

If I read the original poster correctly, comply_flag is not a database column and can only be derived "using cursors and some complicated checks against other tables".

If the complex check cannot build into the query (the prefered approach for performance), you can use a format trigger on the repeating frame around the customer group. The format trigger will contain PL/SQL code and should return TRUE is the condition is satisfied, FALSE otherwise.

With Oracle 7.1, you maybe able to do something like this:

select customer_name
  from customers
 where 'Y' = customer_check(customer_id);

where customer_check is a function returning VARCHAR2.

--
      ___
     (o o)
+-oo0-\_/-0oo---------------------------------------------------------------+
| Alvin Law .. Project Leader, Applications Division ... Oracle Corporation |
|  Email: alaw_at_us.oracle.com ..... Voice: 415.506.8317 . Fax: 415.506.7299  |
+---------------------------------------------------------------------------+

ORA-03113: end-of-file on communication channel
Received on Tue Jan 03 1995 - 14:32:29 CET

Original text of this message