[Python-de] Strings, die " und ' enthalten
U. Bielz
u.bielz at wad.org
Mit Okt 6 17:33:31 CEST 2004
On Wed, 6 Oct 2004 17:28:25 +0200
"Achim Domma \(Procoders\)" <domma at procoders.net> wrote:
>
> sql = "insert into archiv (path, album, artist, title)
> values(%s,%s,%s,%s)
> self.cursor.execute(sql, (path, album, artist, title))
>
[Von anderen der gleiche Hinweis...]
Genau so funktioniert's. Das Problem saß also _vor_ dem Bildschirm. :-)
Ich hätte einfach die DB-API-Spezifikation lesen müssen:
.execute(operation[,parameters])
Prepare and execute a database operation (query or
command). Parameters may be provided as sequence or
mapping and will be bound to variables in the operation.
Variables are specified in a database-specific notation
(see the module's paramstyle attribute for details). [5]
Danke nochmals an alle.
Uwe