This content has been marked as final. Show 5 replies
You cannot select something that is a CURSOR in a select statement and have it be the same as if you hadn't called the function.
In one case you're selecting rows that contains a result-set in each row.
In the other case your just selecting the base results.
These have different shapes.
You can bind a JDBC parameter as type OracleTypes.CURSOR and then cast that result to a JDBC ResultSet to fetch the data from the ref cursor.
Thanks for the reply.
I was trying to fool an API (C) toolkit
into thinking that it was getting results
from a SELECT statement while in fact
it would call a function that returned a
I think ref cursor are very interesting, but
I struggle to find good information about them....
Anyway, thanks for your book and the XSQL servlet also.
They are really good tools for what I do right now (system integration).
I take your book home and bring it back to
work every day....
Glad the book is proving useful to you.
I have a stored function that returns a ref cursor and I want to use it in select
I tried the following code
for example if the ref cursor returned rows of varchar2
I will define an object
CREATE TYPE myType as OBJECT( doc_type VARCHAR2(256));
created a type as a table of myType
create or replace type myTable as table of myType;
If I write a select statement like below
select * from TABLE(CAST(function_name() AS myTable))
ERROR at line 1:
ORA-00932: inconsistent datatypes: expected - got CURSER
I get this error
Can anyone give any clue why this does throw an error or if there is a second way to do this,
I was trying to do the exact same thing. In my case, the IDE I am using is based on .NET framework, not Java.
What book are you guys talking about?