oracle 日期插入时报这个错  ORA-01861: literal does not match format string #1701

Closed
opened 2020-06-03 09:32:34 +00:00 by 4color · 1 comment
Contributor

一直没找到解决办法,后来改了源码才可以。是不是哪里搞得不对。
case schemas.DateTime, schemas.TimeStamp, schemas.Varchar:
// !DarthPestilane! format time when sqlTypeName is schemas.Varchar.
//20200530
if dialect.URI().DBType == schemas.ORACLE {
v = t
} else {
v = t.Format("2006-01-02 15:04:05")
}
https://gitea.com/xorm/xorm/src/branch/master/dialects/time.go#L21

一直没找到解决办法,后来改了源码才可以。是不是哪里搞得不对。<br /> case schemas.DateTime, schemas.TimeStamp, schemas.Varchar: <br /> // !DarthPestilane! format time when sqlTypeName is schemas.Varchar. //20200530 if dialect.URI().DBType == schemas.ORACLE { v = t } else { v = t.Format("2006-01-02 15:04:05") } <br /> [ https://gitea.com/xorm/xorm/src/branch/master/dialects/time.go#L21](http://)
lunny added the
db
oracle
label 2020-06-04 01:27:27 +00:00
Owner

duplicated with #1641

duplicated with #1641
lunny closed this issue 2020-06-04 01:34:36 +00:00
Sign in to join this conversation.
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: xorm/xorm#1701
No description provided.