【发布时间】:2019-04-08 10:14:49
【问题描述】:
我正在尝试将 SQL Server 触发器转换为 Oracle 触发器,此触发器是关于如果我销售产品并且产品数量为 0 则必须取消销售,但 oracle 的 sintaxis 有点不同。
这是 SQL Server 版本
create trigger IfQuantityIsZero on Products for update
as
IF (SELECT Quantity FROM INSERTED) < 0 BEGIN
RAISERROR ('The sale can not be made, it exceeds the existing quantity of the product.',10,1)
ROLLBACK TRANSACTION
END
【问题讨论】:
-
请检查我的答案,如果它对你有用,请接受/投票,这样它也可以帮助其他人寻求答案。请阅读:stackoverflow.com/help/someone-answers
标签: sql-server oracle triggers