the first arguement to execute must be a string or unicode query
I am trying to upload a blob data to ms-sql db, using pyodbc. And I get
"the first arguement to execute must be a string or unicode query" error.
The code is;
file = pyodbc.Binary(open("some_pdf_file.pdf", "r").read())
cur.execute("insert into BlobDataForPDF(ObjectID, FileData, Extension)
values ('1', " + file + ", '.PDF')")
cur.commit()
The first arguement, ObjectID, is sent as string. I dont see any problems
but am I missing something?
No comments:
Post a Comment