Re: Get ref cursor data dynamically - HOW ????

From: Brian E Dick <bdick_at_cox.net>
Date: Fri, 14 Feb 2003 13:55:10 GMT
Message-ID: <2z63a.5366$4F3.321491_at_news2.east.cox.net>


Cursors don't have to be bound to a %rowtype. They can be totally generic. The only requirement is that you have the right number and type of variables when you do the fetch.

"V. Pryadkin" <vpryadkin_at_yahoo.com> wrote in message news: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 - 14:55:10 CET

Original text of this message