Re: SQL BEFORE puzzle

From: Eric <Eric.Anecho_at_gmail.com>
Date: Fri, 1 Aug 2008 14:57:15 -0700 (PDT)
Message-ID: <8be71a63-4a7b-45e9-b1ed-ed007ecbc2ca_at_27g2000hsf.googlegroups.com>


On Jul 31, 12:18 pm, Roy Hann <specia..._at_processed.almost.meat> wrote:
> This is not a theory question by any means, but perhaps there is someone
> hanging out here who is able to speak with authority on SQL.  We are
> trying to figure out the justification for why a BEFORE trigger should
> be prevented from doing any updates.  The wording we're looking at from
> the standard is:
>
> "If the trigger is a BEFORE trigger and if, before the completion of the
> execution of any <SQL procedure statement> simply contained in triggered
> SQL statements, an attempt is made to execute an SQL-data change
> statement or an SQL-invoked routine that possibly modifies SQL-data,
> then an exception condition is raised: prohibited statement encountered
> during trigger execution."
>
> Obviously one shouldn't expect to be able to update a row that doesn't
> exist yet, but why prevent all updates (to other rows, other tables)?
>
> --
> Roy

Roy,

I won't claim authority but I can't find the sentence you refer to in SQL:2003 nor the latest draft of SQL:2006+ that I have (which is probably not the latest). I haven't looked in the original SQL:1999 standard but I did look up in SQL-99 Complete from Gulutzan & Pelzer and didn't see it either. What are you working from?

Eric Received on Fri Aug 01 2008 - 23:57:15 CEST

Original text of this message