Results 1 to 20 of 20

Thread: QOpenOCCI Oracle SQL Plugin

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Oct 2008
    Posts
    3
    Qt products
    Qt3 Qt4
    Platforms
    MacOS X Unix/X11 Windows
    Thanks
    2

    Default Re: QOpenOCCI Oracle SQL Plugin

    thanks a_white.
    My mistake .
    The main error was with bindValue. Your example and QT example how to call procedure works fine. This example correct to...

    Qt Code:
    1. QSqlQuery procedure(DB);
    2. procedure.prepare("call shemename.packagename.procedurename(:0,:1)");
    3. procedure.bindValue(0, "parameter1");
    4. procedure.bindValue(1, "parameter2");
    5. if (!procedure.exec())
    6. QMessageBox::information(this,tr("error"),tr("%1").arg(procedure.lastError().databaseText()));
    To copy to clipboard, switch view to plain text mode 

  2. #2
    Join Date
    Oct 2008
    Posts
    3
    Qt products
    Qt3 Qt4
    Platforms
    MacOS X Unix/X11 Windows
    Thanks
    2

    Default Re: QOpenOCCI Oracle SQL Plugin

    hi, I have question. how to commit DB correctly?
    do I have to do a query not active for commit? commit work without
    Qt Code:
    1. query->finish();
    To copy to clipboard, switch view to plain text mode 
    but witch way is more correct.

    thanks
    Last edited by deivisj; 29th October 2008 at 10:53.

  3. #3
    Join Date
    Feb 2008
    Posts
    8
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Thanked 4 Times in 4 Posts

    Default Re: QOpenOCCI Oracle SQL Plugin

    Don't know how I missed your reply, but qDB->commit() is the best way to commit a transaction.

    As an added advertisement, QOpenOCCI 2.0 will be released soon and will have many improvements
    Last edited by a_white; 14th November 2008 at 22:16. Reason: spelling error

  4. The following user says thank you to a_white for this useful post:

    deivisj (25th November 2008)

  5. #4
    Join Date
    Dec 2008
    Location
    Lithuania
    Posts
    10
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    4

    Default Re: QOpenOCCI Oracle SQL Plugin

    Hi,
    good thing this plug-in and I'm waiting for QOpenOCCI 2.0 release.

    And want to ask one question.
    In "QSqlQuery Class Reference" says that "Stored procedures that uses the return statement to return values, or return multiple result sets, are not fully supported."

    Does QOpenOCCI 1.3.1.a support values return???


    thanks.
    Last edited by foggy-mind; 22nd December 2008 at 13:08.

  6. #5
    Join Date
    Feb 2008
    Posts
    8
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Thanked 4 Times in 4 Posts

    Default Re: QOpenOCCI Oracle SQL Plugin

    First, QOpenOCCI is limited to what the OCI and Qt lib support. Saying that, I think you can do what you ask. Second, in the Oracle world, stored procedures never return values and functions always returns values. Small correction but people get them easily confused and we can end up talking about the wrong thing. Now to do what you want you have two cases

    1) See the stored procedure example I posted earlier in this thread. This deals with non-returning calls (unless you do out binds which is allowed too)

    2) Formulate your sql to like "select function_to_call(value) from dual" and then treat that as a normal sql call.

    QOpenOCCI 2.0 should be out soon (yeah I know I said that a while ago) but I am waiting for OCILIB to lock in it's release. I need to make sure that two libs get along before making 2.0 official. If anyone is interested in a pre-release that can contact via souceforge and I will work something out.

  7. The following user says thank you to a_white for this useful post:

    foggy-mind (23rd December 2008)

  8. #6
    Join Date
    Feb 2008
    Posts
    8
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Thanked 4 Times in 4 Posts

    Default Re: QOpenOCCI Oracle SQL Plugin

    Let me clarify something. QOpenOCCI does not support the Oracle "returning into" clause since the Qt lib does not have a good mechanism for that exchange. May be something for a future release though.

    Next, array like structures are not currently supported in 1.x but will have basic support in 2.0. This will be limited to input bound variables or native non-complex types such as numbers and strings. I am currently investigating a way to tie in non-primitive Oracle types (varrays/nested-tables/objects) back though Qt.

  9. The following user says thank you to a_white for this useful post:

    foggy-mind (23rd December 2008)

  10. #7
    Join Date
    Dec 2008
    Location
    Lithuania
    Posts
    10
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    4

    Default Re: QOpenOCCI Oracle SQL Plugin

    Ye, you are right. there is function. Sorry for stupid question.

  11. #8
    Join Date
    Dec 2008
    Location
    Lithuania
    Posts
    10
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    4

    Default Re: QOpenOCCI Oracle SQL Plugin

    Hy a_white,
    One more question. Does QOpenOCCI plug'in support row count??? By QT documentation it returns with function query->size(), I get -1.

    the size is not supported on driver.
    qDB.driver()->hasFeature(QSqlDriver::QuerySize); returns 0.

    I don't want to use while(query->next()) tmp++; to get row count.
    QSQlQueryModel returns not the right count, and I don't know why (
    Qt Code:
    1. Model = new QModel(this);
    2. Model->setQuery(query);
    3. tmp = Model->rowCount();
    To copy to clipboard, switch view to plain text mode 
    )

    tmp = 255 in fact rows is 419

    Any suggestions...
    thanks.
    Last edited by foggy-mind; 12th March 2009 at 09:16.

  12. #9
    Join Date
    Aug 2008
    Location
    Ukraine, Krivoy Rog
    Posts
    1,963
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows
    Thanked 370 Times in 336 Posts

    Default Re: QOpenOCCI Oracle SQL Plugin

    btw, Qt 4.5.0 opensource already contains OCI driver.
    Qt Assistant -- rocks!
    please, use tags [CODE] & [/CODE].

  13. #10
    Join Date
    Dec 2008
    Location
    Lithuania
    Posts
    10
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    4

    Default Re: QOpenOCCI Oracle SQL Plugin

    Quote Originally Posted by spirit View Post
    btw, Qt 4.5.0 opensource already contains OCI driver.
    very good news

  14. #11
    Join Date
    Dec 2008
    Location
    Lithuania
    Posts
    10
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    4

    Default Re: QOpenOCCI Oracle SQL Plugin

    I find the answer why QSqlQueryModel function count() returns not the real count of rows. The answer is there QSqlQueryModel::fetchMore()

    And QOCI plugin don't report back the size of a query too .

Similar Threads

  1. QPluginLoader not recognizing a plugin
    By KShots in forum Qt Programming
    Replies: 3
    Last Post: 29th June 2007, 15:13

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.