Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Ref Cursors in 8i
mhaggerty_at_mbda.gov (Michael Haggerty) wrote in message news:<a83d9e3a.0306111305.7928f716_at_posting.google.com>...
> Maybe I'm just having a bad day, but I am having a lot of trouble with
> reference cursors in 8i.
>
> What I want to do is this:
>
> PROCEDURE list_feeds(return_data IN OUT the_data) IS
> BEGIN
> OPEN return_data FOR
> SELECT dm.din_name, df.feed_name
> FROM DIN_MASTER dm, DIN_FEEDS df
> WHERE dm.din_id = df.din_id;
> END list_feeds;
>
> But all I can get to work is this:
>
> PROCEDURE list_feeds(return_data IN OUT the_data) IS
> BEGIN
> OPEN return_data FOR
> SELECT * FROM DIN_MASTER;
> END list_feeds;
>
> These procedures appear in a package, and I know there is another way
> to write them. Can someone point me at how to do this?
>
> M
Since the 2 procedures return different type of records, "the_data" needs to be weakly typed. In this case, you don't really need to declare your own refcursor, just use the SYS_REFCURSOR. If you are already using weakly typed refcursor, then the problem is probably not refcursor at all.... Post the errors, like Sybrand said.