I'm trying to load jpg images in an Oracle Long Raw field using the
following code:

engine  = create_engine('oracle://sysadm:c00l...@testhr:1530/hrupg')
conn    = engine.raw_connection()
cursor1 = conn.cursor()

f         = os.path.join(i.root, i.filename)
file_size = os.path.getsize(f)
ifile     = open(f, "rb")
img       = ifile.read(file_size)
ifile.close()
cursor2.execute(idw_u_sql, emplid=i.emplid, image=img,
date_acquired=datetime.today().date())
conn.commit()

Here is the update sql statement:

idw_u_sql = """
UPDATE PS_IH_IDWORKS
SET EMPLOYEE_PHOTO = :image,
    DATE_ACQUIRED  = :date_acquired
WHERE EMPL_RCD = 0
  AND EMPLID   = :emplid"""

when running this I get the following error message:

ORA-01461: can bind a LONG value only for insert into a LONG column

Any help would be very much appreciated!

Gregg.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com
To unsubscribe from this group, send email to 
sqlalchemy+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to