Re: Accessing a weak refcursor
Date: Tue, 7 Sep 2010 09:45:51 -0700 (PDT)
Message-ID: <00511090-b460-4b67-91e3-3f6173e530e5_at_x20g2000pro.googlegroups.com>
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 see http://www.morganslibrary.com/hci/hci003.html
jg
-- _at_home.com is bogus. http://www.marketwatch.com/story/oracle-shares-jump-as-mark-hurd-joins-firm-2010-09-07Received on Tue Sep 07 2010 - 11:45:51 CDT