Loading a whole HTML document in a SQL 7.0 TEXT field

Niels Diepeveen niels at endea.demon.nl
Fri Mar 10 18:21:10 CET 2000

Alessandro Bottoni schreef:

> I'm using mxODBC. I put all the HTML document in a string variable with this
> instruction:
> Blob = SourceFile.read(-1)
> And I try to put all this stuff in the "Content" TEXT field of SQL70 DB in
> this way:
> SQLCommand = 'update ' + OutPutTable + ' set Content=\'' + Blob + '\' where
> SolutionNumber=' + SolutionNumber
> Cursor.execute(SQLCommand)

You would have to be very lucky for Blob not to contain something that
is illegal in an SQL string literal. Using an SQL parameter might work

Niels Diepeveen
Endea automatisering

More information about the Python-list mailing list