| | |
deleting the tables
Please support our Oracle advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Aug 2007
Posts: 6
Reputation:
Solved Threads: 0
You have two options:
---------------------------------------
1) Create a script
set lines 200;
set pages 10000;
spool c:\DROP_TABLES.txt;
select 'DROP TABLE '||table_name||';'
from all_tables
where owner = 'SCOTT';
-- change the SCOTT to the owner of the tables you need to drop.
spool off;
---------------------------------------
@c:\DROP_TABLES.txt; -- to run the script that we created.
-- repeat this step tell u drop all the tables.
---------------------------------------
2) From the Enterprise Manager , Drop the owner Schema.
Regards.
---------------------------------------
1) Create a script
set lines 200;
set pages 10000;
spool c:\DROP_TABLES.txt;
select 'DROP TABLE '||table_name||';'
from all_tables
where owner = 'SCOTT';
-- change the SCOTT to the owner of the tables you need to drop.
spool off;
---------------------------------------
@c:\DROP_TABLES.txt; -- to run the script that we created.
-- repeat this step tell u drop all the tables.
---------------------------------------
2) From the Enterprise Manager , Drop the owner Schema.
Regards.
•
•
Join Date: Jul 2008
Posts: 1
Reputation:
Solved Threads: 0
Oracle Syntax (Toggle Plain Text)
BEGIN FOR c IN (SELECT table_name FROM user_tables) LOOP EXECUTE IMMEDIATE ('drop table '||c.table_name||' cascade constraints); end loop; End;
Best regard,
<URL SNIPPED>Fellow Developer
---------------------------------------------------------------------
Visit URL: <URL SNIPPED>
Last edited by peter_budo; Mar 18th, 2009 at 7:33 am. Reason: Keep It Organized - For easy readability, always wrap programming code within posts in [code] (code blocks) and [icode] (inline code) tags.
![]() |
Similar Threads
- Searching for a record in multiple tables (VB.NET)
- Deleting a Row From A DataGrid (VB.NET)
- Delete from multiple tables (MySQL)
- Code not working for deleting recordfrom a file (Visual Basic 4 / 5 / 6)
- IE Cache not deleting a URL (Web Browsers)
Other Threads in the Oracle Forum
- Previous Thread: update a record on load
- Next Thread: Problem in viewing isqlplus on Internet Explorer
| Thread Tools | Search this Thread |
2009predictions acquisition amazon.com bartz bernanke cia citrix cloudcomputing crm database dell economy editor enterprise enterprise2.0 enterprisesoftware federalreserve forbes hp ibm intellipedia internet larryellison layoffs linux loughridge mediawiki michaeljackson microsoft neverland nortel notebooks oil operatingsystem oracle palm rimm saas salesforce sap seagate socialcomputing sql sun sybase technologystocks virtualiron virtualization vmware wiki wikipedia xen yahoo zoho




how to delete all the tables in the a user at a time? 

