galih utama
galih utama

Reputation: 11

2014-06-01 12:10:20 Timestamp in oracle

is there any a specific procedure how to insert timestamp like 2014-06-01 12:10:20 or do I have to use Timestamp data type like MySQL (if available in Oracle)

Upvotes: 0

Views: 48

Answers (1)

Ali Okan Yüksel
Ali Okan Yüksel

Reputation: 388

SYSDATE returns the current date and time set for the operating system on which the database resides. The datatype of the returned value is DATE, and the format returned depends on the value of the NLS_DATE_FORMAT initialization parameter. The function requires no arguments. In distributed SQL statements, this function returns the date and time set for the operating system of your local database.

Example:

sqlplus> INSERT INTO TEST_TIMESTAMP (id, dt) values(1,sysdate);

If you need timestamp:

sqlplus> INSERT INTO TEST_TIMESTAMP(column_name) VALUES(to_char(sysdate,'DD-MON-YY HH24:MI:SS'));

Upvotes: 1

Related Questions