Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Oracle OCI Result cannot bind to return a SYS_REFCURSOR
QtWS25 Last Chance

Oracle OCI Result cannot bind to return a SYS_REFCURSOR

Scheduled Pinned Locked Moved Unsolved General and Desktop
qsqlqsqldatabasesqldriveroracleqt 5.13.0
1 Posts 1 Posters 405 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    Redstar123
    wrote on 29 Jul 2019, 04:50 last edited by Redstar123
    #1

    Hello, I recently built Qt statically and it came out pretty well. One of the issues I have been working around is how to return a SYS_REFCURSOR object from Oracle base to a QSqlResult or something similar. I found a patch https://bugreports.qt.io/browse/QTBUG-166

    I have tried the exact same thing, but somehow, it managed to print out:

    ORA-01008: not all variables bound
    Unable to execute statement.

    Here is my code:

    Q_DECLARE_METATYPE(QOCIResult *)

    QOCIResult *p_cursor = reinterpret_cast<QOCIResult*>(db.driver()->createResult());

    QSqlQuery content_query(db);
    content_query.prepare("begin ispovedi.get_ord_kategorii_list(:p_cursor); end;");
    content_query.addBindValue(qVariantFromValue(p_cursor), QSql::Out);

    if (content_query.exec())
    {
    p_cursor->exec();
    }
    else
    {
    qCritical("%s.", qPrintable(content_query.lastError().text()));
    }

    I have a crystal clear connection to database and I can execute other statements, as well, not a problem. The only problem is how to return a SYS_REFCURSOR.

    Thank you.

    1 Reply Last reply
    0

    1/1

    29 Jul 2019, 04:50

    • Login

    • Login or register to search.
    1 out of 1
    • First post
      1/1
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved