6.1.1 Rules for writing SQL statements
- Organization of this subsection
(1) Specifying the order of options
Specify options in the order in which they are described in the specification format of each SQL statement.
(2) Specifying keywords
Terms that have to be specified in order to use a built-in SQL capability, such as the names of SQL statements (SELECT, UPDATE, and so on), are called keywords. Because most keywords are registered as system-reserved words, they can be specified only at prescribed positions within SQL statements.
However, keywords that are not registered as reserved words can be used as names. Examples of keywords and names are given in the following figure.
The following are specified as names:
-
Index identifiers
-
Correlation names
-
Query names
-
Authorization identifiers
-
Schema identifiers
-
Table identifiers
-
Column names
-
Constraint names
-
DB area names
For details about reserved words, see 6.10 Reserved words.
(3) Specifying numeric values
In SQL statements, specify numeric values that are not numeric literals using the conventions and restrictions of unsigned integers. The following are numeric values that are not numeric literals:
-
Percentage of unused area (percentage of unused area in table and index definitions)
-
Length, maximum length (length and maximum length of character string data and binary data)
-
Precision (number of digits for decimal data)
-
Scaling (number of digits to the right of the decimal point for decimal data)
-
Fractional seconds precision (number of digits in the fractional seconds of time data and time stamp data)
(4) Maximum size of an SQL statement
The maximum size of an SQL statement is 16,000,000 bytes.
For a view definition (CREATE VIEW statement), the maximum size is 64,000 bytes.