Results 1 to 4 of 4

Thread: Accessing REF CURSOR in Stored Procedure from Qt

  1. #1
    Join Date
    Sep 2007
    Posts
    7
    Qt products
    Qt4
    Platforms
    Windows

    Default Accessing REF CURSOR in Stored Procedure from Qt

    Hi,

    I am trying to get array of data or cursor from a stored procedure in Oracle using Qt.

    i.
    CREATE TYPE NUM_ARRAY IS TABLE OF NUMBER;
    CREATE OR REPLACE PROCEDURE GET_EMP_IDS(X OUT NUM_ARRAY) AS
    BEGIN
    SELECT ID BULK COLLECT INTO X from BKUP_EMPLOYEE;
    END;

    ii. RefCursor

    CREATE OR REPLACE procedure GET_EMP_DETAILS(cur OUT SYS_REFCURSOR) as
    begin
    open cur for select * from bkupemployee;
    end;

    In Qt, i called QSqlQuery::execBatch(QSqlQuery::ValuesAsColumns), this execution succeeded
    but iam not able to retreive the output from it.
    query.boundValues(0).type returns int (zero).

    Please help me in finding the solution.

    Regards,
    Suresh

  2. #2
    Join Date
    Oct 2006
    Posts
    42
    Thanks
    1
    Thanked 8 Times in 8 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Accessing REF CURSOR in Stored Procedure from Qt


  3. #3
    Join Date
    Sep 2007
    Posts
    7
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Accessing REF CURSOR in Stored Procedure from Qt

    Thanks for your reply.
    Your information is helpful in deciding to go for alternatives.

    By the way, passing/retreiving array of basic data (NUMBER) is possible or not?
    It is mentioned in Qt documentation that QSqlQuery::execBatch(QSqlQuery::ValuesAsColumns) will send the data as array.

  4. #4
    Join Date
    Aug 2010
    Posts
    1
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Accessing REF CURSOR in Stored Procedure from Qt

    I know that the last posting in this thread was some time ago...
    We are not at Qt 4.x, and Oracle 11g.

    It seems that calling a stored procedure and getting a result set back is such a rudimentary feature... How does one go about it with Oracle (REF CURSORs ? Are there any workarounds?

    Thank you in advance.

Similar Threads

  1. Stored procedure and ODBC
    By filya in forum Qt Programming
    Replies: 2
    Last Post: 15th March 2010, 08:40
  2. Stored procedure return values problem
    By jgreetham in forum Qt Programming
    Replies: 7
    Last Post: 10th September 2007, 17:38
  3. no record returns from stored procedure
    By mandal in forum Qt Programming
    Replies: 0
    Last Post: 26th April 2007, 14:45

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.