Insert date and time into timestamp in oracle 10g sql plus

I am having an error with my insert statements for a table The attributes E_STIME AMD E_FTIME are the start date, start time and the finish date, finish time of an event. The datatypes for both are TIMESTAMP (6) .

I am trying to insert data into the table already created in sql plus on oracle 10g but im getting an error

ORA-01830: date format picture ends before converting entire input string

INSERT INTO EVENT (E_ID, E_NAME, E_STIME, E_FTIME, E_COST, ET_ET_ID, V_V_ID, C_C_ID)
VALUES ('E000002', 'RAVISINGH PARTY', TO_TIMESTAMP('2017-01-11 13:00:00.00',
        'YYYY-MM-DD HH24:MI:SS'), TO_TIMESTAMP('2017-01-11 18:00:00.00',
        'YYYY-MM-DD HH24:MI:SS'),'4897.00','ET002','V0002','C0002');

It was initially giving an error -

ORA-01843: not a valid month

after adding the TO_TIMESTAMP bit in the insert I got ORA-01830 .

What am I doing wrong?


Use the following date format to convert to timestamp.

TO_TIMESTAMP('2017-01-11 18:00:00.00', 'YYYY-MM-DD HH24:MI:SS.FF')

TO_TIMESTAMP

链接地址: http://www.djcxy.com/p/36962.html

上一篇: SQL ORACLE(日期)

下一篇: 在oracle 10g sql plus中插入日期和时间到时间戳中