Truncate: it is a DDL operation that does not record logs, cannot be rolled back, and does not trigger. The performance is faster;
However, you must be careful when using it;
Delete: a dml operation that can be rolled back and starts tirigger. The performance is slower;
Note:
1. truncate cannot be used for table variables;
Declare @ temptable table (id int)
Improved the truncate method in smarty to support Chinese characters, smartytruncate
This article describes how to improve truncate in smarty to support Chinese characters. We will share this with you for your reference. The details are as follows:
The truncate of smarty cannot intercept Chinese characters. Change modifier. t
This article mainly introduces node. fs. the truncate method is described in this article. methods, syntax, parameters, instances, and source code for truncate. For more information, see
Method description:
File Content truncation.
Syntax:
The Code is as follows:
Fs. truncate (path, len, [callback (err)])
Because this method belongs to the fs module, we need
Truncate table
The truncate table function is the same as the delete statement without the WHERE clause: both delete all rows in the table. However, truncate table is faster than delete and uses less system and transaction log resources.The delete statement deletes a row at a time and records one row in the transaction log.
colleagues can query the data in the table, but when truncate this table hold ORA-00942: The table or view does not exist
The beginning thought is the table name writes has the question, but later discovered that he deletes is not the table, but is a synonym (synonym)
It is not possible to use truncat for synonyms synonym.
Connected to Oracle Database 11g Enterprise Edition release 11.2.0.1.0Connected as Scott
Sql> SELECT COUNT (1) from t_emp;
COU
Label:1. Delete: Delete rows from the datasheet (you can delete a row or delete all rows without deleting the data table)Delete a row: Delete from data table name where column name = value;Delete all rows: Delete*from data table name2. Drop: Delete a datasheet or database or table fieldDelete database: Drop database nameDelete a data table (the structure, properties, and indexes of the table are also deleted): Use database namedrop table data table 1 name, data table 2 nameDelete a data table fi
Oracle (2) DDL statement create, alert, drop, truncate II. data Definition (DDL) Section www.2cto.com 1. CREATE (create table, index, view, synonym, process, function, database link, etc.) Common ORACLE field types include CHAR fixed length string VARCHAR2 Variable Length string www.2cto.com NUMBER (M, n) number M indicates the total length of digits, and N indicates the length of decimal places. When creating a table of the DATE type, we need to put
DB2 TRUNCATE is used in DB2. There are two common methods to quickly clear data in a TABLE: alter table O_LNB_SM_USERINFO activate not logged initially with empty table; delete the table O_LNB_SM_USERINFO without logging the second import from 'empty file' of ixf messages log1.txt replace into test. replace the data in the original table with an empty file but starting from V9.7, DB2 supports TRUNCATE to qu
Change the contents of the plugins/modifier. truncate. php file
Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->
PHP
/*
* smarty plugin * ----------------------------------------------------- * type: modifier * Name: truncate * purpose: truncate a string to a certain length if necessary, * opt
TRUNCATE TABLE name;Delete from table name;is used to delete all the records in the table, the former delete the data after the table's identity column will restart numbering, it is more than the DELETE statement using the system resources and transaction log resources, but the table structure, columns, constraints, indexes, etc. will not be changed, it cannot be used in a table with a FOREIGN key constraint reference, and in practice it is not recomm
BackgroundReceived the user declaration, the new brother accidentally put the database of the 3 key tables to truncate, because this business is still in the testing phase, the system does not have any form of backup.The customer's OS platform is the Windows platform and the database is Oracle9207In this case, an attempt was made to use aul to recover. This explains the recovery of one of the tables (XM_FXL)Pre-recovery Preparation a1. Download the Au
The truncate transaction cannot be rolled back, And the delete transaction can be rolled back. Truncate is similar to delete statements without where statements. Because truncate uses less system and transaction logs, the efficiency is much higher than the delete statement of a row.Truncate deletes the table content, releases the table content, and does not delet
Differences between truncate, drop, and delete
1. From the classification perspectiveTruncate and drop are DDL (Data Definition Language)Delete belongs to DML (data manipulation language)
2. From the perspective of Table StructureTruncate and delete only delete data, not delete table structureDrop delete data and Table Structure
3. SecurityTruncate and drop do not support rollbackDelete supported
4. Speed ()The drop table employ
Smarty truncate detailed usage .....
Ask:
What is the use of Smarty's truncate? Why do I want to intercept the length of the character and the actual interception of the difference so far??
Template Part code:
{$title |truncate:15}
PHP Handler Section code:
$smarty->assign ("title", "What are you doing if you had more money?");
How to show it is: what w
Smarty in the use of truncate to intercept the string containing Chinese and English, there may be garbled problems, the length of string interception, the following is a new extension function, or modify the original Truncate function method can also be.
Expand the Smarty/plugins directory to create a new file, write a function,Modified smarttruncate: File name: modifier.smartTruncate.php content is as fol
Similarities and differences of Truncate,delete,drop
Description: This digest is from Oracle Technology user discussion Group truncate , the similarities and differences of Delete,drop.Note that the delete here is the DELETE statement without the WHERE clauseSame point:truncateand delete with no WHERE clause, and drop deletes data in the tableDifferent points:1.truncateand delete Deletes only the data do no
Tags: differences between SQL rollback AMP Records Delete solutionPlease indicate the difference between delete from TableA truncate TABLE TableA in SQL ServerAnswer: Both can be used to delete all records in the table. The difference is that truncate is a DDL operation that moves the HWK so that the HWK value is 0 and does not require rollback segment. And delete is a DML operation that requires rollback
Delete the data in the table, using delete. The format is:Delete from table name where remove condition; Example: Delete a record whose name is Zhang San in the student table.Delete from where="Zhang San"; Clears the data in the table, saves the table structure, and uses truncate. The format is:Table name;Instance: Clears all data in the student table.Truncate table student;Delete a table with drop, that's all. The format is:Drop table name
Sometimes we decide that we need to clear a table from the database. In fact, if we can't do that, that would be a big problem, because the database Administrator-DBA is bound to be unable to manage the database efficiently.Fortunately, SQL has the syntax to provide a DROP table to let us clear the table. The syntax for DROP TABLE is:DROP table "table name";If we want to clear the customer form created in SQL Create, we'll break in:DROP TABLE Customer;Sometimes we will need to clear all the info
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service