Re: Forms: SELECT returns 1 or 0

From: Paul Berger <pberger_at_nic.hookup.net>
Date: 7 Jul 1994 08:55:35 -0400
Message-ID: <2vgu07$ccc_at_nic.hookup.net>


In article <mannhart-070794090523_at_zuvmaclm.unizh.ch>, Leo Mannhart <mannhart_at_zuv.unizh.ch> wrote:
>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

...this is how I would approach this problem too... PB Received on Thu Jul 07 1994 - 14:55:35 CEST

Original text of this message