Hello,
I'm new to SQL Server and need to convert SQL Server Triggers to Oracle. There is no SQL Server version, all I got is files and doing this manually. Need a little help please. Here are the examples of SQL Server triggers that need to be converted to Oracle:
Insert trigger - before insert or after in Oracle?
CREATE TRIGGER trigger_name ON dbo.table_name
FOR Insert AS
declare @InsertUser varchar(32)
BEGIN
SELECT @InsertUser = nt_username from master.dbo.sysprocesses where spid = @@spid
Update table_name
SET dCreateDate = GETDATE(), cCreateUser = @InsertUser
FROM table1 a ,table2 i WHERE a.tab_id = i.tab_id
END
GO
Update Trigger - before update or after in Oracle?
CREATE TRIGGER trigger_name ON dbo.table_name
FOR UPDATE AS
declare @UpdateUser varchar(32)
if not update(CreateUser) and not update(CreateDate)
BEGIN
SELECT @UpdateUser = nt_username from master.dbo.sysprocesses where spid = @@spid
Update table_name
SET UpdateDate = GETDATE(), UpdateUser = @UpdateUser
FROM table1 a ,table2 i WHERE a.tab_id = i.tab_id
END
GO
Thank you very much to all.