Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Converting MSSQL trigger stuff to Oracle???
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.
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
![]() |
![]() |