#9275 closed Uncategorized (fixed)
ORA-01830 date format picture ends before converting entire input... admin
Reported by: | hollerith | Owned by: | nobody |
---|---|---|---|
Component: | Database layer (models, ORM) | Version: | 1.0 |
Severity: | Normal | Keywords: | oracle date formats |
Cc: | Erin Kelly, Matt Boersma | Triage Stage: | Unreviewed |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
Doing: Porting a legacy application on Oracle 10g.
Symptom: The admin change interface reported this error on Datetimefields.
Solution:I found the 'works for me' at least was to alter the NLS_DATE_FORMAT in backend/oracle/base.py to include the time in the correct format to match django format (i.e. no fractions).
Attachments (2)
Change History (6)
by , 16 years ago
by , 16 years ago
Attachment: | base.2.diff added |
---|
comment:1 by , 16 years ago
Both files are the same:
429c429
< cursor.execute("ALTER SESSION SET NLS_DATE_FORMAT = 'YYYY-MM-DD' "
---
cursor.execute("ALTER SESSION SET NLS_DATE_FORMAT = 'YYYY-MM-DD HH24:MI:SS' "
comment:2 by , 16 years ago
Cc: | added |
---|
comment:3 by , 16 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
comment:4 by , 13 years ago
Easy pickings: | unset |
---|---|
Severity: | → Normal |
Type: | → Uncategorized |
UI/UX: | unset |
If the issue still persists and If the model field is a DateTimeField and the Database field is of DATE Type then you could try this to overcome this error
Look for the statement where you are updating the Date field. Over there, replace the microseonds to Zero and Oracle will start treating it gracefully.
For example, if you model field is called date_field
and if you are updating it as
date_field=datetime.datetime.now()
then change it to
date_field=datetime.datetime.now().replace(microsecond=0)
And that will solve the issue
Regards
Guddu
basic diff