OSDN Git Service

FIRST REPOSITORY
[eos/hostdependOTHERS.git] / I386LINUX / util / I386LINUX / man / man7 / truncate.7
1 .\\" auto-generated by docbook2man-spec $Revision: 1.25 $
2 .TH "TRUNCATE" "7" "2003-11-02" "SQL - Language Statements" "SQL Commands"
3 .SH NAME
4 TRUNCATE \- empty a table
5
6 .SH SYNOPSIS
7 .sp
8 .nf
9 TRUNCATE [ TABLE ] \fIname\fR
10 .sp
11 .fi
12 .SH "DESCRIPTION"
13 .PP
14 \fBTRUNCATE\fR quickly removes all rows from a
15 table. It has the same effect as an unqualified
16 \fBDELETE\fR but since it does not actually scan the
17 table it is faster. This is most useful on large tables.
18 .SH "PARAMETERS"
19 .TP
20 \fB\fIname\fB\fR
21 The name (optionally schema-qualified) of the table to be truncated.
22 .SH "NOTES"
23 .PP
24 \fBTRUNCATE\fR cannot be used if there are foreign-key references
25 to the table from other tables. Checking validity in such cases would
26 require table scans, and the whole point is not to do one.
27 .PP
28 \fBTRUNCATE\fR will not run any user-defined ON DELETE triggers
29 that might exist for the table.
30 .SH "EXAMPLES"
31 .PP
32 Truncate the table bigtable:
33 .sp
34 .nf
35 TRUNCATE TABLE bigtable;
36 .sp
37 .fi
38 .SH "COMPATIBILITY"
39 .PP
40 There is no \fBTRUNCATE\fR command in the SQL standard.