I've written below code, but it only seems to insert the current date and not the current time. Anyone knows how to do that?
insert into errortable
(dateupdated,table1id)
values
(TO_DATE(sysdate, 'dd/mm/yyyy hh24:mi:ss'),1083);
This question is related to
sql
oracle
datetime
sql-insert
You may try with below query :
INSERT INTO errortable (dateupdated,table1id)
VALUES (to_date(to_char(sysdate,'dd/mon/yyyy hh24:mi:ss'), 'dd/mm/yyyy hh24:mi:ss' ),1083 );
To view the result of it:
SELECT to_char(hire_dateupdated, 'dd/mm/yyyy hh24:mi:ss')
FROM errortable
WHERE table1id = 1083;
Source: Stackoverflow.com