reading raw binary data from clob columns using oracle backend

204 views
Skip to first unread message

Michał Nowotka

unread,
Nov 7, 2012, 8:16:00 AM11/7/12
to django...@googlegroups.com
Hello,
I'm working with oracle legacy DB and need to read and write binary data (png images, and and MDL Molfiles).
Django's inspectdb command generated text fields for these columns, saying that's only a guess.
Now, when I'm trying to retrieve a value from this class fields i get:
DjangoUnicodeDecodeError: 'utf8' codec can't decode byte 0x89 in position 0: invalid start byte.
error.

Is there any way to read and write these columns?
Any help would be appreciated.

Regards,
Michal Nowotka

Michał Nowotka

unread,
Nov 7, 2012, 9:42:46 AM11/7/12
to django...@googlegroups.com
I mean BLOB, sorry.

Ian

unread,
Nov 8, 2012, 11:06:14 AM11/8/12
to django...@googlegroups.com

Django has no built-in field type for BLOB columns.  You might try using the custom field type given in one of the answers here:

http://stackoverflow.com/questions/5581466/django-models-blob-field

I haven't used this myself, so I can't vouch for how well it will work.
Reply all
Reply to author
Forward
0 new messages