Re: Yukon and "BEFORE" triggers??

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Steve Kass (skass_at_drew.edu)
Date: 09/10/04


Date: Fri, 10 Sep 2004 15:50:22 -0400

I see. The Oracle functionality is not part of the SQL standard, as far as
I know, at least in terms of changing the "new" rows. The ability to have
triggers work on each row is a part of the SQL-99 standard, but I guess it's
a question of whether you want something proprietary and convenient, or
something that conforms, but not fully, to the standard...

SK

"Toby Herring" <therring*@*teletrack.com> wrote in message
news:e2hjNt0lEHA.2948@TK2MSFTNGP11.phx.gbl...
>I can think of two benefits off the top of my head.
>
> In some instances, it would be nice to be able to alter the contents of
> the [inserted] table in the trigger, and have the modified contents end up
> in the DB instead of having to perform an update directly on the real
> table. (Semantics, I know, but in some cases it just "feels" better.)
>
> Another useful effect would be the ability to throw an exception in the
> trigger, preventing an insert from ever happening, which would (possibly)
> prevent a "skipped" value in an identity column. Whereas now, the insert
> happens (identity assigned) then you throw an exception in the trigger,
> which rolls back the insert, but leaves the assigned identity unused.
>
> --
> Toby Herring
> MCDBA, MCSD, MCP+SB
> Need a Second Life?
> http://secondlife.com/ss/?u=03e0e5b303c234bf08e80ee40119a65e
>
>
> "Steve Kass" <skass@drew.edu> wrote in message
> news:%231D969zlEHA.2820@TK2MSFTNGP15.phx.gbl...
>> Hitchhiker,
>>
>> If you want to "simply tweak the data," how will a BEFORE trigger help?
>> The trigger code executes before the insert/update/delete, but I didn't
>> think it could change anything about the subsequent modification -
>> INSTEAD OF triggers are the way to do that, aren't they? It would be
>> handy to be able to check things before a modification, or short of
>> having BEFORE triggers, to be able to defer constraint checking until
>> after a DML statement, which would make INSTEAD OF triggers more useful.
>>
>



Relevant Pages

  • Re: Has anyone noticed?
    ... Gawd, Taysseer never triggers until ... Ahmed justifys the atomic profession mercilessly. ... It's very standard today, I'll object by no means or Ayman will ...
    (sci.crypt)
  • Re: Zombie handles when trapped by a signal
    ... You end up getting the same as the standard $SIGbehavior, ... the alarm never triggers. ... timeout triggers, retry a "select 1". ... >> One problem is in the timeout handling in Perl. ...
    (perl.dbi.users)
  • Re: Trigger Help
    ... Good - finally got there - you admit you would use triggers so your statement "you should write less than 10 triggers..." ... Now - on the deferred constraint issue, I just checked and DB2 does not have them - post the URL if you want to debate that, the behavior is quite clearly defined by the standard - perhaps you ought to go back and read it. ... procedure or trigger they work the same way with regard behavior of the deferred constraint because they both need to be in a transaction; or are you advocating that the stored procedure is not done in a transaction in which case what happens when it fails half way thru because of deadlocks which the nested sets solution suffers badly from if there are lots of updates to the node position structures left/right. ...
    (microsoft.public.sqlserver.programming)
  • Re: Enforcing functional dependecy constraints
    ... > If it's elementary, and there's a standard answer, and the standard answer ... I saw something about functional dependecies in the SQL standard. ... >> c)Rwith some triggers ... Some DBMS implement the declarative constraints with triggers anyway :-) ...
    (comp.databases.theory)
  • Exception when accessing ActiveData member
    ... And sometimes I have an exception like this: ... triggers 2 times with the following reasons: ... plDataReasonIsIncludedChange ...
    (microsoft.public.office.developer.web.components)