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: Converting MSSQL trigger to Oracle

Re: Converting MSSQL trigger to Oracle

From: Breno de Avellar Gomes <brenogomes_at_ieee.org>
Date: Tue, 04 May 1999 20:20:08 +0100
Message-ID: <372F4868.F1E7C63F@ieee.org>


Visit and register free at http://technet.oracle.com to download your MS-SQL->Oracle conversion kit.This converts data and programs.

Brad Pybus wrote:

> I'm new to Oracle and new to SQL server. I need to convert some SQL Server
> trigger stuff to Oracle.
>
> I want to be able to do the following in Oracle:
>
> The trigger will be AFTER Updates and Inserts but I do not want to process
> the trigger if no rows
> were actually updated or inserted. How do I do this in Oracle?
>
> IF @@rowcount > 0
> ............
> END
>
> Can I use sql%rowcount? I seemed to get some indications from another post
> that this won't work.
>
> --------
> NEXT:
>
> If I have a trigger on TABLEA for insert, how do I convert the following to
> Oracle:
>
> UPDATE TABLEA
> SET MyDateField = getdate() FROM inserted
> WHERE TABLEA.PrimaryKey = inserted.Primarykey
>
> What baffles me is that I do not even understand the MS SQL being used here
> (I don't have an SQL reference handy). I assume "inserted" is some sort of
> internal cursor that contains all the rows to be inserted. I do not see
> the point of the where clause. It seems to be saying... "only look at the
> records that are already in TABLEA". If rows are being inserted, how can
> they already be in TABLEA?
>
> --
> To reply to me, remove the "_nospam" from my address.


Received on Tue May 04 1999 - 14:20:08 CDT

Original text of this message

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