What is difference between TRUNCATE & DELETE ?

1 Answer

Answer :

TRUNCATE commits after deleting entire table i.e., can not be rolled
back. Database triggers do not fire on TRUNCATEDELETE allows the
filtered deletion. Deleted records can be rolled back or
committed.Database triggers fire on DELETE.

Related questions

Description : What is the difference between DELETE and TRUNCATE statements?

Last Answer : The DELETE command is used to remove rows from a table. A WHERE clause can be used to only remove some rows. If no WHERE condition is specified, all rows will be removed. After performing a DELETE operation ... be fired. As such, TRUCATE is faster and doesn't use as much undo space as a DELETE.

Description : Compare and contrast TRUNCATE and DELETE for a table.

Last Answer : Both the truncate and delete command have the desired outcome of getting rid of all the rows in a table. The difference between the two is that the truncate command is a DDL operation and just ... other hand, is a DML operation, which will produce a rollback and thus take longer to complete.

Description : Differentiate between TRUNCATE and DELETE?

Last Answer : TRUNCATE deletes much faster than DELETE TRUNCATE DELETE It is a DDL statement It is a DML statement It is a one way trip,cannot ROLLBACK One can Rollback Doesn't have selective features (where clause) Has Doesn't fire database triggers Does It requires disabling of referential constraints.

Description : Which one is faster: DELETE or TRUNCATE?

Last Answer : TRUNCATE

Description : Does one need to drop/ truncate objects before importing? (for DBA

Last Answer : Before one import rows into already populated tables, one needs to truncate or drop these tables to get rid of the old data. If not, the new data will be appended to the existing tables. ... to speed up the import process. Indexes can easily be recreated after the data was successfully imported.

Description : What is ON DELETE CASCADE ?

Last Answer : When ON DELETE CASCADE is specified ORACLE maintains referential integrity by automatically removing dependent foreign key values if a referenced primary or unique key value is removed.

Description : How will you delete duplicating rows from a base table?

Last Answer : delete from table_name where rowid not in (select max(rowid) from table group by duplicate_values_field_name); or delete duplicate_values_field_name dv from table_name ta where rowid

Description : What is the usage of an ON-INSERT,ON-DELETE and ON-UPDATE TRIGGERS ? These triggers are execu

Last Answer : These triggers are executes when inserting, deleting and updating operations are performed and can be used to change the default function of insert, delete or update respectively. For Eg, instead of inserting a row in a table an existing row can be updated in the same table.

Description : What are the different types of Delete details we can establish in Master-Details?

Last Answer : Cascade Isolate Non-isolate

Description : What are the different types of Delete details we can establish in Master-Details?

Last Answer : Content canvas views Stacked canvas views Horizontal toolbar vertical toolbar.

Description : Truncate float to 2 or 3 decimal places in Pyhton -Web-Development

Last Answer : answer:

Description : Difference between an implicit & an explicit cursor.?

Last Answer : only one row. However,queries that return more than one row you must declare an explicit cursor or use a cursor FOR loop. Explicit cursor is a cursor in which the cursor name is explicitly ... statements An implicit cursor is used to process INSERT, UPDATE, DELETE and single row SELECT. .INTO

Description : What is difference between a PROCEDURE & FUNCTION ?

Last Answer : A FUNCTION is always returns a value using the return statement. A PROCEDURE may return one or more values through parameters or may not return at all.

Description : What is the difference between OLE Server & Ole Container?

Last Answer : An Ole server application creates ole Objects that are embedded or linked in ole Containers ex. Ole servers are ms_word & ms_excel. OLE containers provide a place to store, display and manipulate ... are created by ole server applications. Ex. oracle forms is an example of an ole Container.

Description : What is the difference between object embedding & linking in Oracle forms?

Last Answer : In Oracle forms, Embedded objects become part of the form module, and linked objects are references from a form module to a linked source file.

Description : What are the difference between lov & list item?

Last Answer : Lov is a property where as list item is an item. A list item can have only one column, lov can have one or more columns.

Description : What is an anchoring object & what is its use? What are the various sub events a mouse double click event involves?

Last Answer : An anchoring object is a print condition object which used to explicitly or implicitly anchor other objects to itself.

Description : What is the main diff. bet. Reports 2.0 & Reports 2.5?

Last Answer : Report 2.5 is object oriented.

Description : To display the page no. for each page on a report what would be the source & logical page no. or & of physical page no.?

Last Answer : & physical page no.

Description : What is the frame & repeating frame?

Last Answer : A frame is a holder for a group of fields. A repeating frame is used to display a set of records when the no. of records that are to displayed is not known before.

Description : What is a physical page ? & What is a logical page ?

Last Answer : A physical page is a size of a page. That is output by the printer. The logical page is the size of one page of the actual report as seen in the Previewer.

Description : How can values be passed bet. precompiler exits & Oracle call interface?

Last Answer : By using the statement EXECIAFGET & EXECIAFPUT.

Description : How is link tool operation different bet. reports 2 & 2.5?

Last Answer : In Reports 2.0 the link tool has to be selected and then two fields to be linked are selected and the link is automatically created. In 2.5 the first field is selected and the link tool is then used to link the first field to the second field.

Description : Spurious tuples may occur due to i. Bad normalization ii. Theta joins iii. Updating tables from join a) i& ii b) ii & iii c) i& iii d) ii & iii

