Re: Help: Dynamic where clause in a PL/SQL procedure
From: <seci_at_ludens.elte.hu>
Date: 1996/11/06
Message-ID: <1996Nov6.075626.33490_at_ludens>#1/1
>
> emp_rec emp.empno%type;
> begin
> dbms_output.enable;
> open c;
> loop
> fetch c into emp_rec;
> exit when c%notfound;
> dbms_output.put_line(emp_rec);
> end loop;
> close c;
> end;
>
> Thanks in Advance.
>
> --
> Muhammad Ahmad Malik
> Western Michigan University
> mamalik_at_cs.wmich.edu - http://www.wmich.edu/frc/ahmad.html
> +1 (616) 373-3065
HTH
peter Received on Wed Nov 06 1996 - 00:00:00 CET
Date: 1996/11/06
Message-ID: <1996Nov6.075626.33490_at_ludens>#1/1
hi,
In article <327E3EB3.7E79_at_cs.wmich.edu>, Muhammad Ahmad Malik <mamalik_at_cs.wmich.edu> writes:
> I want to pass as a variable the "where clause" for a cursor in the
> procedure. There must be someway to handle this. Unfortunatly I don't
> have the manuals.
>
> Example:
>
> create or replace procedure dempno(where_clause varchar)
> as
> cursor c is select empno from emp where_clause;
you should use DBMS_SQL package
look at the source to get some examples, it is better than the manuals
> -- How can I handle this part
> -- ^^^^^^^^^^^^^^
>
> emp_rec emp.empno%type;
> begin
> dbms_output.enable;
> open c;
> loop
> fetch c into emp_rec;
> exit when c%notfound;
> dbms_output.put_line(emp_rec);
> end loop;
> close c;
> end;
>
> Thanks in Advance.
>
> --
> Muhammad Ahmad Malik
> Western Michigan University
> mamalik_at_cs.wmich.edu - http://www.wmich.edu/frc/ahmad.html
> +1 (616) 373-3065
HTH
peter Received on Wed Nov 06 1996 - 00:00:00 CET