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: table name

Re: table name

From: G Quesnel <dbaguy_ott_at_yahoo.com>
Date: 2 Aug 2006 12:55:28 -0700
Message-ID: <1154548528.745591.18100@b28g2000cwb.googlegroups.com>


Just to follow what Mark said, with an example, you could use something like ...
create or replace procedure seltest (p_tablename in varchar2) is   v_obj number;
begin

   Select count(*) into v_obj
     from user_tables
    where table_name = upper(p_tablename);    if v_obj = 0 then

      execute immediate 'Create table '||p_tablename||'_2_at_prod_replic '||

                        'as select * from '||p_tablename||' where
rownum < 1000;';

   end if;
end;
/

Where you can add to the complexity and vary the statement (remove the where clause...) Received on Wed Aug 02 2006 - 14:55:28 CDT

Original text of this message

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