Loading a whole HTML document in a SQL 7.0 TEXT field

Alessandro Bottoni Alessandro.Bottoni at think3.com
Fri Mar 10 04:24:13 EST 2000


I was asked to write a script to load a lot of HTML documents in a SQL70
DataBase in a single batch, putting all the HTML text of every document in a
single TEXT field of the DataBase (That kind of field should accept
something like 2,147,483,647 characters, accordingly to SQL70 doc.).
Quite surprinsingly for me, I'm not able to write the HTML stuff  to the
DataBase.
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)
I always get a 'Sintax error' back from SQL70.
Any suggestion? Any comment?
TIA
--------------------------------
Alessandro Bottoni
(Alessandro.Bottoni at Think3.com)
(alessandro.bottoni at libero.it)
Web Programmer
Think3 inc.
(www.think3.com)





More information about the Python-list mailing list