Re: SQL%notfound

From: <champs_at_cnb07v.hhcs.gov.au>
Date: 15 Jun 93 09:11:44 +1000
Message-ID: <1993Jun15.091144.1_at_cnb07v.hhcs.gov.au>


In article <1993Jun14.203828.20224_at_news.unomaha.edu>, moswald_at_cwis.unomaha.edu (Mike Oswald) writes:
> I thought by writing the following it would prevent the user from deleting
> records if the record exists in a related table but it doesn't work. The
> coded segment can be found in SQL*Forms v3, KEY-DELREC trigger.
>
> declare
> cursor CNV_CUR is
> SELECT *
> FROM <table_1> a
> WHERE a.field = :<block>.<field> ;
> begin
> if SQL%notfound then

SQL%notfound is for IMPLICIT cursors, not explicit cursors, as used here. For explicit cursors use

        <cursor name>%notfound

eg. CNV_CUR%notfound

> delete_record ;
> else
> <blah>
> end if ;
> end ;

-- 
-----------------------------------------------------------------------------
    /\       Steven Champness (champs_at_cnb07v.hhcs.gov.au)
   /  \      Dept of Health, Housing, Local Govt and Community Services
  /    \     Brisbane, Queensland via Canberra, Australia
 /      \    
/   /    \   The opinions expressed above were forcibly implanted in my head
\  / /   /   by aliens from Alpha Zeltex 4, during a recent Invasion attempt.
 \/ / / /    
  \/ / /     MACINTOSH      : If you need a manual to operate it, it wasn't
   \/ /      SOFTWARE AXIOM : designed properly in the first place !!!!
    \/
Received on Tue Jun 15 1993 - 01:11:44 CEST

Original text of this message