为什么 GETDATE() 是无效标识符

2022-01-01 00:00:00 function oracle triggers

当我调试此代码时,为什么 GETDATE() 是无效的标识符表示 Oracle Sql Developer 工具:

Why is the GETDATE() an invalid identifier says Oracle Sql Developer tool when I debug this code:

CREATE OR REPLACE TRIGGER SPName
AFTER UPDATE
ON TableName 
FOR EACH ROW
BEGIN
    UPDATE TableName SET LastModifiedDate = GETDATE() WHERE TableName.DET_ID = :new.DET_ID;
END;

推荐答案

我想你想要的是 SYSDATE,而不是 GETDATE().试试看:

I think you want SYSDATE, not GETDATE(). Try it:

UPDATE TableName SET LastModifiedDate = (SELECT SYSDATE FROM DUAL);

相关文章