C#和其他编程语言一样,只是SQL语句需要注意
在Oracle中,插入日期,需要使用 TO_DATE,示例:
INSERT INTO tDateTable(ID,dDate) VALUES('12',TO_DATE('2015-09-23','YYYY-mm-dd'))insert into tabname(datecol) value(sysdate) -- 用date值insert into tabname(datecol) value(sysdate+1) -- 用date值
insert into tabname(datecol) value(to_date('2014-02-14','yyyy-mm-dd')) -- 用to_date
insert into tabname(datecol) value(to_date('2014-02-14 20:47:00','yyyy-mm-dd hh24:mi:ss')) -- 用to_date
insert into tabname(datecol) value(to_date('20140214','yyyymmdd')) -- 用to_date
insert into tabname(datecol) value(to_date('20140214204700','yyyymmddhh24miss')) -- 用to_date
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)