Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: PL/SQL: Passing TABLE NAME into module for SELECTs ???
Yes use execute immediate (8i and later) or dbms_sql. Just don't expect
this to scale well. That is this type of thing is fine for once in a while
but would be a performance and scalability killer in an oltp application!
Jim
"jane" <janeyiu_at_optonline.net> wrote in message
news:plIB7.3102$C7.1087772_at_news02.optonline.net...
> I am trying to pass a table name into a module to be used
> in the FROM clause....like below, this is NOT allowed, is it ?
> What's the proper way ? DBMS_SQL ?
> Thanks Jane
>
> Procedure pass_this_junk ( v_tab_name IN VARCHAR2)
> IS
> v_count INTEGER;
> BEGIN
> SELECT count(*) INTO v_count FROM v_tab_name;
> ..................
>
> END;
>
>
Received on Wed Oct 24 2001 - 18:47:52 CDT
![]() |
![]() |