Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

delete tables in sql 1

Status
Not open for further replies.

props

Technical User
Nov 22, 2003
17
GB
how can i delete a table in sql? becasue i have create a table called publisher and i can't erase it. Is this has something to do with the clear buffer ??

Thanks in advance
 
Try in SQL*Plus:

Code:
drop table publisher;

[sup]Beware of false knowledge; it is more dangerous than ignorance.[/sup][sup] ~George Bernard Shaw[/sup]
Consultant/Custom Forms & PL/SQL - Oracle 8.1.7 - Windows 2000
 
Please explain what you mean by "erase". That's not an Oracle term, so it's unclear whether you want to drop the table as BJ Cooper suggests, or simply delete all the rows but keept the table structure.
 
There are two ways you can get rid of a table first is asBJ Cooper suggested simple

SQL> drop table publisher;

NOTE: This will remove the entire table structure, its content, and constraints. Basically the table will be completely deleted from the database!

The second method is:

SQL>delete from publisher;
NOTE: This will delete all the rows in the table not the table structure so you can populate the table again.

or you can use truncate, but i won't go into that, hope this helps!


Regards
Bobby
 
Bobby, the third one is somewhere between:

truncate table publisher

Regards, Dima
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top