Error in inserting blob into ORACLE using ODBC.Windows

TM tanming_fong at phoenix.com
Thu Dec 30 20:34:02 EST 1999


I have a problem inserting BLOB into ORACLE using ODBC.Windows with either
the Oracle ODBC driver or the Micorsoft ODBC driver for Oracle.

After mxODBC 1.1.1 installation, i run the test.py and got some errors:

Test suite:
 Connecting to the database.
 Connected to DBMS: Oracle8; Version: 08.00.5000
              ODBC driver: SQOCI32.DLL 8.0.3.0.0; ODBC Version: 02.50
...
 BLOB column type with binary data           : unexpected database error
[mxODBC.OperationalError: ('S1000', 1461, 'ORA-01461: can bind a LONG value
only for insert into a LONG column\012', 3176)]


Then i tried out a few lines to insert a BLOB

import ODBC
conn = ODBC.Windows.Connect('...',clear_auto_commit=0)
cur = conn.cursor()
...
f=open(icon_path,'r')
icon=f.read()

sql='INSERT INTO my_table (seq_no, blob_data) VALUES (36,?)'
cur.execute(sql,(icon,))

and get this error:
OperationalError: ('S1000', 1465, 'ORA-01465: invalid hex number\012',
3176)

What step did i missed?

I also need some pointer on how to get the BLOB backout. 

Tanming Fong
tmfong at hotmail.com


Thanks in advance for any help. 




More information about the Python-list mailing list