gbaguma
4th July 2013, 12:01
Hey guys,
Am writing a database application to interact with an Oracle database. In the Oracle database i have stored procedures and functions. Problem is i cannot retrieve data or even call functions. stored procedures work just fine. The QT documentation says that functions are not fully supported, and instead advises to see the driver documentation. the thing is,..i think functions are supported in the OCI driver. How does someone go about this?
Below is a code fragment from one of my functions
qint32 historyid;
QSqlQuery query;
query.setForwardOnly(true);
query.prepare(" call :histid := tracdba.proj_pkg.change_project(:rojid,:ver,:reaso n)");
query.bindValue(":rojid", versioninfo.ProjectID );
query.bindValue(":ver",versioninfo.projectVersion );
query.bindValue(":reason", versioninfo.Reason);
query.bindValue(":histid",0, QSql::Out);
if(!query.exec())
{
qDebug()<< "DATABASE ERROR!!"<< query.lastError().databaseText();
return "db_Exec_Failed";
}
historyid = query.boundValue(":histid").toInt();
Am writing a database application to interact with an Oracle database. In the Oracle database i have stored procedures and functions. Problem is i cannot retrieve data or even call functions. stored procedures work just fine. The QT documentation says that functions are not fully supported, and instead advises to see the driver documentation. the thing is,..i think functions are supported in the OCI driver. How does someone go about this?
Below is a code fragment from one of my functions
qint32 historyid;
QSqlQuery query;
query.setForwardOnly(true);
query.prepare(" call :histid := tracdba.proj_pkg.change_project(:rojid,:ver,:reaso n)");
query.bindValue(":rojid", versioninfo.ProjectID );
query.bindValue(":ver",versioninfo.projectVersion );
query.bindValue(":reason", versioninfo.Reason);
query.bindValue(":histid",0, QSql::Out);
if(!query.exec())
{
qDebug()<< "DATABASE ERROR!!"<< query.lastError().databaseText();
return "db_Exec_Failed";
}
historyid = query.boundValue(":histid").toInt();