M
MW
Dear All,
I am having a really strange problem with reading cursors from an Oracle 9i
database for a "particular" procedure. My DataReader does not contain any
rows after I execute the command object. I have tried
cmd.ExecuteReader
and
x = DataAdaptor(cmd)
x.Fill(myDataSet)
I execute the SELECT statement in TOAD/ SQL PLUS and that works fine. The
SELECT statement is a bit complex with lots of outer joins. If I replace it
with a more simple select statement, the procedure executes properly and the
datareader is populated
I then converted the procedure into a function returning the cursor and
executed it on SQL Plus to test if the REFCURSOR is returning empty handed,
such that
var results refcursor
exec :results := PackageName.getAllOrders(ContactId);
print results;
And again I see the output in SQL Plus. Why this is not reflecting in the
DataReader is driving me crazy. The complex SQL has 13 joins (very neccesary
given the nature of the legecy database I am working with). The problem is
also not in the way I am handling the .NET code because the .NET
function/stored procedure works with a simpler SELECT statement. I have
other stored procedures defined similairly that work properly . I have also
followed the MSDN examples to see of there is any difference. There is none.
Is there any limitations in returning complex selects in a REF CURSOR?
Any idea would be greatly appreciated.
Many thanks,
Wazir
I am having a really strange problem with reading cursors from an Oracle 9i
database for a "particular" procedure. My DataReader does not contain any
rows after I execute the command object. I have tried
cmd.ExecuteReader
and
x = DataAdaptor(cmd)
x.Fill(myDataSet)
I execute the SELECT statement in TOAD/ SQL PLUS and that works fine. The
SELECT statement is a bit complex with lots of outer joins. If I replace it
with a more simple select statement, the procedure executes properly and the
datareader is populated
I then converted the procedure into a function returning the cursor and
executed it on SQL Plus to test if the REFCURSOR is returning empty handed,
such that
var results refcursor
exec :results := PackageName.getAllOrders(ContactId);
print results;
And again I see the output in SQL Plus. Why this is not reflecting in the
DataReader is driving me crazy. The complex SQL has 13 joins (very neccesary
given the nature of the legecy database I am working with). The problem is
also not in the way I am handling the .NET code because the .NET
function/stored procedure works with a simpler SELECT statement. I have
other stored procedures defined similairly that work properly . I have also
followed the MSDN examples to see of there is any difference. There is none.
Is there any limitations in returning complex selects in a REF CURSOR?
Any idea would be greatly appreciated.
Many thanks,
Wazir