Answers for "oracle sql insert date type to timestamp"

SQL
5

oracle add time to date

SELECT sysdate + 1 FROM dual; 				-- Tomorrow    12/01/2021 14:27:27
SELECT trunc(sysdate) + 1 FROM dual; 		-- Tomorrow    12/01/2021 00:00:00
SELECT sysdate + 1 / 24 FROM dual;					-- 1 hour ahead
SELECT sysdate + 1 / 24 / 60 FROM dual;				-- 1 minute ahead
SELECT add_months(trunc(sysdate), 1) FROM dual;   	-- 1 month ahead (no time)
SELECT trunc(sysdate) + 30 FROM dual;				-- 30 days ahead (no time)
SELECT add_months(trunc(sysdate), +12*2) FROM dual;	-- 2 years ahead (no time)
Posted by: Guest on May-11-2021
0

oracle current timestamp insert statement

--if you want to hardcode the time stamp: 

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);
Posted by: Guest on July-28-2021

Code answers related to "SQL"

Browse Popular Code Answers by Language