oracle 将当前系统时间戳插入timestamp字段
--insert records
精确到秒:
insert into userlogin_his(usrname,logintime) values('test',to_timestamp(to_char(sysdate,'YYYY-MM-DD HH24:MI:SS'),'YYYY-MM-DD HH24:MI:SS'));
精确到毫秒:
insert into userlogin_his(usrname,logintime) values('test1',to_timestamp(to_char(systimestamp,'YYYY-MM-DD HH24:MI:SS.FF'),'YYYY-MM-DD HH24:MI:SS.FF'));
insert into userlogin_his(usrname,logintime) values('test2',systimestamp);
insert into userlogin_his(usrname,logintime) values('test3',sysdate);
--query records
select usrname,to_char(logintime,'YYYY-MM-DD HH24:MI:SS.FF') from userlogin_his;
更新时间
update NEW_CHECKLIST set (create_time,Update_Time)values(
to_timestamp('2018-07-15 0:0:0', 'syyyy-mm-dd hh24:mi:ss'),
to_timestamp(to_char(sysdate,'YYYY-MM-DD HH24:MI:SS'),'YYYY-MM-DD HH24:MI:SS')
)
where id in(20180815,20180816) ;