[Tutor] Help with ODBC, SQL & Unicode
Charlie Clark
Charlie@begeistert.org
Fri, 16 Nov 2001 23:22:10 +0100
Dear list,
it's been a bit of a struggle this week: databases are not my strong
point. After a couple of days working out how to set timestamps in an
SQL-database I'm now closer to understanding parameters. There's a catch
however.
consider the following bit of code
c.execute('INSERT INTO my_table \
(strHeadline, dtTimestampIn, iMarked)\
VALUES (?, ?, ?)',
(headline, time.localtime(time.time()[:6], 1))
where c is my cursor object and headline a string and I'm using mxODBC
for the connection.
This only works for strings which only contain 7-bit ASCII characters.
But I've got German text which is full of ä, ö, ü and ß. Up until
now I've been working with formatted strings which avoids this problem
but is really difficult to use when it comes to setting the date. What's
the correct way to do this?
Thanx very much
Charlie