Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: table name
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||' whererownum < 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
![]() |
![]() |