Home » SQL & PL/SQL » SQL & PL/SQL » Compare and contrast TRUNCATE and DELETE for a table
Compare and contrast TRUNCATE and DELETE for a table [message #665250] Mon, 28 August 2017 02:03 Go to next message
Meenakumari
Messages: 3
Registered: August 2017
Junior Member
HI iam learning oracle in Naresh i Technologies can any body help Compare and contrast TRUNCATE and DELETE for a table?

Re: Compare and contrast TRUNCATE and DELETE for a table [message #665260 is a reply to message #665250] Mon, 28 August 2017 05:51 Go to previous messageGo to next message
Littlefoot
Messages: 21806
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
The most obvious way to find the answer is to open a relevant Oracle documentation book, read what's written for both commands and compare them.

Another option is to Google for it, such as this.

Or, you might wait for someone to spoonfeed you.
Re: Compare and contrast TRUNCATE and DELETE for a table [message #665270 is a reply to message #665250] Mon, 28 August 2017 07:30 Go to previous messageGo to next message
adil shakeel
Messages: 47
Registered: August 2017
Member
the use of delete can be used for deleting records falling under certain condition which is true or false depending upon our requirements.

The truncate always delete the all record of table and as a result the table got empty.

Say :
use of delete:

Delete from customers where id>5;

The above command would delete only those records in which customers' id greater that 5.

However in the truncate we can not delete the customized records.

Re: Compare and contrast TRUNCATE and DELETE for a table [message #665271 is a reply to message #665250] Mon, 28 August 2017 07:31 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
Meenakumari wrote on Mon, 28 August 2017 00:03
HI iam learning oracle in Naresh i Technologies can any body help Compare and contrast TRUNCATE and DELETE for a table?

ask the fine folks at URL below for answer

Meenakumari wrote on Mon, 28 August 2017 00:35
Hi nareshit is the Best Oracle Training Institute In India. It provides all software courses. we located Hyderabad, chennai and vijayawada. we offering online training also faculty are well experienced. so i suggest Naresh i Technologies is the Best.
Call:040-23746666
Re: Compare and contrast TRUNCATE and DELETE for a table [message #674727 is a reply to message #665250] Tue, 12 February 2019 09:28 Go to previous messageGo to next message
ravikumar99
Messages: 1
Registered: February 2019
Junior Member
If you want to quickly delete all of the rows from a table, and you're really sure that you want to do it, and you do not have foreign keys against the tables, then a TRUNCATE is probably going to be faster than a DELETE.
Re: Compare and contrast TRUNCATE and DELETE for a table [message #674735 is a reply to message #665271] Wed, 13 February 2019 06:51 Go to previous messageGo to next message
EdStevens
Messages: 1376
Registered: September 2013
Senior Member
BlackSwan wrote on Mon, 28 August 2017 07:31
Meenakumari wrote on Mon, 28 August 2017 00:03
HI iam learning oracle in Naresh i Technologies can any body help Compare and contrast TRUNCATE and DELETE for a table?

ask the fine folks at URL below for answer

Meenakumari wrote on Mon, 28 August 2017 00:35
Hi nareshit is the Best Oracle Training Institute In India. It provides all software courses. we located Hyderabad, chennai and vijayawada. we offering online training also faculty are well experienced. so i suggest Naresh i Technologies is the Best.
Call:040-23746666
I take it the OP edited his opening post to remove the blatant advert that you quoted above?

I wonder if they realize how their url comes across in the English-speaking world? Cool
Re: Compare and contrast TRUNCATE and DELETE for a table [message #674737 is a reply to message #674735] Wed, 13 February 2019 15:18 Go to previous messageGo to next message
John Watson
Messages: 8922
Registered: January 2010
Location: Global Village
Senior Member
Quote:
I wonder if they realize how their url comes across in the English-speaking world?
Holy SMOKE! Like SUGAR off a hot shovel! Do bears DEFECATE in the woods?
Re: Compare and contrast TRUNCATE and DELETE for a table [message #674896 is a reply to message #674737] Thu, 21 February 2019 04:57 Go to previous messageGo to next message
sonudev
Messages: 26
Registered: November 2009
Location: bangalore
Junior Member
Meenakumari,

You need to understand the way delete and truncate work practically. You can google as well. However, the below points can help you differentiate better.

1.Delete operation is selective, whereas Truncate is not selective.

2.Delete is slower than Truncate.

3.Delete involves a temporary memory from where data can be retrieved back through Rollback, which is not possible in case of Truncate.
Re: Compare and contrast TRUNCATE and DELETE for a table [message #674904 is a reply to message #674896] Thu, 21 February 2019 06:42 Go to previous messageGo to next message
EdStevens
Messages: 1376
Registered: September 2013
Senior Member
sonudev wrote on Thu, 21 February 2019 04:57
Meenakumari,

You need to understand the way delete and truncate work practically. You can google as well. However, the below points can help you differentiate better.

1.Delete operation is selective, whereas Truncate is not selective.

2.Delete is slower than Truncate.

3.Delete involves a temporary memory from where data can be retrieved back through Rollback, which is not possible in case of Truncate.
Unfortunately, the OP opened this thread well over a year ago and hasn't been heard from since. I seriously doubt he is still looking for an answer. Actually, I somewhat doubt if he was ever looking for an answer, since his message included a promotional statement for some "institute".
Re: Compare and contrast TRUNCATE and DELETE for a table [message #675506 is a reply to message #674737] Tue, 02 April 2019 13:50 Go to previous message
dragam
Messages: 31
Registered: May 2012
Location: Ireland
Member
John Watson wrote on Wed, 13 February 2019 22:18
Quote:
I wonder if they realize how their url comes across in the English-speaking world?
Holy SMOKE! Like SUGAR off a hot shovel! Do bears DEFECATE in the woods?

OMG! Is "DEFECATE" an official Oracle command? I've searched the documentation and can't find it! Worried now...

Previous Topic: Find next working day within the same period
Next Topic: How To Retrieve string unto first pipe symbol in query
Goto Forum:
  


Current Time: Thu Mar 28 16:59:00 CDT 2024