Create sql statements from user_tables : USER_TABLES « System Tables Views « Oracle PL / SQL






Create sql statements from user_tables

    

SQL> SELECT 'DROP TABLE ' || table_name || ' CASCADE CONSTRAINTS;' FROM user_tables;

'DROPTABLE'||TABLE_NAME||'CASCADECONSTRAINTS;'
--------------------------------------------------------------
DROP TABLE SYSTEM_STATS CASCADE CONSTRAINTS;
DROP TABLE INVENTORY_TBL CASCADE CONSTRAINTS;
DROP TABLE DEPT$AUDIT CASCADE CONSTRAINTS;
DROP TABLE PASSWORD_AUDIT CASCADE CONSTRAINTS;
DROP TABLE EMP_DELTAS CASCADE CONSTRAINTS;
DROP TABLE CUSTLOG CASCADE CONSTRAINTS;
DROP TABLE P CASCADE CONSTRAINTS;
DROP TABLE DEMO CASCADE CONSTRAINTS;
DROP TABLE CUST_NO_KEY_TABLE CASCADE CONSTRAINTS;
DROP TABLE IT CASCADE CONSTRAINTS;
DROP TABLE P1 CASCADE CONSTRAINTS;
DROP TABLE MYSTATS CASCADE CONSTRAINTS;
DROP TABLE WORKING_EMPS CASCADE CONSTRAINTS;
DROP TABLE WORKING_EMPLOYEES CASCADE CONSTRAINTS;
DROP TABLE EMPTEMPTABLE CASCADE CONSTRAINTS;
DROP TABLE TEMP_TABLE CASCADE CONSTRAINTS;
DROP TABLE EMPLOYEETEMPTABLE CASCADE CONSTRAINTS;
DROP TABLE TMP CASCADE CONSTRAINTS;
DROP TABLE PARMS CASCADE CONSTRAINTS;
DROP TABLE IX CASCADE CONSTRAINTS;
DROP TABLE CUST_WITH_VARRAY_TEMP_TABLE CASCADE CONSTRAINTS;
DROP TABLE WORKING_CUSTOMERS CASCADE CONSTRAINTS;

22 rows selected.

   
    
    
    
  








Related examples in the same category

1.query table_name, tablespace_name from user_tables
2.Query a table in user_table by table_name
3.Query user_tables for the table just created
4.To get a listing of all tables that you own
5.User_tables structure
6.Get table name and table space for a table by its name
7.alter table emp move tablespace users and then check the result by querying user_tables
8.Verify the creation of the statistics by running the following queries: