Jean-Francois Leveque wrote:
>
> I want to check something before
> a delete is made.
>
> I made a before delete trigger that
> calls a procedure.
>
> The procedure raises an exception
> when I don't want the delete to be
> made (I could also have returned NULL,
> but wouldn't have get much information
> from it).
>
>
> The question is :
> What do I return when I want the delete to be made ?
>
> If I return OLD (known when deleting), maybe that
> cancels the delete too.
>
> I don't have NEW (known only on insert/update).
>
> I couldn't find the answer in the docs.
Returning OLD from a BEFORE ROW trigger let's the delete happen - no "maybe" here. On AFTER ROW triggers it
doesn't matter what you return, the delete happened already (well, RAISE EXCEPTION will rollback of course).
Jan
--
#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me. #
#================================================== JanWieck@Yahoo.com #
_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com