[PyKDE] Sql prepare

Matthias Frick matthias.frick at rsel.renesas.com
Thu Nov 3 16:40:38 GMT 2005

hi i got some problems with the prepare function fo QSqlQuery

i dont get some usefull back.

here my code:

print db
query = QSqlQuery(db)
print query.prepare( "Select :l, lot_id from yb_lot_history where rownum 
< 4" )
print query.bindValue( ":l", QVariant("lot_id"), QSql.ParameterType(3))
print query.execQuery()
print query.isActive()
print query.executedQuery ()

while query.next():
    print "erg:",query.value(0).toString()

and here the output:

<qtsql.QSqlDatabase object at 0x009C8B70>
Select :l, lot_id from yb_lot_history where rownum < 4
erg: lot_id
erg: lot_id
erg: lot_id

is this a bug? why dont i get the entries for lot_id?
I hope you will help me with this basic problem


This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. Access to this e-mail by anyone else is unauthorised.
If you are not the intended recipient, any disclosure, copying,
distribution or any action taken or omitted to be taken in reliance on
it, is prohibited.
E-mail messages are not necessarily secure.  Renesas does not accept
responsibility for any changes made to this message after it was sent.
Please note that this email message has been swept by Renesas for
the presence of computer viruses.

More information about the PyQt mailing list