distal-attribute
distal-attribute
distal-attribute
distal-attribute

TRUNCATE not highlight as keyword

User, date Message
Written by zufuliu
10 months ago
Category: General
11 posts since Fri, 31 May 13
TRUNCATE not highlight as keyword.
Want use TRUNCATE other than DELETE to Empty Tables
Written by ansgar
10 months ago
4967 posts since Fri, 07 Apr 06
At least in the current release and also the nightly builds, TRUNCATE *is* highlighted. Only it's both a function and a keyword, and the highlighter decides for the function.

From http://dev.mysql.com/doc/refman/5.0/en/mathematical-functions.html#function_truncate :

TRUNCATE(X,D)
Returns the number X, truncated to D decimal places. If D is 0, the result has no decimal point or fractional part. D can be negative to cause D digits left of the decimal point of the value X to become zero.

From http://dev.mysql.com/doc/refman/5.0/en/truncate-table.html:
TRUNCATE [TABLE] tbl_name
TRUNCATE TABLE empties a table completely. Logically, this is equivalent to a DELETE statement that deletes all rows, but there are practical differences under some circumstances.
Written by zufuliu
10 months ago
11 posts since Fri, 31 May 13
when click the "Empty tabels..." context menu, AUTO_INCREMENT value not changed, but a TRUNCATE command does
Written by ansgar
10 months ago
4967 posts since Fri, 07 Apr 06
What has the "empty tables" menu item to do with the highlighter?

HeidiSQL fires a TRUNCATE <table> command when emptying tables.
 

Please login to leave a reply, or register at first.