[Kexi] Kexi python Scripting

Rüdiger Härtel hae at port.de
Fri Mar 7 15:04:45 CET 2008


Here is the kexi project.

Am Freitag 07 März 2008 14:03:45 schrieben Sie:
> Rüdiger Härtel said the following, On 2008-03-07 13:52:
> > I want to write a script to query some data from my db.
> >
> > the following works:
> >
> > cursor = connection.executeQueryString("SELECT * from emp where country
> > = 'Germany'")
> > ...
> >
> > but this does not work
> >
> > country = self.countries.get()
> > sqlStmt = "SELECT * from emp where country = %s" % country
> > cursor = connection.executeQueryString(sqlStmt)
>
> Hello,
> Use '%s' instead of %s to indicate the string constant.
>
> Rüdiger, please register at https://mail.kde.org/mailman/listinfo/kexi
> and ask on the mailing list, so others can also benefit from the answer.
>
> This answer is CC'd there now.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: Neue_Datenbank.kexi.zip
Type: application/x-zip
Size: 2167 bytes
Desc: not available
Url : http://mail.kde.org/pipermail/kexi/attachments/20080307/82ff5adf/attachment.bin 


More information about the Kexi mailing list