Question

I am using QsqlQuery to call oracle stored procedure that uses input parameters and two output parameters The procedure executed perfectly but output parameters contains no data

QSqlQuery movementQuery ;
movementQuery.prepare("call Qt.add_movement(:pDocumentType , :pDocumentId ,       
to_date(sysdate,'dd-mm-yyyy') ,:pDocumentNumber"
",to_date(sysdate,'dd-mm-yyyy') , :pCustId ,:pMovementId ,:pReturn )");
movementQuery.bindValue(":pDocumentType",documentType);
movementQuery.bindValue(":pDocumentId",documentId);
movementQuery.bindValue(":pDocumentNumber",0);
movementQuery.bindValue(":pCustId",ui->custId->text());
movementQuery.bindValue(":pMovementId", 0, QSql::Out);
movementQuery.bindValue(":pReturn", "FALSE", QSql::Out);
movementQuery.exec();
 //// The query executed the query is active and no errors are valid
//// message is method to display the value
message(query.boundValue(":pReturn").toString());
message(query.boundValue(5).toString());
message(query.boundValue(":pMovementId").toString());
message(query.boundValue(4).toString());

Any ideas Thank you for your interest

Was it helpful?

Solution

You are executing movementQuery

movementQuery.exec();

but you are returning the bound values of query.

message(query.boundValue(":pReturn").toString());
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top