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: Triggers from SQL SERver to Oracle

Re: Triggers from SQL SERver to Oracle

From: Daniel Morgan <dmorgan_at_exesolutions.com>
Date: Thu, 19 Sep 2002 15:22:21 GMT
Message-ID: <3D89EBA9.1C433685@exesolutions.com>


Rich D wrote:

> I have a bunch of triggers in SQl Server that I need to move over to
> Oracle 8i.
>
> But when I run it in Sql Plus I get nowhere. Any thoughts on why this
> doesn;t work or general syntax differences (declaring variables, etc)
> between SQl Server and Oracle
>
> my trigger is:
>
> CREATE TRIGGER InsertSeries ON dbo.Survey_Series
> FOR INSERT
> AS
> DECLARE
> @Prevmax_id int,
> @Survey_series_id int
>
> SELECT @Prevmax_id = 0
>
> SELECT @Survey_series_id = Survey_series_id FROM inserted
>
> SELECT @Prevmax_id = MAX(Survey_Series.Survey_series_sequence_id)
> FROM Survey_Series
>
> UPDATE Survey_Series SET
> Survey_series_sequence_id = @Prevmax_id + 1,
> Update_datetime = getdate() ,
> Update_username = app_name()
> WHERE Survey_series_id = @Survey_series_id
>
> Thanks,
> rdalfonso_at_nyc.rr.com

In addition to the excellent advice you have received from others I would urge you to spend a serious amount of time learning Oracle Concepts and Architecture (also at otn.oracle.com). If your other coded items are of a similar vein you will bring Oracle to its knees. And that is not a pretty sight.

Any thoughts you may have that Oracle is just SQL Server from another company should be terminated with extreme prejudice.

Daniel Morgan Received on Thu Sep 19 2002 - 10:22:21 CDT

Original text of this message

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