Re: Accessing a weak refcursor

From: Knickerless Parsons <knickerlessparsons_at_gmail.com>
Date: Wed, 8 Sep 2010 02:36:31 -0700 (PDT)
Message-ID: <db215772-51ab-4351-aa6d-6e128c2b3086_at_t20g2000yqa.googlegroups.com>



On Sep 7, 5:45 pm, joel garry <joel-ga..._at_home.com> wrote:
> On Sep 7, 6:55 am, Knickerless Parsons <knickerlesspars..._at_gmail.com>
> wrote:
>
> > Hi all,
> > I'm trying to write a clever stored procedure that I can pass in a
> > table name and a where clause, and it'll display all matching rows in
> > a firendly manner.
>
> > For example:
>
> ...
>
>
>
> >          -- Strip off the trailing comma and space
> >          w_sql := SUBSTR(w_sql,1,LENGTH(w_sql) -2) ;
> >          --
> >          -- Add the from and where cluases
> >          w_sql := w_sql || ' FROM ' || p_owner || '.' || p_table || '
> > WHERE ' || p_where ;
>
> >          --
> >          -- Diagnostic to display the SQL
> >          DBMS_OUTPUT.PUT_LINE('Generated the following SQL...') ;
> >          wrap(w_sql,80) ;
>
> >          OPEN w_get_data FOR w_sql ;
>
> >          -- ????????????????????
> >          CLOSE w_get_data ;
>
> >       ELSE
> >          DBMS_OUTPUT.PUT_LINE('Table ' || p_owner || '.' || p_table ||
> > ' not found!') ;
> >       END IF ;
> >       CLOSE c_get_cols ;
> >    EXCEPTION
> >       WHEN OTHERS THEN
> >          DBMS_OUTPUT.PUT_LINE('[' || SQLERRM || ']') ;
> >    END showme ;
>
> > BEGIN
> >    showme('DAVE','JOBS','JOB_NUMBER=''123''') ;
> > END ;
> > /
>
> This kind of thing is out of my comfort zone, but seehttp://www.morganslibrary.com/hci/hci003.html
>
> jg
> --
> _at_home.com is bogus.http://www.marketwatch.com/story/oracle-shares-jump-as-mark-hurd-join...

Thanks for the pointers, I've had a look at the article and it looks like it'll do what I want but it only applies to Oracle 11g and I'm stuck with 10! So I'll probably shelve this until we upgrade as I'm in danger of spending more time trying to be sexy than if I wasn't!

Thanks again for your input.

Dave. Received on Wed Sep 08 2010 - 04:36:31 CDT

Original text of this message