Last Answer : a) i& ii b) ii & iii

Description : Difference between SUBSTR and INSTR ?

Last Answer : INSTR (String1,String2(n,(m)),INSTR returns the position of the mth occurrence of the string 2 instring1. The search begins from nth position of string1.SUBSTR (String1 n,m)SUBSTR returns a character string of size m in string1, starting from nth position of string1.

Description : What is the difference between DBFile Sequential and Scattered Reads?(for DBA

Last Answer : Both "db file sequential read" and "db file scattered read" events signify time waited for I/O read requests to complete. Time is reported in 100's of a second for Oracle 8i releases and below, ... v_$system_event b where a.event = 'db file sequential read' and b.event = 'db file scattered read';

Description : What is the difference between static and dynamic lov

Last Answer : The static lov contains the predetermined values while the dynamic lov contains values that come at run time

Description : What is the difference between NAME_IN and COPY ?

Last Answer : Copy is package procedure and writes values into a field. Name in is a package function and returns the contents of the variable to which you apply.

Description : What is the difference between restoring and recovering? (for DBA

Last Answer : Restoring involves copying backup files from secondary storage (backup media) to disk. This can be done to replace damaged files or to copy/move a database to a new location. Recovery is the process ... as SYSDBA Sql> RECOVER DATABASE UNTIL TIME '2001-03-06:16:00:00' USING BACKUP CONTROLFILE;

Description : What is the difference between online and offline backups? (for DBA

Last Answer : A hot backup is a backup performed while the database is online and available for read/write. Except for Oracle exports, one can only do on- line backups when running in ARCHIVELOG mode. A cold backup is a backup performed while the database is off-line and unavailable to its users.

Description : What is the difference between the SQL*Loader and IMPORT utilities?

Last Answer : These two Oracle utilities are used for loading data into the database. The difference is that the import utility relies on the data being produced by another Oracle utility EXPORT while the SQL* ... from different data sources just so long as it conforms to ASCII formatted or delimited files.

Description : What is the difference between a TEMPORARY tablespace and a PERMANENT tablespace?

Last Answer : A temporary tablespace is used for temporary objects such as sort structures while permanent tablespaces are used to store those objects meant to be used as the true objects of the database.

Description : Explain the difference between a FUNCTION, PROCEDURE and PACKAGE.

Last Answer : A function and procedure are the same in that they are intended to be a collection of PL/SQL code that carries a single task. While a procedure does not have to return any ... functions and procedures that are grouped together based on their commonality to a business function or application.

Description : Explain the difference between $ORACLE_HOME and $ORACLE_BASE.

Last Answer : ORACLE_BASE is the root directory for oracle. ORACLE_HOME located beneath ORACLE_BASE is where the oracle products reside.

Description : Explain the difference between ARCHIVELOG mode and NOARCHIVELOG mode and the benefits and disadvantages to each.

Last Answer : ARCHIVELOG mode is a mode that you can put the database in for creating a backup of all transactions that have occurred in the database so that you can recover to any point in time. ... having to write transactions to an archive log and thus increases the performance of the database slightly.

Description : Explain the difference between a data block, an extent and a segment.

Last Answer : A data block is the smallest unit of logical storage for a database object. As objects grow they take chunks of additional storage that are composed of contiguous data blocks. These groupings ... that an object takes when grouped together are considered the segment of the database object.

Description : Explain the difference between a hot backup and a cold backup and the benefits associated with each.

Last Answer : A hot backup is basically taking a backup of the database while it is still up and running and it must be in archive log mode. A cold backup is taking a backup of the database while it is ... and thus there will be a slight performance gain as the database is not cutting archive logs to disk.

Description : What is the Difference between a post query and a pre query

Last Answer : A post query will fire for every row that is fetched but the pre query will fire only once.

Description : What is the difference between deleting and truncating of tables

Last Answer : Deleting a table will not remove the rows from the table but entry is there in the database dictionary and it can be retrieved But truncating a table deletes it completely and it cannot be retrieved.

Description : What is the difference between candidate key, unique key and primary key

Last Answer : Candidate keys are the columns in the table that could be the primary keys and the primary key is the key that has been selected to identify the rows. Unique key is also useful for identifying the distinct rows in the table.)

Description : What is difference between CHAR and VARCHAR2 ? What is the maximum SIZE allowed for each type ?

Last Answer : CHAR pads blank spaces to the maximum length. VARCHAR2 does not pad blank spaces. For CHAR it is 255 and 2000 for VARCHAR2.

Description : What is difference between UNIQUE and PRIMARY KEY constraints?

Last Answer : A table can have only one PRIMARY KEY whereas there can be any number of UNIQUE keys. The columns that compose PK are automatically define NOT NULL, whereas a column that compose a UNIQUE is not automatically defined to be mandatory must also specify the column is NOT NULL.

Description : Difference between database triggers and form triggers?

Last Answer : Data base trigger(DBT) fires when a DML operation is performed on a data base table. Form trigger(FT) Fires when user presses a key or navigates between fields on the screen -Can be row ... other database triggers to fire.Can cause other database triggers to fire, but not other form triggers.

Description : Difference between procedure and function.?

Last Answer : Functions are named PL/SQL blocks that return a value and can be called with arguments procedure a named block that can be called with parameter. A procedure all is a PL/SQL statement by itself, while a Function call is called as part of an expression.

Description : Difference between NO DATA FOUND and %NOTFOUND?

Last Answer : NO DATA FOUND is an exception raised only for the SELECT....INTO statements when the where clause of the querydoes not match any rows. When the where clause of the explicit cursor does not match any rows the %NOTFOUND attribute is set to TRUE instead.

Description : What is difference between Rename and Alias?

Last Answer : Rename is a permanent name given to a table or column whereas Alias is a temporary name given to a table or column which do not exist once the SQL statement is executed.

Description : What is difference between SQL and SQL*PLUS?

Last Answer : SQL*PLUS is a command line tool where as SQL and PL/SQL language interface and reporting tool. Its a command line tool that allows user to type SQL commands to be executed directly against an Oracle ... SQL*PLUS commands are used to format query result, Set options, Edit SQL commands and PL/SQL.

Description : What is difference between SUBSTR and INSTR?

Last Answer : SUBSTR returns a specified portion of a string eg SUBSTR('BCDEF',4) output BCDE INSTR provides character position in which a pattern is found in a string. eg INSTR('ABC-DC-F','-',2) output 7 (2nd occurence of '-')

Description : What is difference between a formal and an actual parameter?

Last Answer : The variables declared in the procedure and which are passed, as arguments are called actual, the parameters in the procedure declaration. Actual parameters contain the values that are ... procedure and receive results. Formal parameters are the placeholders for the values of actual parameters

Description : What is difference between Procedures and Functions ?

Last Answer : A Function returns a value to the caller where as a Procedure does not.