Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is the GETDATE() an invalid identifier

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;
like image 755
Elisabeth Avatar asked Apr 12 '13 13:04

Elisabeth


People also ask

What does Getdate () mean?

The GETDATE() function returns the current database system date and time, in a 'YYYY-MM-DD hh:mm:ss. mmm' format.

Is Getdate a function?

GETDATE is a nondeterministic function. Views and expressions that reference this function in a column cannot be indexed.

What is the format of Sysdate in Oracle?

The default date format is DD-MON-YY. SYSDATE is a function returning date and time. DUAL is a dummy table used to view SYSDATE. The default display and input format for any date is DD-MON-YY.


1 Answers

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

UPDATE TableName SET LastModifiedDate = (SELECT SYSDATE FROM DUAL);
like image 89
Nerdwood Avatar answered Sep 28 '22 07:09

Nerdwood