Re: Forms: SELECT returns 1 or 0

From: Leo Mannhart <mannhart_at_zuv.unizh.ch>
Date: Thu, 7 Jul 1994 08:05:23 GMT
Message-ID: <mannhart-070794090523_at_zuvmaclm.unizh.ch>


In article <CsJ8xH.Avp_at_undergrad.math.uwaterloo.ca>, aarhemtu_at_cayley.uwaterloo.ca (Anil) wrote:

> In and using FORMS 4 with Oracle 7.
>
> In one of my blocks I am trying to create a trigger to load a phone
> number based upon the office in the block. So I created a "POST-QUERY"
> trigger as follows:
>
> SELECT phone_number
> INTO :my_block.phone_number
> FROM phone_table
> WHERE office = :my_block.office;
>
>
> This works great, except that some offices do NOT have phone numbers. So,
> the select state does not return anything. I would like the phone number
> item to remain empty in these cases yet I get an Oracle Forms error telling
> me that NO_DATA_FOUND.
>
>
> Help.
>
>
> Thanks,
> Anil

You can set the system_message_level to 5 before the select statement and reset it to 0 after the statement
or
make a PL/SQL block
begin
  select
  ...
exception when no_data_found then
  null ; -- or message('No phone#')
end ;

Hope this helps
LM

-- 
Leo Mannhart
Planning Office
University of Zurich               phone: ++41 1 257 23 34
Kuenstlergasse 15                    fax: ++41 1 257 22 12
CH-8001 Zurich, Switzerland        eMail: mannhart_at_zuv.unizh.ch
Received on Thu Jul 07 1994 - 10:05:23 CEST

Original text of this message