[Qtscript-bindings] QtScript + QSqlQuery error
Stephan Beal
sgbeal at googlemail.com
Wed Oct 8 17:27:07 CEST 2008
On Wed, Oct 8, 2008 at 1:53 PM, Seb Ruiz <ruiz at kde.org> wrote:
> Same problem unfortunately :(
i had the same and ended up working around it with addBindValue(), e.g.:
var q = new QSqlQuery("create table tbl(a,b,c)",db);
q.exec();
q = new QSqlQuery(db);
q.param = new QSql.ParamType(QSql.In);
print('q.param ==',q.param);
db.transaction();
for( var a = 0; a < 3; ++a ) {
for( var b = 0; b < 3; ++b ) {
for( var c = 0; c < 3; ++c ) {
print("Inserting",a,b,c);
q.prepare("insert into tbl values(?,?,?);");
// q.bindValue() overload resolution isn't working
// q.bindValue(0, a, q.param );
q.addBindValue( new Number(a), q.param );
q.addBindValue( b, q.param );
q.addBindValue( c, q.param );
q.exec();
}
}
}
not as pretty, but it seems to work.
--
----- stephan beal
http://wanderinghorse.net/home/stephan/
More information about the Qtscript-bindings
mailing list