Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

SQL Server's GETDATE() equivalent in PL/SQL

ZzzzHJun 21 2017 — edited Jun 21 2017

In SQL Server, if I need to add a new datetime column in my query to display the current time, I always do:

SELECT *, GETDATE() EXECUTION_TIME

FROM TABLE_1;

I know in PL/SQL we can do SELECT SYSDATE FROM DUAL;

I tried to do the following query:

SELECT *, SYSDATE EXECUTION_TIME

FROM TABLE_1;

but Oracle SQL returned:

ORA-00923: FROM keyword not found where expected

00923. 00000 -  "FROM keyword not found where expected"

What's the correct syntax to do

SELECT *, GETDATE() EXECUTION_TIME

FROM TABLE_1;

in PL/SQL?

This post has been answered by Frank Kulash on Jun 21 2017
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 19 2017
Added on Jun 21 2017
8 comments
53,433 views