Create a copy table from all_objects : Copy Table « Table « Oracle PL / SQL






Create a copy table from all_objects

    
SQL> create table t as select * from all_objects;
SQL>
SQL> create or replace function get_row_cnt return number
  2  as
  3          countValue   number;
  4  begin
  5          select count(*) into countValue from t;
  6          return countValue;
  7  end;
  8  /
SQL>
SQL> show parameter optimizer_features
                                                              

NAME                                  TYPE         VALUE
------------------------------------  -----------  ------------------------------
optimizer_features_enable             string       8.1.5
SQL>
SQL> alter session set sql_trace=true;
SQL>
SQL>
SQL> exec dbms_output.put_line( get_row_cnt );
12583
SQL>
SQL> alter system
  2  set optimizer_features_enable = '8.1.5' scope = spfile;
SQL>
SQL> drop table t;
SQL>

   
    
    
    
  








Related examples in the same category

1.Use copy command to create new table
2.Create a copy table and insert value to it
3.Copying selected columns from another table
4.Copying selected columns from multiple tables
5.CREATE Table from another table with consitions
6.Duplicate some or all of the data in one table under a different table name
7.Create a copy table with primary key setting
8.Copying table
9.Copying table structure not data
10.Create table as select * from another
11.Creating from Another Table
12.The table is created with no rows if the query returned no rows.