数据库教程:oracle获取当前时间,精确到毫秒并指定精确位数的实现方法

oracle获得当前时间的,精确到毫秒   可以指定精确豪秒的位数 select to_char(systimestamp, ‘yyyymmdd hh

oracle获得当前时间的,精确到毫秒   可以指定精确豪秒的位数

select to_char(systimestamp, ‘yyyymmdd hh24:mi:ss.ff ‘) from dual;–20120516 11:56:40.729083

select to_char(systimestamp, ‘yyyymmdd hh24:mi:ss.ff3’) from dual;–20120516 11:58:42.755

desc ct_cdr_comparison

名称                          空值       类型           
————————— ——– ————-
dattcdrcomparisonguid       not null timestamp(9) 
vc2customer                          varchar2(200)
vc2m800                              varchar2(200)
numstate                             number(1)    
nummargincalltime_min                number(10)   
nummargincbegin_min                  number(10)   
numcdr_comparisondetailguid          number(10)   
datcreateadate                       date         
datoperatedate                       date         
vc2createcode                        varchar2(200)
vc2operecode                         varchar2(200)
vc2remark                            varchar2(200)

 
select * from ct_cdr_comparison;
 
2012-05-16 13:17:14.340213000 a m800 0 20 20 1 2012-05-16 13:17:14  liuwen 
2012-05-16 13:19:36.659724000 a m800 0 20 20 2 2012-05-16 13:19:36  liuwen 

如果结果没显示:请设置时间戳

工具==》选项==》数据库==》nls

时间戳格式:yyyy-mm-dd hh24:mi:ss.ff

  insert into ct_cdr_comparison    ( dattcdrcomparisonguid,   vc2customer,   vc2m800,   numstate,   nummargincalltime_min,   nummargincbegin_min,   numcdr_comparisondetailguid,   datcreateadate,   vc2createcode   )  values (systimestamp,'a','m800',0,20,20,2,sysdate,'liuwen');  

以上这篇oracle获取当前时间,精确到毫秒并指定精确位数的实现方法就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持<计算机技术网(www.ctvol.com)!!>。

需要了解更多数据库技术:oracle获取当前时间,精确到毫秒并指定精确位数的实现方法,都可以关注数据库技术分享栏目—计算机技术网(www.ctvol.com)!

本文来自网络收集,不代表计算机技术网立场,如涉及侵权请联系管理员删除。

ctvol管理联系方式QQ:251552304

本文章地址:https://www.ctvol.com/dtteaching/804779.html

(1)
上一篇 2021年9月16日
下一篇 2021年9月16日

精彩推荐