Job Seekers   Employers
dbapool: Authors | Submissions | Contact Us
   Forgot password? | Sign up
  Home   Discussion Forum   Articles   Interview Questions   FAQs   Scripts   Rewards   Analyzer   White Papers   Blog   Certification   Downloads   Tools
 

Topic: SQL*Plus and PL/SQL >> about deleting: answer plz

Disclaimer: The purpose of all dbapool forums including OCP and Other Oracle Certification forums is to help each other with specific issues but not to share dump and copyrighted exam content, materials or intellectual property. You may review the entire Oracle Certification Program Candidate Agreement online Here.



  


 Title: about deleting: answer plz
 Sachin  Posted: Mar 29, 2007 10:47:17 AM

 Total Post: 2
 Joined: Feb, 2007






 I want to know how to delete all the tables using a single query?

 Jayanta
Posted: Mar 29, 2007 12:43:58 PM  

 Total Post: 479
 Joined: Feb, 2006






 
drop table &tablename;

 Sachin
Posted: Mar 31, 2007 02:12:40 AM  

 Total Post: 2
 Joined: Feb, 2007






 
yes!
u r right for deleting a single table. but my query is to delete all the tables using a single query.

 Devesh
Posted: Apr 02, 2007 03:39:49 AM  

 Total Post: 29
 Joined: Oct, 2005






 
To Drop all your tables you can use the following in a script:

SET NEWPAGE 0
SET SPACE 0
SET LINESIZE 80
SET PAGESIZE 0
SET ECHO OFF
SET FEEDBACK OFF
SET HEADING OFF
SET MARKUP HTML OFF
SET ESCAPE \
SPOOL DELETEME.SQL
select 'drop table ', table_name, 'cascade constraints \;' from user_tables;
SPOOL OFF
@DELETEME



 bigPapas
Posted: Apr 03, 2007 05:59:38 PM  

 Total Post: 14
 Joined: Apr, 2007






 
if you want to drop all tables from a particular schema, just drop and recreate the schema. All underlying objects owned by the schema will be dropped as well. If you aren't using TOAD or SQL Developer, manually gather info about the user, default table space, password, roles and privs. Then drop and recreate.

 Time Zone: EDT

  




Forum Rules & Description


Who Can Read The Forum? Any registered user or guest
Who Can Post New Topics? Any registered user
Who Can Post Replies? Any registered user




 








Get FREE Magazines

Top 10 Forum User

  Murtuja Khokhar857
  Mohammed Taj746
  positive fanatic483
  Jayanta Sur479
  Vigyan Kaushik386
  Gopu Gopi327
  Gitesh Trivedi322
  Vinoth Kumar264
  neeraj sharma258
  Ramesh Jois246






oracle Mag



  About Us Advertise Terms of Use Privacy Newsletters Contact Us    

Home   Discussion Forum   FAQs  Articles  Jobs   Newsletters  Directory  Downloads 

Our Premium Sponsor
Confio Software