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) ;

oracle 将当前系统时间戳插入timestamp字段的更多相关文章

  1. oracle merge into函数中插入clob字段

    当使用Merge into 函数向ORACLE数据库中插入或更新数据时,报错“ORA-01461: 仅可以为插入 LONG 列的 LONG 值赋值”,使用如下方法可以把String转换为clob. 需 ...

  2. timestamp 字段

    项目中由于需求设计,数据库中需要一个timestamp时间戳类型的字段来作为区别数据添加和修改的标识.由于timestamp在SQL SERVER 2005数据库中,不可为空的timestamp类型在 ...

  3. oracle 插入timestamp

    示例: insert into tpurview(IPURVIEWID,CPURVIEWNAME,COPERATENAME,IPARENTID,DADDTIME,DEDITTIME,CADDUSER, ...

  4. mysql(自动添加系统时间)timestamp类型字段的CURRENT_TIMESTAMP与ON UPDATE CURRENT_TIMESTAMP属性

    timestamp有两个属性,分别是CURRENT_TIMESTAMP 和ON UPDATE CURRENT_TIMESTAMP两种,使用情况分别如下: 1.CURRENT_TIMESTAMP 当要向 ...

  5. C#更新SQLServer中的TimeStamp字段(时间戳) 防止同时修改一行时覆盖更新

    C#更新SQLServer中的TimeStamp字段(时间戳) 分类: C#2012-10-24 15:10 1878人阅读 评论(0) 收藏 举报 public partial class Form ...

  6. Oracle的timestamp字段更新实验 结论:只有逐条更新才能保证timestamp字段有差别,批量更新只会得到一致的时间,此操作无关时间精度.

    有这么一张表: create table hy_testtime( id number(6,0) not null primary key, name nvarchar2(20) not null, ...

  7. mysql关于timestamp字段相关内容

    发现5.6和5.7版本的创建表不一致,从5.6导出数据表创建sql文件,然后导入到5.7表会报错,timestamp不能为空 查看的sql_mode mysql5.0以上支持的三种模式 1. ANSI ...

  8. SQL Server 数据变更时间戳(timestamp)在复制中的运用

    一.本文所涉及的内容(Contents) 本文所涉及的内容(Contents) 背景(Contexts) 方案(Solution) 方案一(Solution One) 方案二(Solution Two ...

  9. Step6:SQL Server 数据变更时间戳(timestamp)在复制中的运用

    一.本文所涉及的内容(Contents) 本文所涉及的内容(Contents) 背景(Contexts) 方案(Solution) 方案一(Solution One) 方案二(Solution Two ...

随机推荐

  1. Linux下Apache与httpd的区别与关系

    http://blog.csdn.net/yxfabcdefg/article/details/32324035

  2. CSS 属性的默认值

    最近在看到一篇关于如何实现水平垂直居中,发现有许多属性值,自己并不了解,特此Google一番,查到,摘抄过来,方便以后查阅,下面是如何实现水平垂直居中的博文. 解读CSS布局之-水平垂直居中 html ...

  3. 使用PHP,jsonp,jquery实现跨域

    html代码: <!DOCTYPE html> <html lang="en"> <head> <meta charset="U ...

  4. freenas 11.2踩过的坑

    修改SMB最小协议 服务器最小协议由FreeNAS上的sysctl控制. 在System-> Tunables 下添加sysctl来使其永久化:Variable = freenas.servic ...

  5. w[wi].getAttribute('wattr')

    w 将数据库的不同数值寄存到自定义的不同属性上,避免通过寄存到同一id属性上的字符串处理.

  6. android开发笔记(二)导入项目到eclipse和另一个项目

    NND,eclipse里导入工程出现问题了,整了半天,来个这问题,无效工程描述,找了半天看.projec文件是否工程名对应,看androidManifest.XML换里面的代码版本号,我擦都无济于事. ...

  7. appium+python自动化测试真机测试时报错“info: [debug] Error: Could not extract PIDs from ps output. PIDS: [], Procs: ["bad pid 'uiautomator'"]”

    刚开始启动服务时,弹出授权提示,以为是手机app权限问题,后来debug后,发现了一个警告日志:UiAutomator did not shut down fast enough, calling i ...

  8. CListCtrl控件使用方法总结

    今天第一次用CListCtrl控件,遇到不少问题,查了许多资料,现将用到的一些东西总结如下: 以下未经说明,listctrl默认view 风格为report 相关类及处理函数 MFC:CListCtr ...

  9. HTTP request is unauthorized with client authentication scheme 'Anonymous'. The authentication header received from the server was 'NTLM'。

    情况:WCF服务在浏览器中可以正常浏览,但是通过程序调用提示: HTTP request is unauthorized with client authentication scheme 'Anon ...

  10. Elasticsearch.js 发布 —— 在Node.js和浏览器中调用Elasticsearch(1)

    继PHP.Ruby.Python和Perl之后,Elasticsearch最近发布了Elasticsearch.js,Elasticsearch的JavaScript客户端库.可以在Node.js和浏 ...