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

Home -> Community -> Usenet -> c.d.o.misc -> Re: SQL SERVER TRIGGER TRANSLATION

Re: SQL SERVER TRIGGER TRANSLATION

From: Daniel Morgan <dmorgan_at_exesolutions.com>
Date: Wed, 26 Jun 2002 19:18:34 GMT
Message-ID: <3D1A136F.F51EB662@exesolutions.com>


TurkBear wrote:

> Oracle triggers are VERY different from SqlServer ones...
> Read the docs on the various types
> ( BEFORE,AFTER,INSTEAD OF) (UPDATE,DELETE,INSERT)
> and replicate your logic, not your syntax in Oracle speak...
>
> hth
>
> Fred Burlaud <fburlaud_at_com6.fr> wrote:
>
> >Hello,
> >
> >I fail in translating this sql server trigger with the oracle syntax
> >especially on the syntax "from inserted"
> >
> >thank you ;o)
> >Fred
> >
> >
> >CREATE TRIGGER TR_UPDATE_ResAppelHisto
> > ON ResAppelHisto
> > FOR UPDATE
> > NOT FOR REPLICATION
> >
> > AS
> > IF UPDATE(ResAppel)
> > BEGIN
> > DECLARE @cpResAppel int
> > SELECT @cpResAppel = ResAppel FROM inserted
> > UPDATE Trig_ResAppelStat SET Cpt=Cpt+1 WHERE ResAppel =
> >@cpResAppel
> > END
>
> -----------== Posted via Newsfeed.Com - Uncensored Usenet News ==----------
> http://www.newsfeed.com The #1 Newsgroup Service in the World!
> -----= Over 100,000 Newsgroups - Unlimited Fast Downloads - 19 Servers =-----

TurkBear is absolutely correct. If you approach Oracle the way you are doing it you are going to quickly determine that Oracle is a product incapable of doing anything well ... which is clearly not the case. You need to spend as much time unlearning TSQL as you do learning PL/SQL. Similarity between the two products ends at the superficial level except in M$ advertising.

Daniel Morgan Received on Wed Jun 26 2002 - 14:18:34 CDT

Original text of this message

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