Qt 调用预言机存储过程



>我正在使用QsqlQuery调用使用输入参数和两个输出参数的oracle存储过程过程执行完美,但输出参数不包含数据

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());

任何想法感谢您的关注

您正在执行movementQuery

movementQuery.exec();

但是您返回的绑定值为 query

message(query.boundValue(":pReturn").toString());

最新更新