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

Converting MSSQL trigger stuff to Oracle???

From: Brad Pybus <brad_pybus_nospam_at_hotmail.com>
Date: Tue, 04 May 1999 17:12:45 GMT
Message-ID: <hUFX2.30$Mw2.52091@client.news.psi.net>

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 - 12:12:45 CDT

Original text of this message

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