I have an Oracle DB with a timestamp
field in it. What is the correct SQL code to insert a timestamp
into this field?
Advertisement
Answer
insert into tablename (timestamp_value) values (TO_TIMESTAMP(:ts_val, 'YYYY-MM-DD HH24:MI:SS'));
if you want the current time stamp to be inserted then:
insert into tablename (timestamp_value) values (CURRENT_TIMESTAMP);