[PyKDE] Re: Using QSqlQuery + bindValue = TypeError ?
Jorge Godoy
godoy at ieee.org
Sun Feb 27 14:30:14 GMT 2005
Hans-Peter Jansen <hpj at urpla.net> writes:
> On Sunday 27 February 2005 14:37, Jorge Godoy wrote:
> >
> > But I keep always getting the following error message:
> >
> > query.bindValue(":senha", senhaNova)
> > TypeError: argument 2 of QSqlQuery.bindValue() has an invalid type
>
> Try:
> query.bindValue(":senha", QVariant(senhaNova))
>
> Phil, Qt is able to cast such stuff automatically, IIRC. Why can't
> PyQt do this for us, too?
>
> Pete
OK...
I'm back ;-)
Shouldn't the binding variables be removed? My PostgreSQL is getting:
Feb 27 11:26:43 wintermute postgres[20529]: [5545-2] ^I SET Senha =:senhasistema'teste2'
And is aborting.
Feb 27 11:26:43 wintermute postgres[20529]: [5545-6] LOCATION: pg_parse_query, postgres.c:464
Feb 27 11:26:43 wintermute postgres[20529]: [5546-1] ERROR: 42601: syntax error at or near ":" at character 48
Feb 27 11:26:43 wintermute postgres[20529]: [5546-2] LOCATION: yyerror, scan.l:573
Anything else seems to be wrong.
Any other hints?
Thanks,
Godoy.
More information about the PyQt
mailing list