lundi 29 juin 2015

How to convert code from SQL Server to Oracle

I wrote this code in SQL Server. I want to write this code for Oracle and PL/SQL. Could anyone help me how I can do this job?

SQL Server / T-SQL:

ALTER TRIGGER [dbo].[checkBalance]
   ON  [dbo].[Orders]
FOR insert
AS
BEGIN
    IF (SELECT goodcount FROM goods WHERE id=(SELECT gid FROM Inserted)) < (SELECT gcount FROM Inserted)
    BEGIN
        RAISERROR ('Inventory is low',10,1)
        rollback
    END 

Aucun commentaire:

Enregistrer un commentaire