tranfuga25s
9th September 2006, 00:38
I've got the follow problem with this query:
QSqlQuery *cola2 = new QSqlQuery( "INSERT INTO preguntas ( pregunta, dificultad, referencia, respuesta ) VALUES ( ?, ?, ?, ? )" );
cola2->bindValue( 0, c->texto );
cola2->bindValue( 1, c->dificultad );
cola2->bindValue( 2, c->referencia );
cola2->bindValue( 3, c->respuesta );
if( !cola2->exec() )
{
cout<<"agregar_pregunta()::Error al ejecutar la cola de insercion "<<endl;
cout<<"agregar_pregunta()::Descripcion del error: "<<cola2->lastError().text()<<endl;
TElog->append( "No se pudo agregar la pregunta a la db" );
}
else
{
cout<<"agregar_pregunta()::Registro Agregado"<<endl;
agregadas++;
}
delete(cola2);
this query is ona cycle for each record that must be inserted... but at doing a export of the table gets one empty record and a good record..
chequed that this query is executed only once in each record insertion.
Thanks in advance...:)
QSqlQuery *cola2 = new QSqlQuery( "INSERT INTO preguntas ( pregunta, dificultad, referencia, respuesta ) VALUES ( ?, ?, ?, ? )" );
cola2->bindValue( 0, c->texto );
cola2->bindValue( 1, c->dificultad );
cola2->bindValue( 2, c->referencia );
cola2->bindValue( 3, c->respuesta );
if( !cola2->exec() )
{
cout<<"agregar_pregunta()::Error al ejecutar la cola de insercion "<<endl;
cout<<"agregar_pregunta()::Descripcion del error: "<<cola2->lastError().text()<<endl;
TElog->append( "No se pudo agregar la pregunta a la db" );
}
else
{
cout<<"agregar_pregunta()::Registro Agregado"<<endl;
agregadas++;
}
delete(cola2);
this query is ona cycle for each record that must be inserted... but at doing a export of the table gets one empty record and a good record..
chequed that this query is executed only once in each record insertion.
Thanks in advance...:)