有一张表:batch(批次表)

    表的字段如下:

      向Oracle 数据表中插入一条带有日期类型的数据

 第一种情况:

   现在需要插入一条当前的系统时间

sql 如下:

insert into batch
(batch_id, cus_id, batch_number, createtime, note)
values(seq_batch.nextval, 2, '000001',to_date(to_char(sysdate,'yyyy-mm-dd hh24:mi:ss'),'yyyy-mm-dd hh24:mi:ss') , '第二次购买');

向Oracle 数据表中插入一条带有日期类型的数据

 

 

第二种情况:

    插入一条随便的日期

insert into batch
(batch_id, cus_id, batch_number, createtime, note)
values(seq_batch.nextval, 2, '000001',to_date('2012-12-21','yyyy-mm-dd'), '首次购买');

向Oracle 数据表中插入一条带有日期类型的数据

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-08-15
  • 2021-11-20
  • 2021-10-19
  • 2021-06-05
  • 2022-01-19
  • 2021-11-05
猜你喜欢
  • 2022-12-23
  • 2021-08-04
  • 2022-12-23
  • 2022-12-23
  • 2021-08-14
  • 2022-12-23
  • 2021-12-31
相关资源
相似解决方案