Get ref cursor data dynamically - HOW ????
Date: 14 Feb 2003 02:43:59 -0800
Message-ID: <33c9717f.0302140243.415b1b72_at_posting.google.com>
Guys,
I'm in stupor, pleeeeease heeeeelp ! :o)
Seriously, here is what's going on. I'ge got a ref cursor which comes
to my pl/sql procedure as a parameter. Now I need to create a
temporary table with corresponding structure, rake the cursor data out
and save the whole bunch of crap in the table. The thing is that such
ref cursor can be different at any time, i.e. I have no pre-defined
%rowtype to fetch the data into, so I need to prepare it dynamically
as soon as the cursor appears. There is no problem with field
names/attributes because each time I know what package/procedure the
cursor has came from, so I just use all_arguments view. But I've got
stuck on a very stupid problem. I can not bind the ref cursor as an
"IN" parameter into dbms_sql nor EXECUTE IMMEDIATE. Known issue I
guess. Sucks. OK, I tried to find a workaround - there is a nice thing
called JDBC with magic word "getMetaData()". Actually I'm not a Java
guy, but a simple stored Java procedure is not a rocket science, so I
created one. Amazing, there is everything what I need including even
weak cursor info, but all the magic words belong to ResultSet; and the
only way get that RecordSet is to call sql-statement, which returns
ref cursor... What the heck !!! I already DO have ref cursor !!! All I
need is just to pass it as a parameter to the damn Java procedure and
get access to it's info - ref cursor is just a physical pointer to
"select" data in memory. Seems like there is no simple solution, but
probably I just don't know something. Any idea is really appreciated !
Thanks ! Received on Fri Feb 14 2003 - 11:43:59 CET