Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: How to refer to a session variable in a PLSQL- Package
Please ignore my other message. I missed the exact nature of the
problem: changing the query in the procedure, not the value of a
parameter.
To do what you what will require dynamic SQL. When you put your code in a procedure, it is already compiled by the time you call it (so it its too late to modify the cursor).
ed.prochak_at_alltel.com (Ed prochak) wrote in message news:<e51b160.0111080717.443a8256_at_posting.google.com>...
> sc2ch_at_yahoo.de (chollet) wrote in message news:<f3d44148.0111080319.7396a322_at_posting.google.com>...
> > Hi everybody
> >
> > The following Script is running perfectly:
> >
> > set verify on
> > set serveroutput on size 500000
> > define foo = upper
> >
> > declare
> > c_nr number(08);
> > c_value varchar2(50);
> > cursor c1 is
> > select nr, name
> > from client
> > where &foo(name) = &foo('Name_Sample');
> > begin
> > open c1;
> > loop
> > fetch c1 into c_nr, c_value;
> > exit when c1%notfound;
> > dbms_output.put_line('Name: '||c_nr||'/'||c_value);
> > end loop;
> > close c1;
> > end;
> >
> > ---
> > But how is it possible to refer to the session-variable 'foo' within a
> > plsql package on the db?
> >
> > Any tips or tricks are highly appriciated.
> >
> > Thanks Steve
Received on Fri Nov 09 2001 - 11:52:27 CST
![]() |
![]() |