I was under the impression that argument-less functions can be called with empty parentheses after the function name, i.e. what some other databases allow to do:
current_timestamp()
Whereas in Oracle, I have to write
current_timestamp
With user-defined functions, this rule doesn't apply (in 11g). I can write both
my_function
my_function()
My question is: Is CURRENT_TIMESTAMP
really a true function or should I consider it to be a language construct / pseudo-column of the Oracle SQL dialect (compatible with the SQL standard)? Is there any formal definition about when I can (optionally, mandatorily) add the ()
and when I have to omit them?
Background-info:
SQL 1992 defines:
<current timestamp value function> ::= CURRENT_TIMESTAMP [ <left paren> <timestamp precision> <right paren> ]
Derby, HSQLDB, Ingres, Postgres, SQLite, SQL Server behave like Oracle, where there are no parentheses allowed for
CURRENT_TIMESTAMP
- Sybase SQL Anywhere knows a
CURRENT TIMESTAMP
function (without parentheses, without underscore) - CUBRID, MySQL, Sybase ASE allow for using
CURRENT_TIMESTAMP()