Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: 7813 trigger tribulations

Re: 7813 trigger tribulations

From: Daniil Fishteyn <daniilf_at_hotmail.com>
Date: Thu, 21 Jan 1999 20:26:14 -0500
Message-ID: <36A7D3B6.85322181@hotmail.com>


You can try to return exception - this will work for sure.

krose_at_athena.nwafc.nf.ca wrote:

> Ahhhh - im having a heap of trouble. (bear with me - im a virgin trigger
> writer !!)
>
> Im trying to write a trigger on INSERT such that the insert will be cancelled
> should a reecord satisfying certain conditions exist:
>
> CREATE OR REPLACE TRIGGER
> BEFORE INSERT FR_COMMON_DETAILS
> FOR EACH ROW
>
> BEGIN
> IF ((SELECT COUNT(*) FROM FR_COMMON_DETAILS WHERE ......) = 0) then
> return true; *****
> ELSE
> return false; *****
> END IF;
>
> END;
> ***** basically i dont know what to return here such that the insert will be
> cancelled or to permit it to go ahead??? Im not even sure how to return or if
> there is a form of return. How do I correctly write the lines marked with
> *****.
>
> Any help greatly appreciated.
>
> -----------== Posted via Deja News, The Discussion Network ==----------
> http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
Received on Thu Jan 21 1999 - 19:26:14 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US