Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: PL/SQL: Passing TABLE NAME into module for SELECTs ???

Re: PL/SQL: Passing TABLE NAME into module for SELECTs ???

From: Jim Kennedy <kennedy-family_at_home.com>
Date: Wed, 24 Oct 2001 23:47:52 GMT
Message-ID: <IqIB7.46934$Zb.23223607@news1.sttln1.wa.home.com>


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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US