I was hoping one of you Oracle experts would be able to give me a hand with this. I have the following SQL Server script, but I need to rewrite it for Oracle:
USE mydb
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE trigger mydb . [CONNECTERTRIGGER] on mydb . [DtreeNotify]
FOR INSERT AS
BEGIN
IF @@ROWCOUNT=0
RETURN
SET IDENTITY_INSERT mydb.DTreeNotify2 ON
INSERT INTO mydb.DTreeNotify2
(NID,NType,DataID,VersionNum,OwnerID,SubType)
SELECT inserted.NID,
inserted.NType,
inserted.DataID,
inserted.VersionNum,
mydb.Dtree.OwnerID,
livelink.DTree.SubType
FROM inserted, livelink.DTree
WHERE inserted.DataID = livelink.DTree.DataID;
END
I think @@rowcount becomes sql%rowcount, but I'm struggling with the identity_insert bit. I don't think anything else should change. Opinions?