PDA

View Full Version : Accessing REF CURSOR in Stored Procedure from Qt



sureshbabu
17th September 2007, 08:26
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

mm78
17th September 2007, 14:33
Not yet supported:
http://trolltech.com/developer/task-tracker/index_html?id=123723&method=entry
http://trolltech.com/developer/task-tracker/index_html?id=146607&method=entry

sureshbabu
17th September 2007, 14:55
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.

avilner
11th August 2010, 15:51
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.