Ask the Expert

Error on "select timestamp" command

When I give the below command, the system is giving me an error. Can you please tell me the syntax?

Here is what I did:

SQL> select timestamp from dual;

select timestamp from dual


ERROR at line 1:

ORA-00904: invalid column name

    Requires Free Membership to View

Your SQL statement is trying to select the TIMESTAMP column from the DUAL table. This table does not contain that column therefore an error is thrown. If you want to see the current time, issue the following query:

SELECT sysdate FROM dual;

If you need this information returned in the TIMESTAMP datatype, you will have to use a function to convert the data:

SELECT to_timestamp(sysdate) FROM dual;

This was first published in December 2004

There are Comments. Add yours.

TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to: