Reputation: 11
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
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