Professional Documents
Culture Documents
DataModeling Agile
DataModeling Agile
Information Technology -
July 1992
(Second Informal Review Draft) ISO/IEC 9075:1992, Database
Language SQL- July 30, 1992
Digital Equipment Corporation
Maynard, Massachusetts
Contents Page
Foreword.........................................................xi
Introduction.....................................................xiii
1 Scope ........................................................ 1
3.3.4Exceptions .................................................10
3.3.5Descriptors ................................................14
4 Concepts .....................................................19
4.5.1Datetimes ..................................................30
4.5.2Intervals ..................................................32
4.10.Assertions .................................................43
8 Predicates ...................................................205
Table of Contents v
11.24<drop domain default clause> ...............................306
12 Module .......................................................341
21.3.Introduction ...............................................566
23 Conformance ..................................................625
Index
Table of Contents ix
TABLES
Table Page
Foreword
Introduction
Introduction xiii
X3H2-92-154/DBL CBR-002
Introduction xv
X3H2-92-154/DBL CBR-002
1 Scope
Scope 1
X3H2-92-154/DBL CBR-002
- SQL procedures, or
2 Normative references
____________________
[1] To be published
Normative references 3
X3H2-92-154/DBL CBR-002
3.1 Definitions
a) character
b) octet
c) variable-length coding
d) fixed-length coding
3.2 Notation
SymbolMeaning
< > Angle brackets delimit character strings that are the names
of syntactic elements, the non-terminal symbols of the SQL
language.
::= The definition operator. This is used in a production rule to
separate the element defined by the rule from its definition.
The element being defined appears to the left of the opera-
tor and the formula that defines the element appears to the
right.
1) Select any one option from those defined in the right hand side
of a production rule for the element, and replace the element
with this option.
2) Replace each ellipsis and the object to which it applies with
one or more instances of that object.
3.3 Conventions
3.3.4.1 Exceptions
In the Syntax Rules, the term shall defines conditions that are
required to be true of syntactically conforming SQL language. When
such conditions depend on the contents of the schema, then they
are required to be true just before the actions specified by the
General Rules are performed. The treatment of language that does
not conform to the SQL Formats and Syntax Rules is implementation-
dependent. If any condition required by Syntax Rules is not sat-
isfied when the evaluation of Access or General Rules is attempted
and the implementation is neither processing non-conforming SQL
language nor processing conforming SQL language in a non-conforming
manner, then an exception condition is raised: syntax error or
access rule violation (if this situation occurs during dynamic ex-
ecution of an SQL-statement, then the exception that is raised is
syntax error or access rule violation in dynamic SQL statement; if
the situation occurs during direct invocation of an SQL-statement,
then the exception that is raised is syntax error or access rule
violation in direct SQL statement).
In the Access Rules, the term shall defines conditions that are
required to be satisfied for the successful application of the
General Rules. If any such condition is not satisfied when the
General Rules are applied, then an exception condition is raised:
syntax error or access rule violation (if this situation occurs
during dynamic execution of an SQL-statement, then the exception
that is raised is syntax error or access rule violation in dynamic
SQL statement; if the situation occurs during direct invocation of
an SQL-statement, then the exception that is raised is syntax error
or access rule violation in direct SQL statement).
In the Leveling Rules, the term shall defines conditions that are
required to be true of SQL language for it to syntactically conform
to the specified level of conformance.
The Syntax Rules and Access Rules for contained syntactic elements
are effectively applied at the same time as the Syntax Rules and
Access Rules for the containing syntactic elements. The General
Rules for contained syntactic elements are effectively applied be-
fore the General Rules for the containing syntactic elements. Where
the precedence of operators is determined by the Formats of this
International Standard or by parentheses, those operators are ef-
fectively applied in the order specified by that precedence. Where
the precedence is not determined by the Formats or by parentheses,
effective evaluation of expressions is generally performed from
the Syntax Rules and Access Rules for <A>, <B>, and <C> are ef-
fectively applied simultaneously. The General Rules for <B> are
applied before the General Rules for <C>, and the General Rules for
<A> are applied after the General Rules for both <B> and <C>.
In the Syntax and General Rules, the phrase "X is implicit" indi-
cates that the Syntax and General Rules are to be interpreted as if
the element X had actually been specified.
In the Syntax and General Rules, the phrase "the following <X> is
implicit: Y" indicates that the Syntax and General Rules are to be
interpreted as if a syntactic element <X> containing Y had actually
been specified.
In the Syntax Rules and General Rules, the phrase "former is equiv-
alent to latter" indicates that the Syntax Rules and General Rules
are to be interpreted as if all instances of former in the element
had been instances of latter.
Case:
3.3.5 Descriptors
Some SQL objects cannot exist except in the context of other SQL
objects. For example, columns cannot exist except in tables. Those
objects are independently described by descriptors, and the de-
scriptors of enabling objects (e.g., tables) are said to include
the descriptors of enabled objects (e.g., columns or table con-
straints). Conversely, the descriptor of an enabled object is said
to be included in the descriptor of an enabling object.
In other cases, certain SQL objects cannot exist unless some other
SQL object exists, even though there is not an inclusion relation-
ship. For example, SQL does not permit an assertion to exist if the
tables referenced by the assertion do not exist. Therefore, an as-
sertion descriptor is dependent on or depends on zero or more table
descriptors (equivalently, an assertion is dependent on or depends
on zero or more tables). In general, a descriptor D1 can be said to
depend on, or be dependent on, some descriptor D2.
Function
Format
Syntax Rules
Case:
b) Otherwise:
4 Concepts
SQL defines distinct data types named by the following <key word>s:
CHARACTER, CHARACTER VARYING, BIT, BIT VARYING, NUMERIC, DECIMAL,
INTEGER, SMALLINT, FLOAT, REAL, DOUBLE PRECISION, DATE, TIME,
TIMESTAMP, and INTERVAL.
Concepts 19
X3H2-92-154/DBL CBR-002
4.1 Data types
Each host language has its own data types, which are separate and
distinct from SQL data types, even though similar names may be
used to describe the data types. Mappings of SQL data types to data
types in host languages are described in Subclause 12.3, "<pro-
cedure>", and Subclause 19.1, "<embedded SQL host program>". Not
every SQL data type has a corresponding data type in every host
language.
- the catalog name, schema name, and character set name of the
character set of the character string data type; and
- the catalog name, schema name, and collation name of the colla-
tion of the character string data type.
Concepts 21
X3H2-92-154/DBL CBR-002
4.2 Character strings
For any pair of character sets, there are zero or more translations
that may be invoked by a <character translation>. A translation
is described by a translation descriptor. A translation descriptor
includes:
<like predicate> uses the triadic operator LIKE (or the inverse,
NOT LIKE), operating on three character strings and returning
a Boolean. LIKE determines whether or not a character string
"matches" a given "pattern" (also a character string). The char-
acters '%' (percent) and '_' (underscore) have special meaning when
they occur in the pattern. The optional third argument is a charac-
ter string containing exactly one character, known as the "escape
character", for use when a percent or underscore is required in the
pattern without its special meaning.
Concepts 23
X3H2-92-154/DBL CBR-002
4.2 Character strings
The tables below define how the collating sequence and the co-
ercibility attribute is determined for the result of any monadic
or dyadic operation. Table 1, "Collating coercibility rules for
monadic operators", shows the collating sequence and coercibility
rules for monadic operators, and Table 2, "Collating coercibil-
ity rules for dyadic operators", shows the collating sequence and
coercibility rules for dyadic operators. Table 3, "Collating se-
quence usage for comparisons", shows how the collating sequence is
determined for a particular comparison.
_____Table_1-Collating_coercibility_rules_for_monadic_operators____
| Collating | Collating |
|_Coercibility______Sequence______|_Coercibility______Sequence_____|
| | |
| Coercible | default | Coercible | default |
| | | | |
| Implicit | X | Implicit | X |
| | | | |
| Explicit | X | Explicit | X |
| | | | |
|_______No_collati|g_sequence_____|______No_collatin|_sequence_____|
| | | | |
_____Table_2-Collating_coercibility_rules_for_dyadic_operators_____
Result
Coercibility
Operand 1 Coercibility Operand 2 Coercibility and Collating
_and_Collating_Sequence _and_Collating_Sequence ___Sequence___
_Table_2-Collating_coercibility_rules_for_dyadic_operators_(Cont.)_
Result
Coercibility
Operand 1 Coercibility Operand 2 Coercibility and Collating
_and_Collating_Sequence _and_Collating_Sequence ___Sequence___
|__________Ta|le_3-Collat|ng_sequence_|sage_for_co|parisons________|
Comparand 1 Comparand 2
Coercibility and Coercibility and
_Collating_Sequence _Collating_Sequence
| | | Collating Sequence |
| Collatin| Collatin| Used For The |
|_CoercibilitSequence|_CoercibilitSequence|__Comparison____________|
| | | |
| Coercible| default | Coercible| default | default |
| | | | | |
| Coercible| default | Implicit | Y | Y |
| | | | | |
| Coercible| default | No co|lating | Not permitted: invalid|
sequence syntax
______Table_3-Collating_sequence_usage_for_comparisons_(Cont.)_____
Comparand 1 Comparand 2
Coercibility and Coercibility and
_Collating_Sequence _Collating_Sequence
| | | Collating Sequence |
| Collatin| Collatin| Used For The |
|_CoercibilitSequence|_CoercibilitSequence|__Comparison____________|
| | | |
| Implicit | X | Coercible| default | X |
| | | | | |
| Implicit | X | Implicit | X | X |
| | | | | |
| Implicit | X | Implicit | Y /= X | Not permitted: invalid|
syntax
| No collating | Explicit | X | X |
| sequence | | | |
| | | | |
| Explicit X | Coercible| default | X |
| | | | |
| Explicit | X | Implicit | Y | X |
| | | | | |
| Explicit | X | No co|lating | X |
sequence
| Explicit | X | Explicit X | X |
| | | | |
| Explicit | X | Explicit | Y /= X | Not permitted: invalid|
____________________________________________syntax_________________
A bit string data type is described by a bit string data type de-
scriptor. A bit string data type descriptor contains:
- the name of the specific bit string data type (BIT or BIT
VARYING); and
4.4 Numbers
Concepts 27
X3H2-92-154/DBL CBR-002
4.4 Numbers
All numerical values between the smallest and the largest value,
inclusive, representable in a given exact numeric type have an
approximation obtained by rounding or truncation for that type; it
is implementation-defined which other numerical values have such
approximations.
Concepts 29
X3H2-92-154/DBL CBR-002
4.5 Datetimes and intervals
4.5.1 Datetimes
__________________Table_4-Fields_in_datetime_items_________________
_Keyword____________Meaning________________________________________
|__________________|___Primary_datetime_fields_____________________|
| | |
| YEAR Year |
| |
| MONTH | Month within year |
| | |
| DAY | Day within month |
| | |
| HOUR | Hour within day |
| | |
| MINUTE | Minute within hour |
| | |
| SECOND | Second and possibly fraction of a second |
____________________within_minute__________________________________
|__________________|___Timezone_datetime_fields____________________|
| | |
| TIMEZONE_HOUR | Hour value of time zone displacement |
| |
|_TIMEZONE_MINUTE__|_Minute_value_of_time_zone_displacement________|
| | |
30 Database Language SQL
X3H2-92-154/DBL CBR-002
4.5 Datetimes and intervals
There are three classes of datetime data types defined within this
International Standard:
Therefore, datetime data types that contain time fields (TIME and
TIMESTAMP) are maintained in Universal Coordinated Time (UTC), with
an explicit or implied time zone part.
Concepts 31
X3H2-92-154/DBL CBR-002
4.5 Datetimes and intervals
4.5.2 Intervals
____________Table_5-Fields_in_year-month_INTERVAL_items____________
_Keyword______Meaning______________________________________________
| YEAR | Years |
| | |
|_MONTH______|_Months______________________________________________|
| | |
Table 6, "Fields in day-time INTERVAL items", specifies the fields
that make up a day-time interval. A day-time interval is made up of
a contiguous subset of those fields.
_____________Table_6-Fields_in_day-time_INTERVAL_items_____________
_Keyword______Meaning______________________________________________
| DAY | Days |
| | |
| HOUR | Hours |
| | |
| MINUTE | Minutes |
| | |
|_SECOND_____|_Seconds_and_possibly_fractions_of_a_second__________|
| | |
The actual subset of fields that comprise an item of either type of
interval is defined by an <interval qualifier> and this subset is
known as the precision of the item.
_________Table_7-Valid_values_for_fields_in_INTERVAL_items_________
_Keyword______Valid_values_of_INTERVAL_fields______________________
Concepts 33
X3H2-92-154/DBL CBR-002
4.5 Datetimes and intervals
_____Table_8-Valid_operators_involving_datetimes_and_intervals_____
Operand Operand
_1__________Operator_2_________Result_Type_________________________
Values corresponding to the data types BIT and BIT VARYING are al-
ways mutually comparable and are mutually assignable. If a store
assignment would result in the loss of bits due to truncation, then
an exception condition is raised. When values of unequal length are
to be compared, if the shorter is a prefix of the longer, then the
shorter is less than the longer; otherwise, the longer is effec-
tively truncated to the length of the shorter for the purposes of
comparison. When values of equal length are to be compared, then a
bit-by-bit comparison is made. A 0-bit less than a 1-bit.
4.7 Domains
Concepts 35
X3H2-92-154/DBL CBR-002
4.7 Domains
4.8 Columns
A column is a multiset of values that may vary over time. All val-
ues of the same column are of the same data type or domain and are
values in the same table. A value of a column is the smallest unit
of data that can be selected from a table and the smallest unit of
data that can be updated.
- the ordinal position of the column within the table that con-
tains the column.
4.9 Tables
Concepts 37
X3H2-92-154/DBL CBR-002
4.9 Tables
All base tables are updatable. Derived tables are either updatable
or read-only. The operations of insert, update, and delete are
permitted for updatable tables, subject to constraining Access
Rules. The operations of insert, update, and delete are not allowed
for read-only tables.
the name and the scope of the name of a global temporary table or
a created local temporary table are indistinguishable from those
of a persistent base table. However, because global temporary ta-
ble contents are distinct within SQL-sessions, and created local
temporary tables are distinct within <module>s within SQL-sessions,
the effective <schema name> of the schema in which the global tem-
porary table or the created local temporary table is instantiated
is an implementation-dependent <schema name> that may be thought
of as having been effectively derived from the <schema name> of
the schema in which the global temporary table or created local
temporary table is defined and the implementation-dependent SQL-
session identifier associated with the SQL-session. In addition,
the effective <schema name> of the schema in which the created
local temporary table is instantiated may be thought of as being
further qualified by a unique implementation-dependent name associ-
ated with the <module> in which the created local temporary table
is referenced.
Concepts 39
X3H2-92-154/DBL CBR-002
4.9 Tables
Concepts 41
X3H2-92-154/DBL CBR-002
4.10 Integrity constraints
- If MATCH FULL was specified then, for each row R1 of the refer-
encing table, either the value of every referencing column in R1
shall be a null value, or the value of every referencing column
in R1 shall not be null and there shall be some row R2 of the
referenced table such that the value of each referencing col-
umn in R1 is equal to the value of the corresponding referenced
column in R2.
The referencing table may be the same table as the referenced ta-
ble.
4.10.4 Assertions
4.11 SQL-schemas
- The <character set name> of the default character set for the
SQL-schema; and
4.12 Catalogs
4.14 SQL-data
4.15 SQL-environment
4.16 Modules
4.17 Procedures
4.18 Parameters
Concepts 47
X3H2-92-154/DBL CBR-002
4.18 Parameters
An SQL-agent may choose the size of the diagnostics area with the
<set transaction statement>; if an SQL-agent does not specify the
size of the diagnostics area, then the size of the diagnostics
area is implementation-dependent, but shall always be able to hold
information about at least one condition. An implementation may
place information into this area about fewer conditions than are
specified. The ordering of the information about conditions placed
4.21 Cursors
Concepts 49
X3H2-92-154/DBL CBR-002
4.21 Cursors
A cursor is in either the open state or the closed state. The ini-
tial state of a cursor is the closed state. A cursor is placed in
the open state by an <open statement> or <dynamic open statement>
and returned to the closed state by a <close statement> or <dynamic
close statement>, a <commit statement>, or a <rollback statement>.
4.22 SQL-statements
Concepts 51
X3H2-92-154/DBL CBR-002
4.22 SQL-statements
- SQL-connection statements
- SQL-session statements
- SQL-dynamic statements
- SQL-diagnostics statements
- <schema definition>
- <domain definition>
- <table definition>
- <view definition>
- <assertion definition>
- <grant statement>
- <revoke statement>
- <collation definition>
- <translation definition>
- <declare cursor>
- <open statement>
- <close statement>
- <fetch statement>
- <insert statement>
Concepts 53
X3H2-92-154/DBL CBR-002
4.22 SQL-statements
- <commit statement>
- <rollback statement>
- <connect statement>
- <disconnect statement>
- <prepare statement>
- <execute statement>
o <open statement>
o <close statement>
o <fetch statement>
o <insert statement>
Concepts 55
X3H2-92-154/DBL CBR-002
4.22 SQL-statements
- <declare cursor>
o <insert statement>
o <update statement: searched>
o <open statement>
o <close statement>
o <fetch statement>
o <declare cursor>
Concepts 57
X3H2-92-154/DBL CBR-002
4.22 SQL-statements
o <insert statement>
o <declare cursor>
o <open statement>
o <close statement>
o <open statement>
o <close statement>
o <fetch statement>
o <insert statement>
Concepts 59
X3H2-92-154/DBL CBR-002
4.22 SQL-statements
o <prepare statement>
Concepts 61
X3H2-92-154/DBL CBR-002
4.24 SQL dynamic statements
it as though it had been coded when the program was written. For a
<dynamic select statement>, the prepared <cursor specification> is
associated with a cursor via a <dynamic declare cursor> or <allo-
cate cursor statement>. The cursor can be opened and parameters can
be associated with the cursor with a <dynamic open statement>. A
<dynamic fetch statement> positions an open cursor on a specified
row and retrieves the values of the columns of that row. A <dynamic
close statement> closes a cursor that was opened with a <dynamic
open statement>. A <dynamic delete statement: positioned> is used
to delete rows through a dynamic cursor. A <dynamic update state-
ment: positioned> is used to update rows through a dynamic cursor.
A <preparable dynamic delete statement: positioned> is used to
delete rows through a dynamic cursor when the precise format of the
statement isn't known until runtime. A <preparable dynamic update
statement: positioned> is used to update rows through a dynamic
cursor when the precise format of the statement isn't known until
runtime.
Concepts 63
X3H2-92-154/DBL CBR-002
4.24 SQL dynamic statements
4.26 Privileges
- INSERT
- DELETE
- SELECT
- REFERENCES
- USAGE
Concepts 65
X3H2-92-154/DBL CBR-002
4.26 Privileges
4.27 SQL-agents
4.28 SQL-transactions
Concepts 67
X3H2-92-154/DBL CBR-002
4.28 SQL-transactions
The isolation level specifies the kind of phenomena that can occur
during the execution of concurrent SQL-transactions. The following
phenomena are possible:
__Table_9-SQL-transaction_isolation_levels_and_the_three_phenomena_
_Level__________________P1______P2_______P3________________________
Concepts 69
X3H2-92-154/DBL CBR-002
4.28 SQL-transactions
4.29 SQL-connections
Concepts 71
X3H2-92-154/DBL CBR-002
4.29 SQL-connections
4.30 SQL-sessions
Concepts 73
X3H2-92-154/DBL CBR-002
4.30 SQL-sessions
4.33 Leveling
Entry SQL includes the statements for defining schemas, data ma-
nipulation language, referential integrity, check constraints, and
default clause from ISO/IEC 9075:1989, and options for module lan-
guage and embedded SQL interfaces to seven different programming
languages, as well as direct execution of the data manipulation
statements. It also includes features related to deprecated fea-
tures from ISO/IEC 9075:1989 (commas and parentheses in parameter
lists, the SQLSTATE parameter, and renaming columns in the <se-
lect list>), features related to incompatibilities with ISO/IEC
9075:1989 (colons preceding <parameter name>s, WITH CHECK OPTION
constraint clarifications), and aids for transitioning from ISO/IEC
9075:1989 to this International Standard (<delimited identifier>s).
Concepts 75
X3H2-92-154/DBL CBR-002
4.33 Leveling
- Syntax Only
- Catalog Lookup
Under the Syntax Only option, the SQL Flagger analyzes only the SQL
language that is presented; it checks for violations of any Syntax
Rules that can be determined without access to the Information
Schema.
Under the Catalog Lookup option, the SQL Flagger assumes the avail-
ability of Definition Schema information and checks for violations
of all Syntax Rules and Access Rules, except Access Rules that deal
with privileges. For example, some Syntax Rules place restrictions
on data types; this flagger option would identify extensions that
relax such restrictions. In order to avoid security breaches, this
option may view the Definition Schema only through the eyes of a
specific Information Schema.
Concepts 77
X3H2-92-154/DBL CBR-002
78 Database Language SQL
X3H2-92-154/DBL CBR-002
5 Lexical elements
Function
Define the terminal symbols of the SQL language and the elements of
strings.
Format
<digit> ::=
0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9
Lexical elements 79
X3H2-92-154/DBL CBR-002
5.1 <SQL terminal character>
| <plus sign>
| <comma>
| <minus sign>
| <period>
| <solidus>
| <colon>
| <semicolon>
| <less than operator>
| <equals operator>
| <greater than operator>
| <question mark>
| <underscore>
| <vertical bar>
<percent> ::= %
<asterisk> ::= *
<comma> ::= ,
<period> ::= .
<solidus> ::= /
<colon> ::= :
<semicolon> ::= ;
<underscore> ::= _
Syntax Rules
None.
Access Rules
None.
General Rules
Leveling Rules
None.
None.
Lexical elements 81
X3H2-92-154/DBL CBR-002
5.2 <token> and <separator>
Function
Format
<token> ::=
<nondelimiter token>
| <delimiter token>
<comment> ::=
<comment introducer> [ <comment character>... ] <newline>
Lexical elements 83
X3H2-92-154/DBL CBR-002
5.2 <token> and <separator>
| ISOLATION
| JOIN
| KEY
| LANGUAGE | LAST | LEADING | LEFT | LEVEL | LIKE | LOCAL | LOWER
| MATCH | MAX | MIN | MINUTE | MODULE | MONTH
| NAMES | NATIONAL | NATURAL | NCHAR | NEXT | NO | NOT | NULL
| NULLIF | NUMERIC
| OCTET_LENGTH | OF | ON | ONLY | OPEN | OPTION | OR
| ORDER | OUTER
| OUTPUT | OVERLAPS
| ROLLBACK | ROWS
| SCHEMA | SCROLL | SECOND | SECTION | SELECT | SESSION | SESSION_
USER | SET
| SIZE | SMALLINT | SOME | SPACE | SQL | SQLCODE | SQLERROR |
SQLSTATE
Syntax Rules
Lexical elements 85
X3H2-92-154/DBL CBR-002
5.2 <token> and <separator>
None.
Lexical elements 87
X3H2-92-154/DBL CBR-002
5.2 <token> and <separator>
General Rules
None.
Leveling Rules
5.3 <literal>
Function
Format
<literal> ::=
<signed numeric literal>
| <general literal>
Lexical elements 89
X3H2-92-154/DBL CBR-002
5.3 <literal>
<bit> ::= 0 | 1
Lexical elements 91
X3H2-92-154/DBL CBR-002
5.3 <literal>
Syntax Rules
Case:
Lexical elements 93
X3H2-92-154/DBL CBR-002
5.3 <literal>
16)The data type of a <time literal> that does not specify <time
zone interval> is TIME(P), where P is the number of digits in
<seconds fraction>, if specified, and 0 otherwise. The data
type of a <time literal> that specifies <time zone interval>
is TIME(P) WITH TIME ZONE, where P is the number of digits in
<seconds fraction>, if specified, and 0 otherwise.
Access Rules
None.
General Rules
Lexical elements 95
X3H2-92-154/DBL CBR-002
5.3 <literal>
Case:
Case:
is V2*10 -M seconds.
Leveling Rules
Function
Specify names.
Format
<identifier> ::=
[ <introducer><character set specification> ] <actual identifier>
Lexical elements 99
X3H2-92-154/DBL CBR-002
5.4 Names and identifiers
Syntax Rules
Case:
Case:
Case:
Case:
10)Two <qualified name>s are equal if and only if they have the
same <qualified identifier> and the same <schema name>, regard-
less of whether the <schema name>s are implicit or explicit.
11)Two <schema name>s are equal if and only if they have the same
<unqualified schema name> and the same <catalog name>, regard-
less of whether the <catalog name>s are implicit or explicit.
21)If a <character set name> does not specify a <schema name>, then
INFORMATION_SCHEMA is implicit.
Access Rules
None.
General Rules
Leveling Rules
6 Scalar expressions
Function
Format
| INTEGER
| INT
| SMALLINT
Syntax Rules
9) Case:
14)Case:
17)NUMERIC specifies the data type exact numeric, with the decimal
precision and scale specified by the <precision> and <scale>.
18)DECIMAL specifies the data type exact numeric, with the decimal
scale specified by the <scale> and the implementation-defined
decimal precision equal to or greater than the value of the
specified <precision>.
Note: The range for time zone intervals is larger than many
readers might expect because it is governed by political deci-
sions in governmental bodies rather than by any natural law.
Access Rules
None.
General Rules
Case:
_________Table_10-Valid_values_for_fields_in_datetime_items________
_Keyword____________Valid_values_of_datetime_fields________________
| HOUR | 00 to 23 |
| | |
| MINUTE | 00 to 59 |
| | |
| SECOND | 00 to 61.9(N) where "9(N)" indicates the num- |
ber of digits specified by <time fractional
seconds precision>.
| TIMEZONE_HOUR | 00 to 13 |
| | |
|_TIMEZONE_MINUTE__|_00_to_59______________________________________|
| | |
Note: Datetime data types will allow dates in the Gregorian
format to be stored in the date range 0001-01-01 CE through
9999-12-31 CE. The range for SECOND allows for as many as two
"leap seconds". Interval arithmetic that involves leap seconds
or discontinuities in calendars will produce implementation-
defined results.
5) If WITH TIME ZONE is not specified, then the time zone dis-
placement of the datetime data type is effectively the current
default time zone displacement of the SQL-session.
_________Table_11-Valid_values_for_fields_in_INTERVAL_items________
_Keyword______Valid_values_of_INTERVAL_fields______________________
| MONTH | 0 to 11 |
| | |
| HOUR | 0 to 23 |
| | |
| MINUTE | 0 to 59 |
| | |
| SECOND |
0 to 59.9(N) where "9(N)" indicates the number of |
digits specified by <interval fractional seconds
______________precision>_in_the_<interval_qualifier>.______________
Function
Format
Syntax Rules
Access Rules
None.
General Rules
Leveling Rules
Function
Reference a table.
Format
Syntax Rules
2) Case:
6) The same <column name> shall not be specified more than once in
a <derived column list>.
Access Rules
General Rules
1) The <correlation name> or exposed <table name> contained in a
<table reference> defines that <correlation name> or <table
name> to be an identifier of the table identified by the <table
name> or <derived table> of that <table reference>.
Leveling Rules
Function
Reference a column.
Format
<qualifier> ::=
<table name>
| <correlation name>
Syntax Rules
a) Case:
( J ) AS Q
Access Rules
General Rules
CR + TZ.
Leveling Rules
None.
None.
Scalar expressions 123
X3H2-92-154/DBL CBR-002
6.5 <set function specification>
Function
Format
Syntax Rules
a) a <select list>, or
10)If the data type of the result is character string, then the
collating sequence and the coercibility attribute are determined
as in Subclause 4.2.3, "Rules determining collating sequence
usage".
Access Rules
None.
General Rules
1) Case:
Case:
Case:
Leveling Rules
Function
Format
Syntax Rules
Case:
Case:
Access Rules
None.
General Rules
1) If <position expression> is specified and neither <character
value expression> is the null value, then
Case:
Case:
Case:
Case:
a) Let S be the <string value expression>. If the value of S is
not the null value, then
Case:
Case:
Case:
Leveling Rules
Function
Format
Syntax Rules
a) The data type of the result of <fold> is the data type of the
<character value expression>.
d) If
TRIM ( SRC )
is specified, then
is implicit.
Access Rules
General Rules
e) Case:
ii) Otherwise,
c) Case:
i) If UPPER is specified, then the result of the <fold> is a
copy of S in which every <simple Latin lower case letter>
that has a corresponding <simple Latin upper case let-
ter> in the character repertoire of S is replaced by that
<simple Latin upper case letter>.
Case:
Case:
e) Case:
e) Case:
ii) Otherwise,
Leveling Rules
Function
Format
Syntax Rules
Note: See the Syntax Rules of Subclause 6.1, "<data type>", for
rules governing <time precision> and <timestamp precision>.
Access Rules
None.
General Rules
Leveling Rules
Function
Format
Syntax Rules
Access Rules
None.
General Rules
1) Case:
2) Case:
Leveling Rules
None.
Function
Format
Syntax Rules
1) Case:
<data type>
SD of <data type> of TD
<value
expression> EN AN VC FC VB FB D T TS YM DT
EN Y Y Y Y N N N N N M M
AN Y Y Y Y N N N N N N N
C Y Y M M Y Y Y Y Y Y Y
B N N Y Y Y Y N N N N N
D N N Y Y N N Y N Y N N
T N N Y Y N N N Y Y N N
TS N N Y Y N N Y Y Y N N
YM M N Y Y N N N N N Y N
DT M N Y Y N N N N N N Y
Where:
EN = Exact Numeric
AN = Approximate Numeric
C = Character (Fixed- or Variable-length)
FC = Fixed-length Character
VC = Variable-length Character
B = Bit String (Fixed- or Variable-length)
FB = Fixed-length Bit String
VB = Variable-length Bit String
D = Date
T = Time
TS = Timestamp
YM = Year-Month Interval
DT = Day-Time Interval
Access Rules
General Rules
2) Case:
a) If the <cast operand> specifies NULL or if SV is the null
value, then the result of the <cast specification> is the
null value.
Case:
Case:
Case:
CAST ( LT AS TD )
Case:
Case:
Case:
CAST ( LT AS TD )
Case:
'-' | YP
Case:
Case:
'-' | YP
iii) Case:
Case:
TV is the result of
Case:
Case:
Case:
a) If SD is exact numeric, then let YP be the shortest character
string that conforms to the definition of <exact numeric
literal> in Subclause 5.3, "<literal>", whose scale is the
same as the scale of SD and whose interpreted value is the
absolute value of SV.
'-' | YP
Case:
Case:
'-' | YP
iii) Case:
Case:
Case:
Case:
Case:
Case:
Case:
Case:
Case:
Case:
Case:
Case:
Case:
Case:
Leveling Rules
1) The following restrictions apply for Intermediate SQL:
None.
Function
Specify a value.
Format
Syntax Rules
Access Rules
None.
Scalar expressions 155
X3H2-92-154/DBL CBR-002
6.11 <value expression>
General Rules
Leveling Rules
None.
Function
Format
<term> ::=
<factor>
| <term> <asterisk> <factor>
| <term> <solidus> <factor>
<factor> ::=
[ <sign> ] <numeric primary>
Syntax Rules
Access Rules
None.
General Rules
Case:
Leveling Rules
None.
None.
Scalar expressions 159
X3H2-92-154/DBL CBR-002
6.13 <string value expression>
Function
Format
<concatenation> ::=
<character value expression> <concatenation operator>
<character factor>
Syntax Rules
3) Case:
Case:
4) Case:
Case:
6) Case:
Case:
ii) If the data type of the <bit value expression> and <bit
factor> is fixed-length bit string, then M shall not be
greater than FL and the data type of the <bit concatena-
tion> is fixed-length bit string with length M.
Access Rules
None.
General Rules
Case:
Case:
i) If the data type of either S1 or S2 is variable-length
character string, then
Case:
Case:
Case:
Case:
Function
Format
Syntax Rules
2) Case:
5) Case:
Access Rules
None.
General Rules
a) Case:
DV - TZ
Leveling Rules
None.
Function
Format
Syntax Rules
3) Case:
4) Case:
Access Rules
None.
General Rules
CAST (I AS INTERVAL W)
CAST (I AS INTERVAL W)
Leveling Rules
None.
7 Query expressions
Function
Format
Syntax Rules
( X )
Access Rules
None.
General Rules
3) Case:
Leveling Rules
Function
Format
Syntax Rules
Access Rules
None.
General Rules
1) Let Ti be a table whose j-th column has the same data type as
the j-th <value expression> in the i-th <row value construc-
tor> and let Ti contain one row whose j-th column has the same
value as the j-th <value expression> in the i-th <row value
constructor>.
Leveling Rules
None.
Function
Format
Syntax Rules
Access Rules
None.
General Rules
1) If all optional clauses are omitted, then the result of the <ta-
ble expression> is the same as the result of the <from clause>.
Otherwise, each specified clause is applied to the result of
the previously specified clause and the result of the <table ex-
pression> is the result of the application of the last specified
clause.
Leveling Rules
None.
Function
Format
Syntax Rules
1) Case:
Access Rules
None.
General Rules
1) Case:
Leveling Rules
None.
Function
Format
Syntax Rules
1) Let TR1 and TR2 be the first and second <table reference>s of
the <joined table>, respectively. Let T1 and T2 be the tables
identified by TR1 and TR2, respectively. Let TA and TB be the
correlation names of TR1 and TR2, respectively. Let CP be:
Case:
Access Rules
None.
General Rules
1) Case:
Case:
5) Let XN1 and XN2 be effective distinct names for X1 and X2, re-
spectively. Let TN be an effective name for T.
Case:
SELECT * FROM TN
UNION ALL
SELECT * FROM XN1
SELECT * FROM TN
UNION ALL
SELECT * FROM XN2
SELECT * FROM TN
UNION ALL
SELECT * FROM XN1
UNION ALL
SELECT * FROM XN2
Case:
Leveling Rules
Function
Format
Syntax Rules
Access Rules
None.
General Rules
Leveling Rules
None.
Function
Format
Syntax Rules
Access Rules
None.
General Rules
Leveling Rules
None.
188 Database Language SQL
X3H2-92-154/DBL CBR-002
7.8 <having clause>
Function
Format
Syntax Rules
b) C is a grouping column of T.
Access Rules
None.
General Rules
Leveling Rules
None.
None.
190 Database Language SQL
X3H2-92-154/DBL CBR-002
7.9 <query specification>
Function
Format
Syntax Rules
3) Case:
9) Case:
None.
General Rules
1) Case:
Case:
ii) If the <select list> does not include a <set function spec-
ification> that contains a reference to T, then each <value
expression> is applied to each row of T yielding a table of
M rows, where M is the cardinality of T. The i-th column of
the table contains the values derived by the evaluation of
the i-th <value expression>.
Case:
Case:
Case:
Leveling Rules
Function
Specify a table.
Format
Syntax Rules
c) QE or QS is updatable.
5) Case:
7) Case:
Case:
i) Within the columns of T1, the same <column name> shall not
be specified more than once and within the columns of T2,
the same <column name> shall not be specified more than
once.
iii) Case:
10)Case:
b) Otherwise,
i) Case:
11)Case:
12)Case:
b) Otherwise,
i) Case:
13)Case:
Access Rules
None.
General Rules
1) Case:
Case:
Case:
Case:
Case:
Case:
Leveling Rules
Function
Format
Syntax Rules
Access Rules
None.
General Rules
Leveling Rules
8 Predicates
8.1 <predicate>
Function
Format
<predicate> ::=
<comparison predicate>
| <between predicate>
| <in predicate>
| <like predicate>
| <null predicate>
| <quantified comparison predicate>
| <exists predicate>
| <unique predicate>
| <match predicate>
| <overlaps predicate>
Syntax Rules
None.
Access Rules
None.
General Rules
Leveling Rules
Function
Format
Syntax Rules
3) The data types of the corresponding values of the two <row value
constructor>s shall be comparable.
Access Rules
None.
General Rules
Predicates 207
X3H2-92-154/DBL CBR-002
8.2 <comparison predicate>
ii) "X <> Y" is true if and only if XV and YV are not equal.
iii) "X < Y" is true if and only if XV is less than YV.
iv) "X > Y" is true if and only if XV is greater than YV.
v) "X <= Y" is true if and only if XV is not greater than YV.
vi) "X >= Y" is true if and only if XV is not less than YV.
vii) "X <comp op> Y" is false if and only if "X <comp op> Y" is
not true.
Note: Two datetimes are comparable only if they have the same
<datetime field>s; see Subclause 4.5.1, "Datetimes".
b) "x <> Ry" is true if and only if RXi <> RYi for some i.
c) "x < Ry" is true if and only if RXi = RYi for all i < n and
RXn < RYn for some n.
d) "x > Ry" is true if and only if RXi = RYi for all i < n and
RXn > RYn for some n.
Predicates 209
X3H2-92-154/DBL CBR-002
8.2 <comparison predicate>
i) "x < Ry" is false if and only if "Rx >= Ry" is true.
j) "x > Ry" is false if and only if "Rx <= Ry" is true.
k) "x <= Ry" is false if and only if "Rx > Ry" is true.
l) "x >= Ry" is false if and only if "Rx < Ry" is true.
m) "x <comp op> Ry" is unknown if and only if "Rx <comp op> Ry"
is neither true nor false.
Leveling Rules
None.
None.
210 Database Language SQL
X3H2-92-154/DBL CBR-002
8.3 <between predicate>
Function
Format
Syntax Rules
3) The data types of the respective values of the three <row value
constructor>s shall be comparable.
4) Let X, Y, and Z be the first, second, and third <row value con-
structor>s, respectively.
Access Rules
None.
General Rules
None.
Leveling Rules
None.
Predicates 211
X3H2-92-154/DBL CBR-002
8.4 <in predicate>
Function
Format
Syntax Rules
( IVL )
( VALUES IVL )
2) Let RVC be the <row value constructor> and let IPV be the <in
predicate value>.
3) The expression
is equivalent to
4) The expression
RVC IN IPV
is equivalent to
None.
General Rules
None.
Leveling Rules
None.
Predicates 213
X3H2-92-154/DBL CBR-002
8.5 <like predicate>
Function
Format
Syntax Rules
4) Case:
Access Rules
None.
General Rules
M LIKE P ESCAPE E
is unknown.
M LIKE P
is unknown.
3) Case:
Predicates 215
X3H2-92-154/DBL CBR-002
8.5 <like predicate>
5) Case:
M LIKE P
is true.
b) The <predicate>
M LIKE P
c) Otherwise,
M LIKE P
is false.
Leveling Rules
None.
Function
Format
Syntax Rules
None.
Access Rules
None.
General Rules
2) If all the values in R are the null value, then "R IS NULL" is
true; otherwise, it is false.
3) If none of the values in R are the null value, then "R IS NOT
NULL" is true; otherwise, it is false.
Note: For all R, "R IS NOT NULL" has the same result as "NOT
R IS NULL" if and only if R is of degree 1. Table 12, "<null
predicate> semantics", specifies this behavior.
________________Table_12-<null_predicate>_semantics________________
None.
Function
Format
Syntax Rules
Access Rules
None.
General Rules
Case:
Leveling Rules
None.
None.
Predicates 221
X3H2-92-154/DBL CBR-002
8.8 <exists predicate>
Function
Format
Syntax Rules
None.
Access Rules
None.
General Rules
Leveling Rules
None.
None.
222 Database Language SQL
X3H2-92-154/DBL CBR-002
8.9 <unique predicate>
Function
Format
Syntax Rules
None.
Access Rules
None.
General Rules
2) If there are no two rows in T such that the value of each column
in one row is non-null and is equal to the value of the cor-
responding column in the other row according to Subclause 8.2,
"<comparison predicate>", then the result of the <unique predi-
cate> is true; otherwise, the result of the <unique predicate>
is false.
Leveling Rules
None.
Function
Format
Syntax Rules
Access Rules
None.
General Rules
Case:
Case:
R = RTi
Case:
a) If all values in R are the null value, then the <match predi-
cate> is true.
b) Otherwise,
Case:
Case:
a) If all values in R are the null value, then the <match predi-
cate> is true.
Case:
R = RTi
Predicates 225
X3H2-92-154/DBL CBR-002
8.10 <match predicate>
Leveling Rules
None.
226 Database Language SQL
X3H2-92-154/DBL CBR-002
8.11 <overlaps predicate>
Function
Format
Syntax Rules
1) The degree of <row value constructor 1> and <row value construc-
tor 2> shall both be 2.
2) The data type of the first column of each <row value construc-
tor> shall be a datetime data type and the first column of each
<row value constructor> shall be comparable.
Note: Two datetimes are comparable only if they have the same
<datetime field>s; see Subclause 4.5.1, "Datetimes".
3) The data type of the second column of each <row value construc-
tor> shall be a datetime data type or INTERVAL.
Case:
Access Rules
None.
General Rules
1) Let D1 be the value of the first column of <row value construc-
tor 1> and D2 be the value of the first column of <row value
constructor 2>.
Predicates 227
X3H2-92-154/DBL CBR-002
8.11 <overlaps predicate>
2) Case:
4) Case:
Leveling Rules
None.
Function
Format
Syntax Rules
( NOT ( BP IS TV ) )
Access Rules
None.
General Rules
1) The result is derived by the application of the specified
boolean operators ("AND", "OR", "IS", and "NOT") to the results
derived from each <predicate> evaluation. If boolean operators
are not specified, then the result of the <search condition> is
the result of the specified <predicate>.
Predicates 229
X3H2-92-154/DBL CBR-002
8.12 <search condition>
______________Table_13-Truth_table_for_the_AND_boolean_____________
___________________________________________________________________
___________________________________________________________________
_IS_________TRUE______FALSE______UNKNOWN___________________________
Leveling Rules
None.
Function
Syntax Rules
General Rules
Case:
Case:
Case:
Function
Syntax Rules
General Rules
Case:
Case:
Case:
Function
Specify the Syntax Rules and result data types for <case expres-
sion>s and <query expression>s having set operators.
Syntax Rules
3) Case:
Case:
b) If any of the data types in DTS is bit string, then all data
types in DTS shall be bit string.
Case:
c) If all of the data types in DTS are exact numeric, then the
result data type is exact numeric with implementation-defined
precision and with scale equal to the maximum of the scales
of the data types in DTS.
General Rules
None.
238 Database Language SQL
X3H2-92-154/DBL CBR-002
Function
Format
Syntax rules
2) If TO is specified, then:
Access Rules
None.
General Rules
Case:
Case:
Case:
b) Otherwise,
Case:
Case:
Leveling Rules
None.
Function
Format
Syntax Rules
None.
Access Rules
None.
General Rules
______________Table_16-Standard_programming_languages______________
Language
_keyword______Relevant_standard____________________________________
None.
10.3 <privileges>
Function
Specify privileges.
Format
<privileges> ::=
ALL PRIVILEGES
| <action list>
<action> ::=
SELECT
| DELETE
| INSERT [ <left paren> <privilege column list> <right paren> ]
| USAGE
<grantee> ::=
PUBLIC
| <authorization identifier>
Syntax Rules
Access Rules
None.
General Rules
Leveling Rules
None.
Additional common elements 247
X3H2-92-154/DBL CBR-002
10.4 <character set specification>
Function
Format
Syntax Rules
Access Rules
General Rules
Leveling Rules
None.
Function
Format
Syntax Rules
None.
Access Rules
General Rules
None.
Leveling Rules
None.
Additional common elements 251
X3H2-92-154/DBL CBR-002
10.6 <constraint name definition> and <constraint attributes>
Function
Format
Syntax Rules
4) Case:
Access Rules
None.
252 Database Language SQL
X3H2-92-154/DBL CBR-002
10.6 <constraint name definition> and <constraint attributes>
General Rules
Leveling Rules
Function
Define a schema.
Format
Syntax Rules
Case:
Access Rules
General Rules
Leveling Rules
Function
Destroy a schema.
Format
Syntax Rules
Access Rules
General Rules
DROP ASSERTION A
DROP COLLATION CD
DROP TRANSLATION TD
Leveling Rules
None.
Function
Format
Syntax Rules
Access Rules
General Rules
Leveling Rules
None.
Schema definition and manipulation 261
X3H2-92-154/DBL CBR-002
11.4 <column definition>
Function
Format
Syntax Rules
1) Case:
Case:
Case:
Case:
Access Rules
General Rules
Leveling Rules
Function
Format
Syntax Rules
3) Case:
Case:
ii) If the subject data type is bit string, then the <literal>
shall be a <bit string literal> or a <hex string literal>.
If the length of the subject data type is fixed, then the
length in bits of the <bit string literal> or <hex string
literal> shall not be greater than the length of the sub-
ject data type. If the length of the subject data type is
iii) If the subject data type is exact numeric, then the <lit-
eral> shall be a <signed numeric literal> that simply
contains an <exact numeric literal>. There shall be a rep-
resentation of the value of the <literal> in the subject
data type that does not lose any significant digits.
Access Rules
None.
General Rules
Case:
Case:
Case:
Case:
Leveling Rules
None.
Function
Format
Syntax Rules
Access Rules
None.
General Rules
Case:
a) If <unique constraint definition> is specified, then the
table constraint descriptor is a unique constraint descriptor
that includes an indication of whether it was defined with
PRIMARY KEY or UNIQUE, and the names of the unique columns
specified in the <unique column list>.
is true.
Leveling Rules
None.
Function
Format
Syntax Rules
3) Case:
Access Rules
None.
General Rules
is true.
Leveling Rules
None.
Function
Format
Syntax Rules
2) Case:
Case:
Access Rules
General Rules
Case:
a) A <match type> is not specified and for each row of the ref-
erencing table, the <match predicate>
is true.
is true.
is true.
3) Case:
ii) For a given row in the referenced table, let unique match-
ing rows be all matching rows for that given row that are
matching rows only to the given row in the referenced table
for the referential constraint. For a given row in the ref-
erenced table, let non-unique matching rows be all matching
rows for that given row that are not unique matching rows
for that given row for the referential constraint.
4) For every row of the referenced table, its matching rows, unique
matching rows, and non-unique matching rows are determined imme-
diately before the execution of any SQL-statement. No new match-
ing rows are added during the execution of that SQL-statement.
The association between a referenced row and a non-unique match-
ing row is dropped during the execution of that SQL-statement
if the referenced row is either marked for deletion or updated
to a distinct value on any referenced column that corresponds
to a non-null referencing column. This occurs immediately after
such a mark for deletion or update of the referenced row. Unique
matching rows and non-unique matching rows for a referenced row
are evaluated immediately after dropping the association between
that referenced row and a non-unique matching row.
Case:
ii) If the <delete rule> specifies SET NULL, then in all match-
ing rows each referencing column is set to the null value.
Case:
ii) If the <delete rule> specifies SET NULL, then in all unique
matching rows each referencing column is set to the null
value.
Case:
Case:
Case:
Case:
ii) If the <update rule> specifies SET NULL, then in all unique
matching rows that contain a non-null value in the ref-
erencing column that corresponds with the updated column,
that referencing column is set to the null value.
9) All rows that are marked for deletion are effectively deleted
at the end of the SQL-statement, prior to the checking of any
integrity constraints.
Leveling Rules
Function
Format
Syntax Rules
Case:
Access Rules
Case:
General Rules
Leveling Rules
None.
Function
Format
Syntax Rules
3) The scope of the <table name> is the entire <alter table state-
ment>.
Access Rules
General Rules
Leveling Rules
Function
Format
Syntax Rules
None.
Access Rules
None.
General Rules
Leveling Rules
None.
Function
Format
Syntax Rules
3) C shall be a column of T.
Access Rules
None.
General Rules
Leveling Rules
None.
Function
Format
Syntax Rules
None.
Access Rules
None.
General Rules
Leveling Rules
None.
Function
Format
Syntax Rules
Access Rules
None.
General Rules
Leveling Rules
None.
Function
Destroy a column.
Format
Syntax Rules
Access Rules
None.
General Rules
3) If the column is not based on a domain, then its data type de-
scriptor is destroyed.
Leveling Rules
None.
Function
Format
Syntax Rules
None.
Access Rules
None.
General Rules
Leveling Rules
None.
Function
Format
Syntax Rules
Access Rules
None.
General Rules
Leveling Rules
None.
Function
Destroy a table.
Format
Syntax Rules
Access Rules
General Rules
Leveling Rules
1) The following restrictions apply for Intermediate SQL:
None.
Function
Format
Syntax Rules
9) The same <column name> shall not be specified more than once in
the <view column list>.
12)If WITH CHECK OPTION is specified, then the viewed table shall
be updatable.
Access Rules
General Rules
Case:
( QE ) AS VN VCL
7) If V is updatable, then:
Leveling Rules
Function
Destroy a view.
Format
Syntax Rules
Access Rules
General Rules
Leveling Rules
Function
Define a domain.
Format
Syntax Rules
Access Rules
General Rules
is true.
Leveling Rules
Function
Format
Syntax Rules
Access Rules
General Rules
Leveling Rules
Function
Format
Syntax Rules
None.
Access Rules
None.
General Rules
Leveling Rules
None.
Schema definition and manipulation 305
X3H2-92-154/DBL CBR-002
11.24 <drop domain default clause>
Function
Format
Syntax Rules
Access Rules
None.
General Rules
Leveling Rules
None.
306 Database Language SQL
X3H2-92-154/DBL CBR-002
11.25 <add domain constraint definition>
Function
Format
Syntax Rules
Access Rules
None.
General Rules
Leveling Rules
None.
Schema definition and manipulation 307
X3H2-92-154/DBL CBR-002
11.26 <drop domain constraint definition>
Function
Format
Syntax Rules
Access Rules
None.
General Rules
Leveling Rules
None.
308 Database Language SQL
X3H2-92-154/DBL CBR-002
11.27 <drop domain statement>
Function
Destroy a domain.
Format
Syntax Rules
Access Rules
General Rules
Leveling Rules
None.
Function
Format
Syntax Rules
Access Rules
General Rules
3) The character set has the same character repertoire as the char-
acter set identified by the <existing character set name>.
Leveling Rules
Function
Format
Syntax Rules
Access Rules
General Rules
Leveling Rules
None.
2) The following restrictions apply for Entry SQL in addition to
any Intermediate SQL restrictions:
Function
Format
Syntax Rules
Case:
Access Rules
General Rules
Leveling Rules
None.
Schema definition and manipulation 317
X3H2-92-154/DBL CBR-002
11.31 <drop collation statement>
Function
Format
Syntax Rules
Access Rules
General Rules
3) Let CSD be any character set descriptor that includes CN. CSD is
modified by deleting any occurrences of "COLLATION FROM CN" or
"DESC (CN)".
Leveling Rules
None.
Schema definition and manipulation 319
X3H2-92-154/DBL CBR-002
11.32 <translation definition>
Function
Format
Syntax Rules
Access Rules
General Rules
Leveling Rules
None.
322 Database Language SQL
X3H2-92-154/DBL CBR-002
11.33 <drop translation statement>
Function
Format
Syntax Rules
Access Rules
General Rules
Leveling Rules
None.
324 Database Language SQL
X3H2-92-154/DBL CBR-002
11.34 <assertion definition>
Function
Format
Syntax Rules
Access Rules
Case:
General Rules
None.
Schema definition and manipulation 327
X3H2-92-154/DBL CBR-002
11.35 <drop assertion statement>
Function
Destroy an assertion.
Format
Syntax Rules
Access Rules
General Rules
Leveling Rules
None.
328 Database Language SQL
X3H2-92-154/DBL CBR-002
11.36 <grant statement>
Function
Define privileges.
Format
Syntax Rules
Access Rules
General Rules
GRANT PA ON VN TO G WGO
11)If <table name> is specified, then for each view V owned by some
<grantee> G such that T or some column CT of T, let RTi, for i
ranging from 1 to the number of tables identified by the <table
reference>s contained in the <query expression> of V, be the
<table name>s of those tables. For every column CV of V:
12)If two privilege descriptors are identical except that one in-
dicates that the privilege is grantable and the other indicates
that the privilege is not grantable, then both privilege de-
scriptors are set to indicate that the privilege is grantable.
Leveling Rules
Function
Destroy privileges.
Format
Syntax Rules
iii) Case:
Case:
Case:
Access Rules
General Rules
Case:
Leveling Rules
None.
12 Module
12.1 <module>
Function
Define a module.
Format
<module> ::=
<module name clause>
<language clause>
<module authorization clause>
[ <temporary table declaration>... ]
<module contents>...
Syntax Rules
Module 341
X3H2-92-154/DBL CBR-002
12.1 <module>
Access Rules
None.
General Rules
3) Case:
DEALLOCATE DESCRIPTOR D
is effectively executed.
Leveling Rules
Function
Name a <module>.
Format
Syntax Rules
Access Rules
None.
General Rules
Leveling Rules
12.3 <procedure>
Function
Define a procedure.
Format
<procedure> ::=
PROCEDURE <procedure name> <parameter declaration list> <semicolon>
| <parameter declaration>...
Syntax Rules
Case:
Case:
Module 347
X3H2-92-154/DBL CBR-002
12.3 <procedure>
Access Rules
None.
General Rules
Case:
iii) S is executed.
ii) S is executed.
c) Otherwise:
Case:
CONNECT TO DEFAULT
2) Case:
Module 349
X3H2-92-154/DBL CBR-002
12.3 <procedure>
viii)S is executed.
11)Case:
12)Case:
Leveling Rules
Function
Syntax Rules
c) The base type of any parameter shall be an Ada data type de-
clared in an Ada package named SQL_STANDARD of the following
form:
package SQL_STANDARD is
package CHARACTER_SET renames csp;
subtype CHARACTER_TYPE is CHARACTER_SET.cst;
type CHAR is array (POSITIVE range <>) of CHARACTER_
TYPE;
type BIT is array (NATURAL range <>) of BOOLEAN;
type SMALLINT is range bs .. ts;
type INT is range bi .. ti;
type REAL is digits dr;
type DOUBLE_PRECISION is digits dd;
subtype INDICATOR_TYPE is t;
type SQLCODE_TYPE is range bsc .. tsc;
subtype SQL_ERROR is SQLCODE_TYPE range SQL_TYPE'FIRST .. -
1;
subtype NOT_FOUND is SQLCODE_TYPE range 100 .. 100;
type SQLSTATE_TYPE is new CHAR (1 .. 5);
package SQLSTATE_CODES is
AMBIGUOUS_CURSOR_NAME_NO_SUBCLASS:
constant SQLSTATE_TYPE :="3C000";
CARDINALITY_VIOLATION_NO_SUBCLASS:
constant SQLSTATE_TYPE :="21000";
CONNECTION_EXCEPTION_NO_SUBCLASS:
constant SQLSTATE_TYPE :="08000";
CONNECTION_EXCEPTION_CONNECTION_DOES_NOT_EXIST:
constant SQLSTATE_TYPE :="08003";
CONNECTION_EXCEPTION_CONNECTION_FAILURE:
constant SQLSTATE_TYPE :="08006";
CONNECTION_EXCEPTION_CONNECTION_NAME_IN_USE:
constant SQLSTATE_TYPE :="08002";
CONNECTION_EXCEPTION_SQLCLIENT_UNABLE_TO_ESTABLISH_
SQLCONNECTION:
constant SQLSTATE_TYPE :="08001";
CONNECTION_EXCEPTION_SQLSERVER_REJECTED_ESTABLISHMENT_
OF_SQLCONNECTION:
constant SQLSTATE_TYPE :="08004";
CONNECTION_EXCEPTION_TRANSACTION_RESOLUTION_
UNKNOWN:
constant SQLSTATE_TYPE :="08007";
DATA_EXCEPTION_NO_SUBCLASS:
constant SQLSTATE_TYPE :="22000";
DATA_EXCEPTION_CHARACTER_NOT_IN_REPERTOIRE:
constant SQLSTATE_TYPE :="22021";
DATA_EXCEPTION_DATETIME_FIELD_OVERFLOW:
constant SQLSTATE_TYPE :="22008";
DATA_EXCEPTION_DIVISION_BY_ZERO:
constant SQLSTATE_TYPE :="22012";
DATA_EXCEPTION_ERROR_IN_ASSIGNMENT:
constant SQLSTATE_TYPE :="22005";
DATA_EXCEPTION_INDICATOR_OVERFLOW:
constant SQLSTATE_TYPE :="22022";
DATA_EXCEPTION_INTERVAL_FIELD_OVERFLOW:
constant SQLSTATE_TYPE :="22015";
DATA_EXCEPTION_INVALID_CHARACTER_VALUE_FOR_CAST:
constant SQLSTATE_TYPE :="22018";
DATA_EXCEPTION_INVALID_DATETIME_FORMAT:
constant SQLSTATE_TYPE :="22007";
DATA_EXCEPTION_INVALID_ESCAPE_CHARACTER:
constant SQLSTATE_TYPE :="22019";
DATA_EXCEPTION_INVALID_ESCAPE_SEQUENCE:
constant SQLSTATE_TYPE :="22025";
DATA_EXCEPTION_INVALID_PARAMETER_VALUE:
constant SQLSTATE_TYPE :="22023";
DATA_EXCEPTION_INVALID_TIME_ZONE_DISPLACEMENT_
VALUE:
constant SQLSTATE_TYPE :="22009";
DATA_EXCEPTION_NULL_VALUE_NO_INDICATOR_PARAMETER:
constant SQLSTATE_TYPE :="22002";
DATA_EXCEPTION_NUMERIC_VALUE_OUT_OF_RANGE:
constant SQLSTATE_TYPE :="22003";
DATA_EXCEPTION_STRING_DATA_LENGTH_MISMATCH:
constant SQLSTATE_TYPE :="22026";
DATA_EXCEPTION_STRING_DATA_RIGHT_TRUNCATION:
constant SQLSTATE_TYPE :="22001";
DATA_EXCEPTION_SUBSTRING_ERROR:
constant SQLSTATE_TYPE :="22011";
DATA_EXCEPTION_TRIM_ERROR:
constant SQLSTATE_TYPE :="22027";
DATA_EXCEPTION_UNTERMINATED_C_STRING:
constant SQLSTATE_TYPE :="22024";
DEPENDENT_PRIVILEGE_DESCRIPTORS_STILL_EXIST_NO_
SUBCLASS:
constant SQLSTATE_TYPE :="2B000";
Module 353
X3H2-92-154/DBL CBR-002
12.4 Calls to a <procedure>
DYNAMIC_SQL_ERROR_NO_SUBCLASS:
constant SQLSTATE_TYPE :="07000";
DYNAMIC_SQL_ERROR_CURSOR_SPECIFICATION_CANNOT_BE_
EXECUTED:
constant SQLSTATE_TYPE :="07003";
DYNAMIC_SQL_ERROR_INVALID_DESCRIPTOR_COUNT:
constant SQLSTATE_TYPE :="07008";
DYNAMIC_SQL_ERROR_INVALID_DESCRIPTOR_INDEX:
constant SQLSTATE_TYPE :="07009";
DYNAMIC_SQL_ERROR_PREPARED_STATEMENT_NOT_A_CURSOR_
SPECIFICATION:
constant SQLSTATE_TYPE :="07005";
DYNAMIC_SQL_ERROR_RESTRICTED_DATA_TYPE_ATTRIBUTE_
VIOLATION:
constant SQLSTATE_TYPE :="07006";
DYNAMIC_SQL_ERROR_USING_CLAUSE_DOES_NOT_MATCH_
DYNAMIC_PARAMETER_SPEC:
constant SQLSTATE_TYPE :="07001";
DYNAMIC_SQL_ERROR_USING_CLAUSE_DOES_NOT_MATCH_
TARGET_SPEC:
constant SQLSTATE_TYPE :="07002";
DYNAMIC_SQL_ERROR_USING_CLAUSE_REQUIRED_FOR_
DYNAMIC_PARAMETERS:
constant SQLSTATE_TYPE :="07004";
DYNAMIC_SQL_ERROR_USING_CLAUSE_REQUIRED_FOR_RESULT_
FIELDS:
constant SQLSTATE_TYPE :="07007";
FEATURE_NOT_SUPPORTED_NO_SUBCLASS:
constant SQLSTATE_TYPE :="0A000";
FEATURE_NOT_SUPPORTED_MULTIPLE_ENVIRONMENT_
TRANSACTIONS:
constant SQLSTATE_TYPE :="0A001";
INTEGRITY_CONSTRAINT_VIOLATION_NO_SUBCLASS:
constant SQLSTATE_TYPE :="23000";
INVALID_AUTHORIZATION_SPECIFICATION_NO_SUBCLASS:
constant SQLSTATE_TYPE :="28000";
INVALID_CATALOG_NAME_NO_SUBCLASS:
constant SQLSTATE_TYPE :="3D000";
INVALID_CHARACTER_SET_NAME_NO_SUBCLASS:
constant SQLSTATE_TYPE :="2C000";
INVALID_CONDITION_NUMBER_NO_SUBCLASS:
constant SQLSTATE_TYPE :="35000";
INVALID_CONNECTION_NAME_NO_SUBCLASS:
constant SQLSTATE_TYPE :="2E000";
INVALID_CURSOR_NAME_NO_SUBCLASS:
constant SQLSTATE_TYPE :="34000";
INVALID_CURSOR_STATE_NO_SUBCLASS:
constant SQLSTATE_TYPE :="24000";
INVALID_SCHEMA_NAME_NO_SUBCLASS:
constant SQLSTATE_TYPE :="3F000";
INVALID_SQL_DESCRIPTOR_NAME_NO_SUBCLASS:
constant SQLSTATE_TYPE :="33000";
INVALID_SQL_STATEMENT_NAME_NO_SUBCLASS:
Module 355
X3H2-92-154/DBL CBR-002
12.4 Calls to a <procedure>
WARNING_STRING_DATA_RIGHT_TRUNCATION_WARNING:
constant SQLSTATE_TYPE :="01004";
WITH_CHECK_OPTION_VIOLATION_NO_SUBCLASS:
constant SQLSTATE_TYPE :="44000";
end SQLSTATE_CODES;
end SQL_STANDARD;
SQL_STANDARD.SQLCODE_TYPE
SQL_STANDARD.SQLSTATE_TYPE
Case:
Module 357
X3H2-92-154/DBL CBR-002
12.4 Calls to a <procedure>
Case:
Module 359
X3H2-92-154/DBL CBR-002
12.4 Calls to a <procedure>
Case:
Case:
Module 361
X3H2-92-154/DBL CBR-002
12.4 Calls to a <procedure>
Access Rules
None.
General Rules
Case:
to PIi.
ii) Let CLi be one greater than the maximum possible length in
octets of PNi. Where PNi is used as an output parameter, a
reference to PNi that assigns a value SVi to PNi implic-
itly assigns a value that is an SQL CHARACTER(CLi) data
type in which octets of the value are the corresponding
octets of SVi, padded on the right with <space>s as nec-
essary to reach the length CLi, concatenated with a single
implementation-defined null character that terminates a C
character string.
c) Otherwise,
Case:
Module 363
X3H2-92-154/DBL CBR-002
12.4 Calls to a <procedure>
to PIi.
c) Otherwise,
Case:
to PIi.
c) Otherwise,
Case:
Module 365
X3H2-92-154/DBL CBR-002
12.4 Calls to a <procedure>
Case:
to PIi.
c) Otherwise,
Case:
b) Otherwise,
Leveling Rules
None.
Module 367
X3H2-92-154/DBL CBR-002
12.5 <SQL procedure statement>
Function
Format
Module 369
X3H2-92-154/DBL CBR-002
12.5 <SQL procedure statement>
Syntax Rules
None.
Access Rules
None.
General Rules
None.
Leveling Rules
None.
13 Data manipulation
Function
Define a cursor.
Format
Syntax Rules
Case:
Access Rules
None.
General Rules
b) Let P be any row of the result table and let Q be any other
row of that table, and let PVi and QVi be the values of Ki
in these rows, respectively. The relative position of rows
P and Q in the result is determined by comparing PVi and
QVi according to the rules of Subclause 8.2, "<comparison
predicate>", where the <comp op> is the applicable <comp op>
for Ki, with the following special treatment of null values.
Whether a sort key value that is null is considered greater
or less than a non-null value is implementation-defined, but
all sort key values that are null shall either be considered
greater than all non-null values or be considered less than
all non-null values. PVi is said to precede QVi if the value
of the <comparison predicate> "PVi <comp op> QVi" is true for
the applicable <comp op>.
Leveling Rules
Function
Open a cursor.
Format
Syntax Rules
Access Rules
General Rules
e) Case:
Leveling Rules
None.
None.
376 Database Language SQL
X3H2-92-154/DBL CBR-002
13.3 <fetch statement>
Function
Format
Syntax Rules
Access Rules
None.
General Rules
2) Case:
Case:
5) Case:
Case:
Leveling Rules
None.
Function
Close a cursor.
Format
Syntax Rules
Access Rules
None.
General Rules
Leveling Rules
None.
None.
Data manipulation 381
X3H2-92-154/DBL CBR-002
13.5 <select statement: single row>
Function
Format
Syntax Rules
Access Rules
None.
General Rules
2) Case:
Leveling Rules
None.
Function
Format
Syntax Rules
Access Rules
General Rules
4) If, while CR is open, the row from which the current row of CR
is derived has been marked for deletion by any <delete state-
ment: searched>, marked for deletion by any <delete statement:
positioned> that identifies any cursor other than CR, updated
5) All rows that are marked for deletion are effectively deleted
at the end of the <delete statement: positioned> prior to the
checking of any integrity constraint.
Leveling Rules
None.
None.
Data manipulation 385
X3H2-92-154/DBL CBR-002
13.7 <delete statement: searched>
Function
Format
Syntax Rules
Access Rules
General Rules
2) Case:
4) All rows that are marked for deletion are effectively deleted
at the end of the <delete statement: searched> prior to the
checking of any integrity constraint.
Leveling Rules
None.
Data manipulation 387
X3H2-92-154/DBL CBR-002
13.8 <insert statement>
Function
Format
Syntax Rules
VALUES (DEFAULT, . . . )
Access Rules
1) Case:
General Rules
Case:
ii) For every object column in the candidate row, the value of
the object column identified by the i-th <column name> in
the <insert column list> is replaced by the i-th value of
R.
Leveling Rules
Function
Format
Syntax Rules
7) The same <object column> shall not appear more than once in a
<set clause list>.
Access Rules
General Rules
3) The object row is that row from which the current row of CR is
derived.
4) If, while CR is open, the object row has been marked for dele-
tion by any <delete statement: searched>, marked for deletion
by any <delete statement: positioned> that identifies any cursor
other than CR, updated by any <update statement: searched>, or
updated by any <update statement: positioned> that identifies
any cursor other than CR, then a completion condition is raised:
warning-cursor operation conflict.
Note: The data values allowable in the object row may be con-
strained by a WITH CHECK OPTION constraint. The effect of a
WITH CHECK OPTION constraint is defined in the General Rules of
Subclause 11.19, "<view definition>".
Leveling Rules
Function
Format
Syntax Rules
3) The same <object column> shall not appear more than once in a
<set clause list>.
Access Rules
General Rules
2) Case:
3) If any row in the set of object rows has been marked for dele-
tion by any <delete statement: positioned> that identifies some
cursor CR that is still open or updated by any <update state-
ment: positioned> that identifies some cursor CR that is still
open, then a completion condition is raised: warning-cursor
operation conflict.
Note: The data values allowable in the object row may be con-
strained by a WITH CHECK OPTION constraint. The effect of a
WITH CHECK OPTION constraint is defined in the General Rules of
Subclause 11.19, "<view definition>".
Leveling Rules
Function
Format
Syntax Rules
Access Rules
None.
General Rules
DROP TABLE T
Leveling Rules
None.
398 Database Language SQL
X3H2-92-154/DBL CBR-002
14 Transaction management
Function
Format
Syntax Rules
Access Rules
None.
General Rules
Leveling Rules
None.
Function
Format
Syntax Rules
Access Rules
None.
General Rules
Case:
Case:
Leveling Rules
None.
402 Database Language SQL
X3H2-92-154/DBL CBR-002
14.3 <commit statement>
Function
Format
Syntax Rules
None.
Access Rules
None.
General Rules
CLOSE CR
5) Case:
a) If any constraint is not satisfied, then any changes to SQL-
data or schemas that were made by the current SQL-transaction
are canceled and an exception condition is raised: transac-
tion rollback-integrity constraint violation.
Leveling Rules
None.
Function
Format
Syntax Rules
None.
Access Rules
None.
General Rules
CLOSE CR
Leveling Rules
None.
15 Connection management
Function
Establish an SQL-connection.
Format
Syntax Rules
Access Rules
None.
General Rules
8) Case:
Leveling Rules
None.
Connection management 409
X3H2-92-154/DBL CBR-002
15.2 <set connection statement>
Function
Format
Syntax Rules
None.
Access Rules
None.
General Rules
2) Case:
Leveling Rules
None.
Connection management 411
X3H2-92-154/DBL CBR-002
15.3 <disconnect statement>
Function
Terminate an SQL-connection.
Format
Syntax Rules
None.
Access Rules
None.
General Rules
Leveling Rules
None.
Connection management 413
X3H2-92-154/DBL CBR-002
414 Database Language SQL
X3H2-92-154/DBL CBR-002
16 Session management
Function
Format
Syntax Rules
Access Rules
None.
General Rules
Leveling Rules
1) The following restrictions apply for Intermediate SQL:
None.
416 Database Language SQL
X3H2-92-154/DBL CBR-002
16.2 <set schema statement>
Function
Format
Syntax Rules
Access Rules
None.
General Rules
3) Case:
Leveling Rules
None.
418 Database Language SQL
X3H2-92-154/DBL CBR-002
16.3 <set names statement>
Function
Set the default character set name for <identifier>s and <character
string literal>s in <preparable statement>s that are prepared in
the current SQL-session by an <execute immediate statement> or a
<prepare statement> and in <direct SQL statement>s that are invoked
directly.
Format
Syntax Rules
Access Rules
None.
General Rules
Leveling Rules
Function
Format
Syntax Rules
Access Rules
None.
General Rules
Leveling Rules
None.
Function
Set the default local time zone displacement for the current SQL-
session.
Format
Syntax Rules
Access Rules
None.
General Rules
1) Case:
b) Otherwise,
Case:
Leveling Rules
None.
17 Dynamic SQL
Function
Specify the identifiers, data types, and codes used in SQL item
descriptor areas.
Syntax Rules
Case:
Case:
Case:
Case:
_<key_word>_____________Data_Type__________________________________
_<key_word>_____________Data_Type__________________________________
General Rules
1) Table 18, "Codes used for SQL data types in Dynamic SQL", speci-
fies the codes associated with the SQL data types.
428 Database Language SQL
X3H2-92-154/DBL CBR-002
17.1 Description of SQL item descriptor areas
_______Table_18-Codes_used_for_SQL_data_types_in_Dynamic_SQL_______
_Data_Type__________________Code___________________________________
| Implementation-defined | < 0 |
data types
| BIT | 14 |
| | |
| BIT VARYING | 15 |
| | |
| CHARACTER | 1 |
| | |
| CHARACTER VARYING | 12 |
| | |
| DATE, TIME, or TIMESTAMP | 9 |
| | |
| DECIMAL | 3 |
| | |
| DOUBLE PRECISION | 8 |
| | |
| FLOAT | 6 |
| | |
| INTEGER | 4 |
| | |
| INTERVAL | 10 |
| | |
| NUMERIC | 2 |
| | |
| REAL | 7 |
| | |
|_SMALLINT_________________|_5_____________________________________|
| | |
2) Table 19, "Codes associated with datetime data types in Dynamic
SQL", specifies the codes associated with the datetime data
types.
_Table_19-Codes_associated_with_datetime_data_types_in_Dynamic_SQL_
_Datetime_Data_Type_________Code___________________________________
| DATE | 1 |
| | |
| TIME | 2 |
| | |
| TIME WITH TIME ZONE | 4 |
| | |
| TIMESTAMP | 3 |
| | |
|_TIMESTAMP_WITH_TIME_ZONE_|_5_____________________________________|
| | |
3) Table 20, "Codes used for <interval qualifier>s in Dynamic SQL",
specifies the codes associated with <interval qualifier>s for
interval data types.
____Table_20-Codes_used_for_<interval_qualifier>s_in_Dynamic_SQL___
_Datetime_Qualifier_________Code___________________________________
| DAY | 3 |
| | |
| DAY TO HOUR | 8 |
| | |
| DAY TO MINUTE | 9 |
| | |
| DAY TO SECOND | 10 |
| | |
| HOUR | 4 |
| | |
| HOUR TO MINUTE | 11 |
| | |
| HOUR TO SECOND | 12 |
| | |
| MINUTE | 5 |
| | |
| MINUTE TO SECOND | 13 |
| | |
| MONTH | 2 |
| | |
| SECOND | 6 |
| | |
| YEAR | 1 |
| | |
|_YEAR_TO_MONTH____________|_7_____________________________________|
| | |
Leveling Rules
None.
None.
430 Database Language SQL
X3H2-92-154/DBL CBR-002
17.2 <allocate descriptor statement>
Function
Format
Syntax Rules
Access Rules
None.
General Rules
Leveling Rules
Function
Format
Syntax Rules
None.
Access Rules
None.
General Rules
Leveling Rules
Function
Format
Syntax Rules
1) The data type of <item number> shall be exact numeric with scale
0.
Access Rules
None.
General Rules
f) Case:
Leveling Rules
Function
Format
Syntax Rules
1) The data type of <item number> shall be exact numeric with scale
0.
Access Rules
None.
General Rules
When any value other than DATA is set, the value of DATA becomes
undefined.
5) For every <set item information> specified, let DIN be the <de-
scriptor item name> and let V be the value of the <simple value
specification 2>. If DIN is DATA and the data type of V does
not match the data type specified by the item descriptor area,
then an exception condition is raised: data exception-error in
assignment.
Case:
Leveling Rules
Function
Format
Syntax Rules
Access Rules
None.
General Rules
Case:
3) Let E1, E2, E3, and E4 be <value expression>s of the form "<dy-
namic parameter specification>" or a <dynamic parameter specifi-
cation> enclosed in any number of matching parentheses. Let F be
a <value expression> whose data type is determined via General
Rules in Clause 6, "Scalar expressions" and the Rules in this
Subclause. Let X1, X2, X3, and X4 be <value expression>s meeting
the criteria for either En or F.
q) P contains a <comment>.
5) Case:
Case:
9) Case:
a) If <extended statement name> is specified for the <SQL state-
ment name>, then the value of the <extended statement name>
is associated with the prepared statement. This value and ex-
plicit or implied <scope option> shall be specified for each
<execute statement> or <allocate cursor statement> that is to
be associated with this prepared statement.
Leveling Rules
None.
Function
Format
Syntax Rules
Access Rules
None.
General Rules
Leveling Rules
None.
Function
Format
Syntax Rules
Access Rules
None.
General Rules
Leveling Rules
Function
Format
Syntax Rules
Access Rules
None.
General Rules
c) COUNT is set to D.
iv) Case:
c) COUNT is set to D.
iv) Case:
iii) If the first D item descriptor areas are not valid as spec-
ified in Subclause 17.1, "Description of SQL item descrip-
tor areas", then an exception condition is raised: dynamic
SQL error- using clause does not match dynamic parameter
specifications.
d) Case:
CAST ( SV AS TDT )
CAST ( SV AS TDT )
iii) If the first D item descriptor areas are not valid as spec-
ified in Subclause 17.1, "Description of SQL item descrip-
tor areas", then an exception condition is raised: dynamic
SQL error- using clause does not match target specifica-
tions.
a) Let SDT be the effective data type of the i-th <select list>
column, defined to be the type represented by the values of
TYPE, LENGTH, PRECISION, SCALE, DATETIME_INTERVAL_PRECISION,
DATETIME_INTERVAL_CODE, CHARACTER_SET_CATALOG, CHARACTER_
SET_SCHEMA, and CHARACTER_SET_NAME that would be set by a
<describe output statement> to reflect the description of the
i-th <select list> column. Let SV be the value of the <select
list> column, with data type SDT.
b) Let TDT be the effective data type of the i-th <target spec-
ification> as represented by the values of TYPE, LENGTH,
PRECISION, SCALE, DATETIME_INTERVAL_CODE, DATETIME_INTERVAL_
PRECISION, CHARACTER_SET_CATALOG, CHARACTER_SET_SCHEMA, and
CHARACTER_SET_NAME, in the i-th item descriptor area.
CAST ( SV AS TDT )
CAST ( SV AS TDT )
CAST ( SV AS TDT )
ii) Case:
Note: All other values of the SQL descriptor area are un-
changed.
Leveling Rules
Function
Format
Syntax Rules
Access Rules
None.
General Rules
8) P is executed.
Case:
Leveling Rules
1) The following restrictions apply for Intermediate SQL:
Function
Format
Syntax Rules
Access Rules
None.
General Rules
Case:
Case:
Leveling Rules
None.
Function
Format
Syntax Rules
Access Rules
None.
General Rules
Leveling Rules
Function
Format
Syntax Rules
None.
Access Rules
None.
General Rules
Leveling Rules
None.
466 Database Language SQL
X3H2-92-154/DBL CBR-002
17.14 <dynamic open statement>
Function
Format
Syntax Rules
Access Rules
General Rules
Leveling Rules
None.
Function
Format
Syntax Rules
Access Rules
None.
General Rules
1) The General Rules specified in Subclause 17.9, "<using clause>",
for <dynamic fetch statement> are applied.
Leveling Rules
Function
Close a cursor.
Format
Syntax Rules
Access Rules
None.
General Rules
Leveling Rules
None.
Function
Format
Syntax Rules
Access Rules
General Rules
Leveling Rules
1) The following restrictions apply for Intermediate SQL:
None.
Function
Format
Syntax Rules
Access Rules
General Rules
Leveling Rules
None.
Function
Format
Syntax Rules
Access Rules
General Rules
Leveling Rules
Function
Format
Syntax Rules
Access Rules
General Rules
Leveling Rules
None.
18 Diagnostics management
Function
Format
| CONNECTION_NAME
| CONSTRAINT_CATALOG
| CONSTRAINT_SCHEMA
| CONSTRAINT_NAME
| CATALOG_NAME
| SCHEMA_NAME
| TABLE_NAME
| COLUMN_NAME
| CURSOR_NAME
| MESSAGE_TEXT
| MESSAGE_LENGTH
| MESSAGE_OCTET_LENGTH
Syntax Rules
__Table_21-<identifier>s_for_use_with_<get_diagnostics_statement>__
_<identifier>___________Data_Type__________________________________
|_________________<stat|ment_information_item_name>s_______________|
| | |
| NUMBER exact numeric with scale 0 |
| |
| MORE | character string (1) |
| | |
| COMMAND_FUNCTION | character varying (L) |
| | |
| DYNAMIC_FUNCTION | character varying (L) |
| | |
|_ROW_COUNT____________|_exact_numeric_with_scale_0________________|
| | |
|_________________<cond|tion_information_item_name>s_______________|
| | |
| CONDITION_NUMBER exact numeric with scale 0 |
| |
| RETURNED_SQLSTATE | character string (5) |
| | |
| CLASS_ORIGIN | character varying (L) |
| | |
| SUBCLASS_ORIGIN | character varying (L) |
| | |
| SERVER_NAME | character varying (L) |
| | |
| CONNECTION_NAME | character varying (L) |
| | |
| CONSTRAINT_CATALOG | character varying (L) |
| | |
| CONSTRAINT_SCHEMA | character varying (L) |
| | |
| CONSTRAINT_NAME | character varying (L) |
| | |
| CATALOG_NAME | character varying (L) |
| | |
| SCHEMA_NAME | character varying (L) |
| | |
| TABLE_NAME | character varying (L) |
| | |
| COLUMN_NAME | character varying (L) |
| | |
| CURSOR_NAME | character varying (L) |
| | |
| MESSAGE_TEXT | character varying (L) |
| | |
| MESSAGE_LENGTH | exact numeric with scale 0 |
| | |
|_MESSAGE_OCTET_LENGTH_|_exact_numeric_with_scale_0________________|
| | |
| Where L is an impleme|tation-defined integer not less than 128. |
|______________________|___________________________________________|
| |
Access Rules
None.
General Rules
_SQL-statement____________________Identifier_______________________
_SQL-statement____________________Identifier_______________________
_SQL-statement____________________Identifier_______________________
Case:
ii) Case:
ii) If the syntax error or the access rule violation was for
an inaccessible column, then the value of COLUMN_NAME is
the <column name> of that column. Otherwise, the value of
COLUMN_NAME is <space>s.
Case:
Note: There are no numeric items that are not set by these
rules.
Leveling Rules
None.
19 Embedded SQL
Function
Format
Syntax Rules
2) Case:
3) Case:
4) Case:
11)A <host variable definition> defines the host language data type
of the <host identifier>. For every such host language data type
an equivalent SQL <data type> is specified in Subclause 19.3,
"<embedded SQL Ada program>", Subclause 19.4, "<embedded
SQL C program>", Subclause 19.5, "<embedded SQL COBOL pro-
gram>", Subclause 19.6, "<embedded SQL Fortran program>",
Subclause 19.7, "<embedded SQL MUMPS program>", Subclause 19.8,
"<embedded SQL Pascal program>", and Subclause 19.9, "<embedded
SQL PL/I program>".
Case:
Access Rules
None.
General Rules
Leveling Rules
None.
Function
Format
<condition> ::=
SQLERROR | NOT FOUND
Syntax Rules
Note:
Case:
None.
General Rules
Case:
Leveling Rules
None.
None.
Embedded SQL 499
X3H2-92-154/DBL CBR-002
19.3 <embedded SQL Ada program>
Function
Format
| SQL_STANDARD.SMALLINT
| SQL_STANDARD.INT
| SQL_STANDARD.REAL
| SQL_STANDARD.DOUBLE_PRECISION
| SQL_STANDARD.SQLCODE_TYPE
| SQL_STANDARD.SQLSTATE_TYPE
| SQL_STANDARD.INDICATOR_TYPE
Syntax Rules
with SQL_STANDARD;
use SQL_STANDARD;
use SQL_STANDARD.CHARACTER_SET;
Access Rules
None.
General Rules
Leveling Rules
Function
Format
Syntax Rules
Access Rules
None.
General Rules
Leveling Rules
Function
Format
Syntax Rules
Access Rules
None.
General Rules
Leveling Rules
Function
Format
Syntax Rules
Access Rules
None.
General Rules
Leveling Rules
Function
Format
| REAL
Syntax Rules
Access Rules
None.
General Rules
Leveling Rules
None.
Function
Format
OF CHAR
[ CHARACTER SET [ IS ] <character set specification> ]
| PACKED ARRAY <left bracket> 1 <double period> <length> <right
bracket>
OF BIT
| INTEGER
| REAL
| CHAR [ CHARACTER SET [ IS ] <character set specification> ]
| BIT
Syntax Rules
Access Rules
None.
General Rules
Leveling Rules
Function
Format
Syntax Rules
Case:
Case:
Access Rules
None.
General Rules
Leveling Rules
Function
Format
Syntax Rules
1) The <direct SQL data statement> shall not contain any <parameter
specification>, <dynamic parameter specification>, or <variable
specification>.
General Rules
DEALLOCATE DESCRIPTOR D
is effectively executed.
ii) S is executed.
b) Otherwise:
Case:
CONNECT TO DEFAULT
1) Case:
C) Case:
vi) S is executed.
8) Case:
Leveling Rules
None.
Function
Format
Syntax Rules
Case:
Access Rules
None.
General Rules
Leveling Rules
None.
None.
Direct invocation of SQL 531
X3H2-92-154/DBL CBR-002
532 Database Language SQL
X3H2-92-154/DBL CBR-002
21.1 Introduction
Function
Definition
Leveling Rules
None.
Function
Definition
Definition
Leveling Rules
None.
Function
Definition
Description
Function
Definition
Leveling Rules
None.
Function
Definition
IN
( SELECT OBJECT_CATALOG, OBJECT_SCHEMA, OBJECT_
NAME, OBJECT_TYPE
FROM DEFINITION_SCHEMA.USAGE_PRIVILEGES
WHERE GRANTEE IN ( 'PUBLIC', CURRENT_USER ) )
OR
( DOMAIN_CATALOG, DOMAIN_SCHEMA, DOMAIN_NAME ) IN
( SELECT DOMAIN_CATALOG, DOMAIN_SCHEMA, DOMAIN_
NAME
FROM COLUMNS ) )
AND DOMAIN_CATALOG
= ( SELECT CATALOG_NAME FROM INFORMATION_SCHEMA_
CATALOG_NAME )
Information Schema and Definition Schema 539
X3H2-92-154/DBL CBR-002
21.2 Information Schema
Leveling Rules
None.
Function
Definition
Leveling Rules
None.
Function
Definition
Leveling Rules
None.
Function
Identify the viewed tables defined in this catalog that are acces-
sible to a given user.
Definition
Leveling Rules
None.
Function
Definition
AS CHARACTER_SET_SCHEMA,
COALESCE (C1.CHARACTER_SET_NAME, C2.CHARACTER_SET_NAME) AS
CHARACTER_SET_NAME,
COALESCE (D1.COLLATION_CATALOG, D2.COLLATION_CATALOG) AS
COLLATION_CATALOG,
COALESCE (D1.COLLATION_SCHEMA, D2.COLLATION_SCHEMA) AS
COLLATION_SCHEMA,
COALESCE (D1.COLLATION_NAME, D2.COLLATION_NAME) AS
COLLATION_NAME,
DOMAIN_CATALOG, DOMAIN_SCHEMA, DOMAIN_NAME
FROM DEFINITION_SCHEMA.COLUMNS AS C
LEFT JOIN
DEFINITION_SCHEMA.DATA_TYPE_DESCRIPTOR AS D1
LEFT JOIN
DEFINITION_SCHEMA.COLLATIONS AS C1
ON
( ( C1.COLLATION_CATALOG, C1.COLLATION_SCHEMA,
C1.COLLATION_
NAME )
= ( D1.COLLATION_CATALOG, D1.COLLATION_SCHEMA,
D1.COLLATION_
NAME ) )
ON
( ( C.TABLE_CATALOG, C.TABLE_SCHEMA, C.TABLE_NAME, C.COLUMN_
NAME )
= ( D1.TABLE_OR_DOMAIN_CATALOG, D1.TABLE_OR_DOMAIN_
SCHEMA,
D1.TABLE_OR_DOMAIN_NAME, D1.COLUMN_NAME ) )
LEFT JOIN
DEFINITION_SCHEMA.DATA_TYPE_DESCRIPTOR AS D2
LEFT JOIN
DEFINITION_SCHEMA.COLLATIONS AS C2
ON
( ( C2.COLLATION_CATALOG, C2.COLLATION_SCHEMA,
C2.COLLATION_
NAME )
= ( D2.COLLATION_CATALOG, D2.COLLATION_SCHEMA,
D2.COLLATION_
NAME ) )
ON
( ( C.DOMAIN_CATALOG, C.DOMAIN_SCHEMA, C.DOMAIN_NAME )
= ( D2.TABLE_OR_DOMAIN_CATALOG, D2.TABLE_OR_DOMAIN_
SCHEMA,
D2.TABLE_OR_DOMAIN_NAME ) )
WHERE ( C.TABLE_CATALOG, C.TABLE_SCHEMA, C.TABLE_
NAME, C.COLUMN_NAME )
IN
( SELECT TABLE_CATALOG, TABLE_SCHEMA, TABLE_
NAME, COLUMN_NAME
FROM DEFINITION_SCHEMA.COLUMN_PRIVILEGES
WHERE GRANTEE IN ( 'PUBLIC', CURRENT_USER ) )
AND C.TABLE_CATALOG
= ( SELECT CATALOG_NAME FROM INFORMATION_SCHEMA_
CATALOG_NAME )
Leveling Rules
1) The following restrictions apply for Intermediate SQL:
None.
Function
Definition
Leveling Rules
None.
Function
Definition
Leveling Rules
None.
Function
Definition
Leveling Rules
None.
Function
Definition
Leveling Rules
None.
Function
Definition
Leveling Rules
None.
Function
Definition
Leveling Rules
None.
Function
Definition
Leveling Rules
None.
Function
Definition
Leveling Rules
None.
Function
Identify the character sets defined in this catalog that are acces-
sible to a given user.
Definition
Leveling Rules
None.
Function
Definition
Leveling Rules
None.
Information Schema and Definition Schema 555
X3H2-92-154/DBL CBR-002
21.2 Information Schema
Function
Definition
Leveling Rules
None.
556 Database Language SQL
X3H2-92-154/DBL CBR-002
21.2 Information Schema
Function
Definition
Leveling Rules
None.
Function
Definition
Leveling Rules
None.
Function
Definition
Leveling Rules
None.
Function
Definition
Leveling Rules
None.
Function
Definition
Leveling Rules
None.
Function
Definition
Leveling Rules
None.
Function
Definition
Description
Function
Definition
Description
Function
Definition
Description
21.3.1 Introduction
The base tables are all defined in a <schema definition> for the
schema named DEFINITION_SCHEMA. The table definitions are as com-
plete as the definitional power of SQL allows. The table defi-
nitions are supplemented with assertions where appropriate; see
Subclause 21.4, "Assertions on the base tables". Each description
comprises three parts:
The specification provides only a model of the base tables that are
required, and does not imply that an implementation shall provide
the functionality in the manner described in this clause.
Function
Create the schema that is to contain the base tables that underlie
the Information Schema
Definition
Description
None.
Information Schema and Definition Schema 567
X3H2-92-154/DBL CBR-002
21.3 Definition Schema
Function
The USERS table has one row for each <authorization identifier>
referenced in the Information Schema of the catalog. These are
all those <authorization identifier>s that may grant or receive
privileges as well as those that may create a schema, or currently
own a schema created through a <schema definition>.
Definition
Description
Function
Definition
Description
Function
The DATA_TYPE_DESCRIPTOR table has one row for each domain and
one row for each column (in each table) that is defined as hav-
ing a data type rather than a domain. It effectively contains a
representation of the data type descriptors.
Definition
TABLE_OR_DOMAIN_SCHEMA INFORMATION_SCHEMA.SQL_IDENTIFIER,
TABLE_OR_DOMAIN_NAME INFORMATION_SCHEMA.SQL_IDENTIFIER,
COLUMN_NAME INFORMATION_SCHEMA.SQL_IDENTIFIER,
DATA_TYPE INFORMATION_SCHEMA.CHARACTER_DATA
COLLATION_SCHEMA INFORMATION_SCHEMA.SQL_IDENTIFIER,
COLLATION_NAME INFORMATION_SCHEMA.SQL_IDENTIFIER,
NUMERIC_PRECISION INFORMATION_SCHEMA.CARDINAL_
NUMBER,
NUMERIC_PRECISION_RADIX INFORMATION_SCHEMA.CARDINAL_
NUMBER,
NUMERIC_SCALE INFORMATION_SCHEMA.CARDINAL_
NUMBER,
DATETIME_PRECISION INFORMATION_SCHEMA.CARDINAL_
NUMBER,
CONSTRAINT TABLE_OR_DOMAIN_CHECK_COMBINATIONS
CHECK ( DATA_TYPE IN ( 'CHARACTER', 'CHARACTER VARYING',
'BIT', 'BIT VARYING' )
AND ( CHARACTER_MAXIMUM_LENGTH, CHARACTER_OCTET_
LENGTH,
COLLATION_CATALOG, COLLATION_SCHEMA, COLLATION_
NAME )
IS NOT NULL
AND ( NUMERIC_PRECISION, NUMERIC_PRECISION_RADIX,
NUMERIC_SCALE, DATETIME_PRECISION ) IS NULL
OR
DATA_TYPE IN ( 'REAL', 'DOUBLE PRECISION', 'FLOAT' )
AND ( CHARACTER_MAXIMUM_LENGTH, CHARACTER_OCTET_
LENGTH,
COLLATION_CATALOG, COLLATION_SCHEMA, COLLATION_
NAME )
IS NULL
AND NUMERIC_PRECISION IS NOT NULL
AND NUMERIC_PRECISION_RADIX = 2
AND NUMERIC_SCALE IS NULL
AND DATETIME_PRECISION IS NULL
OR
DATA_TYPE IN ( 'INTEGER', 'SMALLINT', 'NUMERIC',
'DECIMAL' )
AND ( CHARACTER_MAXIMUM_LENGTH, CHARACTER_OCTET_
LENGTH,
COLLATION_CATALOG, COLLATION_SCHEMA, COLLATION_
NAME )
IS NULL
AND NUMERIC_SCALE IS NOT NULL
AND ( NUMERIC_SCALE <> 0 AND NUMERIC_PRECISION_
RADIX = 10
OR
NUMERIC_SCALE = 0 AND NUMERIC_PRECISION_RADIX
IN ( 2, 10 ) )
AND DATETIME_PRECISION IS NULL
OR
DATA_TYPE IN ( 'DATE', 'TIME', 'TIMESTAMP',
'TIME WITH TIME ZONE', 'TIMESTAMP
WITH TIME ZONE',
'INTERVAL' )
AND ( CHARACTER_MAXIMUM_LENGTH,
CHARACTER_OCTET_LENGTH,
COLLATION_CATALOG, COLLATION_SCHEMA, COLLATION_
NAME )
IS NULL
AND ( NUMERIC_PRECISION, NUMERIC_PRECISION_RADIX )
IS NULL
AND NUMERIC_SCALE IS NULL
AND DATETIME_PRECISION IS NOT NULL
),
CONSTRAINT DATA_TYPE_DESCRIPTOR_PRIMARY_KEY
PRIMARY KEY ( TABLE_OR_DOMAIN_CATALOG, TABLE_OR_DOMAIN_
SCHEMA,
TABLE_OR_DOMAIN_NAME, COLUMN_NAME ),
CONSTRAINT DATA_TYPE_CHECK_REFERENCES_COLLATION
CHECK ( COLLATION_CATALOG
<> ANY ( SELECT CATALOG_NAME FROM SCHEMATA )
OR
( COLLATION_CATALOG, COLLATION_SCHEMA, COLLATION_
NAME ) IN
CONSTRAINT DATA_TYPE_DESCRIPTOR_CHECK_USED
CHECK ( (TABLE_OR_DOMAIN_CATALOG, TABLE_OR_DOMAIN_SCHEMA,
TABLE_OR_DOMAIN_NAME, COLUMN_NAME)
IN (
SELECT TABLE_CATALOG, TABLE_SCHEMA, TABLE_NAME, COLUMN_
NAME
FROM COLUMNS
UNION
SELECT DOMAIN_CATALOG, DOMAIN_SCHEMA, DOMAIN_NAME, ''
FROM DOMAINS )
)
)
Description
2) Case:
Function
The DOMAINS table has one row for each domain. It effectively con-
tains a representation of the domain descriptors.
Definition
CONSTRAINT DOMAINS_PRIMARY_KEY
PRIMARY KEY ( DOMAIN_CATALOG, DOMAIN_SCHEMA, DOMAIN_NAME ),
CONSTRAINT DOMAINS_FOREIGN_KEY_SCHEMATA
FOREIGN KEY ( DOMAIN_CATALOG, DOMAIN_SCHEMA ) REFERENCES SCHEMATA,
CONSTRAINT DOMAINS_CHECK_DATA_TYPE
CHECK ( DOMAIN_CATALOG
<> ANY ( SELECT CATALOG_NAME FROM SCHEMATA )
OR
( DOMAIN_CATALOG, DOMAIN_SCHEMA, DOMAIN_NAME, '' ) IN
Description
Function
The DOMAIN_CONSTRAINTS table has one row for each domain constraint
associated with a domain. It effectively contains a representation
of the domain constraint descriptors.
Definition
INITIALLY_DEFERRED INFORMATION_SCHEMA.CHARACTER_DATA
CONSTRAINT DOMAIN_CONSTRAINTS_INITIALLY_DEFERRED_NOT_NULL
NOT NULL,
CONSTRAINT DOMAIN_CONSTRAINTS_PRIMARY_KEY
PRIMARY KEY ( CONSTRAINT_CATALOG, CONSTRAINT_SCHEMA, CONSTRAINT_
NAME ),
CONSTRAINT DOMAIN_CONSTRAINTS_FOREIGN_KEY_SCHEMATA
FOREIGN KEY ( CONSTRAINT_CATALOG, CONSTRAINT_SCHEMA )
REFERENCES SCHEMATA,
CONSTRAINT DOMAIN_CONSTRAINTS_FOREIGN_KEY_CHECK_CONSTRAINTS
FOREIGN KEY ( DOMAIN_CATALOG, DOMAIN_SCHEMA, CONSTRAINT_
NAME )
REFERENCES CHECK_CONSTRAINTS,
CONSTRAINT DOMAIN_CONSTRAINTS_FOREIGN_KEY_DOMAINS
FOREIGN KEY ( DOMAIN_CATALOG, DOMAIN_SCHEMA, DOMAIN_NAME )
REFERENCES DOMAINS,
CONSTRAINT DOMAIN_CONSTRAINTS_CHECK_DEFERRABLE
CHECK ( ( IS_DEFERRABLE, INITIALLY_DEFERRED ) IN
( VALUES ( 'NO', 'NO' ),
( 'YES', 'NO' ),
( 'YES', 'YES' ) ) )
)
Description
Function
The TABLES table contains one row for each table including views.
It effectively contains a representation of the table descriptors.
Definition
CONSTRAINT CHECK_TABLE_IN_COLUMNS
CHECK ( ( TABLE_CATALOG, TABLE_SCHEMA, TABLE_NAME ) IN
( SELECT TABLE_CATALOG, TABLE_SCHEMA, TABLE_NAME
FROM COLUMNS ) ),
CONSTRAINT TABLES_PRIMARY_KEY
PRIMARY KEY ( TABLE_CATALOG, TABLE_SCHEMA, TABLE_NAME ),
CONSTRAINT TABLES_FOREIGN_KEY_SCHEMATA
FOREIGN KEY ( TABLE_CATALOG, TABLE_SCHEMA )
REFERENCES SCHEMATA,
Description
Function
The VIEWS table contains one row for each row in the TABLES ta-
ble with a TABLE_TYPE of 'VIEW'. Each row describes the query
expression that defines a view. The table effectively contains a
representation of the view descriptors.
Definition
IS_UPDATABLE INFORMATION_SCHEMA.CHARACTER_DATA
CONSTRAINT IS_UPDATABLE_NOT_NULL NOT NULL
CONSTRAINT IS_UPDATABLE_CHECK
CHECK ( IS_UPDATABLE IN ( 'YES', 'NO' ) ),
CONSTRAINT VIEWS_PRIMARY_KEY
PRIMARY KEY ( TABLE_CATALOG, TABLE_SCHEMA, TABLE_NAME ),
CONSTRAINT VIEWS_IN_TABLES_CHECK
CHECK ( ( TABLE_CATALOG, TABLE_SCHEMA, TABLE_NAME ) IN
( SELECT TABLE_CATALOG, TABLE_SCHEMA, TABLE_NAME
FROM TABLES
WHERE TABLE_TYPE = 'VIEW' ) ),
CONSTRAINT VIEWS_IS_UPDATABLE_CHECK_OPTION_CHECK
CHECK ( ( IS_UPDATABLE, CHECK_OPTION ) NOT IN
( VALUES ( 'NO', 'CASCADED' ), ( 'NO', 'LOCAL' ) ) )
)
Description
3) Case:
Function
The COLUMNS table has one row for each column. It effectively con-
tains a representation of the column descriptors.
Definition
CONSTRAINT COLUMNS_PRIMARY_KEY
PRIMARY KEY ( TABLE_CATALOG, TABLE_SCHEMA, TABLE_NAME, COLUMN_
NAME ),
CONSTRAINT COLUMNS_UNIQUE
UNIQUE ( TABLE_CATALOG, TABLE_SCHEMA, TABLE_NAME, ORDINAL_
POSITION ),
CONSTRAINT COLUMNS_FOREIGN_KEY_TABLES
FOREIGN KEY ( TABLE_CATALOG, TABLE_SCHEMA, TABLE_NAME )
REFERENCES TABLES,
CONSTRAINT COLUMNS_CHECK_REFERENCES_DOMAIN
CHECK ( DOMAIN_CATALOG
<> ANY ( SELECT CATALOG_NAME FROM SCHEMATA )
OR
( DOMAIN_CATALOG, DOMAIN_SCHEMA, DOMAIN_NAME ) IN
( SELECT DOMAIN_CATALOG, DOMAIN_SCHEMA, DOMAIN_NAME
FROM DOMAINS ) ),
CONSTRAINT COLUMNS_CHECK_DATA_TYPE
CHECK ( DOMAIN_CATALOG
<> ANY ( SELECT CATALOG_NAME FROM SCHEMATA )
OR
( ( DOMAIN_CATALOG, DOMAIN_SCHEMA, DOMAIN_NAME )
IS NOT NULL
AND
( TABLE_CATALOG, TABLE_SCHEMA, TABLE_NAME, COLUMN_
NAME ) NOT IN
Description
1) Case:
Function
The VIEW_TABLE_USAGE table has one row for each table referenced in
the <query expression> of a view.
Definition
CONSTRAINT VIEW_TABLE_USAGE_PRIMARY_KEY
PRIMARY KEY ( VIEW_CATALOG, VIEW_SCHEMA, VIEW_NAME,
TABLE_CATALOG, TABLE_SCHEMA, TABLE_NAME ),
CONSTRAINT VIEW_TABLE_USAGE_CHECK_REFERENCES_TABLES
CHECK ( TABLE_CATALOG
<> ANY ( SELECT CATALOG_NAME FROM SCHEMATA )
OR
( TABLE_CATALOG, TABLE_SCHEMA, TABLE_NAME ) IN
( SELECT TABLE_CATALOG, TABLE_SCHEMA, TABLE_NAME
FROM TABLES ) ),
CONSTRAINT VIEW_TABLE_USAGE_FOREIGN_KEY_VIEWS
FOREIGN KEY ( VIEW_CATALOG, VIEW_SCHEMA, VIEW_NAME )
REFERENCES VIEWS
)
Description
Function
The VIEW_COLUMN_USAGE table has one row for each column referenced
by a view.
Definition
CONSTRAINT VIEW_COLUMN_USAGE_PRIMARY_KEY
PRIMARY KEY ( VIEW_CATALOG, VIEW_SCHEMA, VIEW_NAME,
TABLE_CATALOG, TABLE_SCHEMA, TABLE_NAME, COLUMN_
NAME ),
CONSTRAINT VIEW_COLUMN_USAGE_CHECK_REFERENCES_COLUMNS
CHECK ( TABLE_CATALOG
<> ANY ( SELECT CATALOG_NAME FROM SCHEMATA )
OR
( TABLE_CATALOG, TABLE_SCHEMA, TABLE_NAME, COLUMN_
NAME ) IN
( SELECT TABLE_CATALOG, TABLE_SCHEMA, TABLE_
NAME, COLUMN_NAME
FROM COLUMNS ) ),
CONSTRAINT VIEW_COLUMN_USAGE_FOREIGN_KEY_VIEWS
FOREIGN KEY ( VIEW_CATALOG, VIEW_SCHEMA, VIEW_NAME )
REFERENCES VIEWS
)
Description
Function
The TABLE_CONSTRAINTS table has one row for each table constraint
associated with a table. It effectively contains a representation
of the table constraint descriptors.
Definition
TABLE_CATALOG INFORMATION_SCHEMA.SQL_IDENTIFIER
CONSTRAINT TABLE_CONSTRAINTS_TABLE_CATALOG_NOT_NULL NOT NULL,
TABLE_SCHEMA INFORMATION_SCHEMA.SQL_IDENTIFIER
CONSTRAINT TABLE_CONSTRAINTS_TABLE_SCHEMA_NOT_NULL NOT NULL,
TABLE_NAME INFORMATION_SCHEMA.SQL_IDENTIFIER
CONSTRAINT TABLE_CONSTRAINTS_TABLE_NAME_NOT_NULL NOT NULL,
IS_DEFERRABLE INFORMATION_SCHEMA.CHARACTER_DATA
CONSTRAINT TABLE_CONSTRAINTS_IS_DEFERRABLE_NOT_NULL NOT NULL,
INITIALLY_DEFERRED INFORMATION_SCHEMA.CHARACTER_DATA
CONSTRAINT TABLE_CONSTRAINTS_INITIALLY_DEFERRED_NOT_
NULL NOT NULL,
CONSTRAINT TABLE_CONSTRAINTS_PRIMARY_KEY
PRIMARY KEY ( CONSTRAINT_CATALOG, CONSTRAINT_SCHEMA, CONSTRAINT_
NAME ),
CONSTRAINT TABLE_CONSTRAINTS_CHECK_REFERENCES_TABLES
CHECK ( TABLE_CATALOG
<> ANY ( SELECT CATALOG_NAME FROM SCHEMATA )
OR
( TABLE_CATALOG, TABLE_SCHEMA, TABLE_NAME ) IN
( SELECT TABLE_CATALOG, TABLE_SCHEMA, TABLE_NAME
FROM TABLES ) ),
CONSTRAINT TABLE_CONSTRAINTS_DEFERRED_CHECK
CHECK ( ( IS_DEFERRABLE, INITIALLY_DEFERRED ) IN
CONSTRAINT TABLE_CONSTRAINTS_CHECK_VIEWS
CHECK ( TABLE_CATALOG
<> ANY ( SELECT CATALOG_NAME FROM SCHEMATA )
OR
( ( TABLE_CATALOG, TABLE_SCHEMA, TABLE_NAME ) IN
( SELECT TABLE_CATALOG, TABLE_SCHEMA, TABLE_NAME
FROM TABLES
WHERE TABLE_TYPE <> 'VIEW' ) ),
CONSTRAINT TABLE_CONSTRAINTS_UNIQUE_CHECK
CHECK ( 1 =
( SELECT COUNT (*)
FROM ( SELECT CONSTRAINT_CATALOG, CONSTRAINT_SCHEMA,
CONSTRAINT_
NAME
FROM TABLE_CONSTRAINTS
WHERE CONSTRAINT_TYPE IN
( 'UNIQUE', 'PRIMARY KEY' )
UNION ALL
SELECT CONSTRAINT_CATALOG, CONSTRAINT_SCHEMA, CONSTRAINT_
NAME
FROM REFERENTIAL_CONSTRAINTS
UNION ALL
SELECT CONSTRAINT_CATALOG, CONSTRAINT_SCHEMA, CONSTRAINT_
NAME
FROM CHECK_CONSTRAINTS ) AS X
WHERE ( CONSTRAINT_CATALOG, CONSTRAINT_SCHEMA, CONSTRAINT_
NAME )
= ( X.CONSTRAINT_CATALOG, X.CONSTRAINT_SCHEMA,
X.CONSTRAINT_
NAME )
) ),
CONSTRAINT UNIQUE_TABLE_PRIMARY_KEY_CHECK
CHECK ( UNIQUE ( SELECT TABLE_CATALOG, TABLE_SCHEMA, TABLE_
NAME
FROM TABLE_CONSTRAINTS
WHERE CONSTRAINT_TYPE = 'PRIMARY KEY' ) )
)
Description
Function
The KEY_COLUMN_USAGE table has one or more rows for each row in
the TABLE_CONSTRAINTS table that has a CONSTRAINT_TYPE of "UNIQUE",
"PRIMARY KEY", or "FOREIGN KEY". The rows list the columns that
constitute each unique constraint, and the referencing columns in
each foreign key constraint.
Definition
CONSTRAINT KEY_COLUMN_USAGE_PRIMARY_KEY
PRIMARY KEY ( CONSTRAINT_CATALOG, CONSTRAINT_SCHEMA, CONSTRAINT_
NAME,
COLUMN_NAME ),
CONSTRAINT KEY_COLUMN_USAGE_UNIQUE
UNIQUE ( CONSTRAINT_CATALOG, CONSTRAINT_SCHEMA,
CONSTRAINT_NAME, ORDINAL_POSITION ),
CONSTRAINT KEY_COLUMN_USAGE_FOREIGN_KEY_COLUMNS
FOREIGN KEY ( TABLE_CATALOG, TABLE_SCHEMA, TABLE_NAME, COLUMN_
NAME )
REFERENCES COLUMNS,
CONSTRAINT KEY_COLUMN_CONSTRAINT_TYPE_CHECK
CHECK ( ( CONSTRAINT_CATALOG, CONSTRAINT_SCHEMA, CONSTRAINT_
NAME )
IN ( SELECT CONSTRAINT_CATALOG, CONSTRAINT_SCHEMA,
CONSTRAINT_
NAME
FROM TABLE_CONSTRAINTS
WHERE CONSTRAINT_TYPE IN
( 'UNIQUE', 'PRIMARY KEY', 'FOREIGN KEY' ) ) )
Description
Function
Definition
CONSTRAINT REFERENTIAL_CONSTRAINTS_PRIMARY_KEY
PRIMARY KEY ( CONSTRAINT_CATALOG, CONSTRAINT_SCHEMA, CONSTRAINT_
NAME ),
CONSTRAINT REFERENTIAL_CONSTRAINTS_CONSTRAINT_TYPE_CHECK
CHECK ( ( CONSTRAINT_CATALOG, CONSTRAINT_SCHEMA, CONSTRAINT_
NAME )
CONSTRAINT UNIQUE_CONSTRAINT_CHECK_REFERENCES_UNIQUE_
CONSTRAINT
CHECK ( TABLE_CATALOG <> ANY ( SELECT CATALOG_NAME FROM SCHEMATA )
OR
( ( UNIQUE_CONSTRAINT_CATALOG, UNIQUE_CONSTRAINT_
SCHEMA,
UNIQUE_CONSTRAINT_NAME ) IN
( SELECT CONSTRAINT_CATALOG, CONSTRAINT_
SCHEMA, CONSTRAINT_NAME
FROM TABLE_CONSTRAINTS
WHERE CONSTRAINT_TYPE
IN ( 'UNIQUE', 'PRIMARY KEY' ) ) ) )
)
Description
Function
The CHECK_CONSTRAINTS table has one row for each domain constraint,
table check constraint, and assertion.
Definition
CONSTRAINT CHECK_CONSTRAINTS_PRIMARY_KEY
PRIMARY KEY ( CONSTRAINT_CATALOG, CONSTRAINT_SCHEMA, CONSTRAINT_
NAME ),
CONSTRAINT CHECK_CONSTRAINTS_SOURCE_CHECK
CHECK ( ( CONSTRAINT_CATALOG, CONSTRAINT_SCHEMA, CONSTRAINT_
NAME )
IN
( SELECT * FROM (
SELECT CONSTRAINT_CATALOG, CONSTRAINT_SCHEMA, CONSTRAINT_
NAME
FROM ASSERTIONS
UNION
SELECT CONSTRAINT_CATALOG, CONSTRAINT_SCHEMA, CONSTRAINT_
NAME
FROM TABLE_CONSTRAINTS
UNION
SELECT CONSTRAINT_CATALOG, CONSTRAINT_SCHEMA, CONSTRAINT_
NAME
FROM DOMAIN_CONSTRAINTS ) ) )
)
Description
2) Case:
Function
The CHECK_TABLE_USAGE table has one row for each table referenced
by the <search condition> of a check constraint, domain constraint,
or assertion.
Definition
CONSTRAINT CHECK_TABLE_USAGE_PRIMARY_KEY
PRIMARY KEY ( CONSTRAINT_CATALOG, CONSTRAINT_SCHEMA, CONSTRAINT_
NAME,
TABLE_CATALOG, TABLE_SCHEMA, TABLE_NAME ),
CONSTRAINT CHECK_TABLE_USAGE_FOREIGN_KEY_CHECK_CONSTRAINTS
FOREIGN KEY ( CONSTRAINT_CATALOG, CONSTRAINT_SCHEMA, CONSTRAINT_
NAME )
REFERENCES CHECK_CONSTRAINTS,
CONSTRAINT CHECK_TABLE_USAGE_CHECK_REFERENCES_TABLES
CHECK ( TABLE_CATALOG
<> ANY ( SELECT CATALOG_NAME FROM SCHEMATA )
OR
( TABLE_CATALOG, TABLE_SCHEMA, TABLE_NAME ) IN
( SELECT TABLE_CATALOG, TABLE_SCHEMA, TABLE_NAME
FROM TABLES ) )
)
Description
Function
The CHECK_COLUMN_USAGE table has one row for each column referenced
by the <search condition> of a check constraint, domain constraint,
or assertion.
Definition
CONSTRAINT CHECK_COLUMN_USAGE_PRIMARY_KEY
PRIMARY KEY ( CONSTRAINT_CATALOG, CONSTRAINT_SCHEMA, CONSTRAINT_
NAME,
TABLE_CATALOG, TABLE_SCHEMA, TABLE_NAME, COLUMN_
NAME ),
CONSTRAINT CHECK_COLUMN_USAGE_FOREIGN_KEY_CHECK_CONSTRAINTS
FOREIGN KEY ( CONSTRAINT_CATALOG, CONSTRAINT_SCHEMA, CONSTRAINT_
NAME )
REFERENCES CHECK_CONSTRAINTS,
CONSTRAINT CHECK_COLUMN_USAGE_CHECK_REFERENCES_COLUMNS
CHECK ( TABLE_CATALOG
<> ANY ( SELECT CATALOG_NAME FROM SCHEMATA )
OR
( TABLE_CATALOG, TABLE_SCHEMA, TABLE_NAME, COLUMN_
NAME ) IN
( SELECT TABLE_CATALOG, TABLE_SCHEMA, TABLE_
NAME, COLUMN_NAME
FROM COLUMNS ) )
)
Description
Function
The ASSERTIONS table has one row for each assertion. It effectively
contains a representation of the assertion descriptors.
Definition
CONSTRAINT ASSERTIONS_PRIMARY_KEY
PRIMARY KEY ( CONSTRAINT_CATALOG, CONSTRAINT_SCHEMA, CONSTRAINT_
NAME ),
CONSTRAINT ASSERTIONS_FOREIGN_KEY_CHECK_CONSTRAINTS
FOREIGN KEY (CONSTRAINT_CATALOG, CONSTRAINT_SCHEMA, CONSTRAINT_
NAME )
REFERENCES CHECK_CONSTRAINTS,
CONSTRAINT ASSERTIONS_FOREIGN_KEY_SCHEMATA
FOREIGN KEY ( CONSTRAINT_CATALOG, CONSTRAINT_SCHEMA )
REFERENCES SCHEMATA,
CONSTRAINT ASSERTIONS_DEFERRED_CHECK
CHECK ( ( IS_DEFERRABLE, INITIALLY_DEFERRED ) IN
VALUES ( ( 'NO', 'NO' ),
( 'YES', 'NO' ),
( 'YES', 'YES' ) ) )
)
Description
Function
The TABLE_PRIVILEGES table has one row for each table privilege
descriptor. It effectively contains a representation of the table
privilege descriptors.
Definition
CONSTRAINT TABLE_PRIVILEGES_PRIMARY_KEY
PRIMARY KEY ( GRANTOR, GRANTEE, TABLE_CATALOG, TABLE_
SCHEMA, TABLE_NAME,
PRIVILEGE_TYPE ),
CONSTRAINT TABLE_PRIVILEGES_FOREIGN_KEY_TABLES
FOREIGN KEY ( TABLE_CATALOG, TABLE_SCHEMA, TABLE_NAME )
REFERENCES TABLES,
CONSTRAINT TABLE_PRIVILEGES_GRANTOR_FOREIGN_KEY_USERS
FOREIGN KEY ( GRANTOR )
REFERENCES USERS,
CONSTRAINT TABLE_PRIVILEGES_GRANTEE_FOREIGN_KEY_USERS
FOREIGN KEY ( GRANTEE )
REFERENCES USERS
)
Description
Function
The COLUMN_PRIVILEGES table has one row for each column privilege
descriptor. It effectively contains a representation of the column
privilege descriptors.
Definition
CONSTRAINT COLUMN_PRIVILEGES_IS_GRANTABLE_CHECK
CHECK ( IS_GRANTABLE IN ( 'YES', 'NO' ) ),
CONSTRAINT COLUMN_PRIVILEGES_PRIMARY_KEY
PRIMARY KEY
( GRANTOR, GRANTEE, TABLE_CATALOG, TABLE_SCHEMA, TABLE_
NAME,
PRIVILEGE_TYPE, COLUMN_NAME ),
CONSTRAINT COLUMN_PRIVILEGES_FOREIGN_KEY_COLUMNS
FOREIGN KEY ( TABLE_CATALOG, TABLE_SCHEMA, TABLE_NAME, COLUMN_
NAME )
REFERENCES COLUMNS,
CONSTRAINT COLUMN_PRIVILEGES_GRANTOR_FOREIGN_KEY_USERS
FOREIGN KEY ( GRANTOR )
REFERENCES USERS,
CONSTRAINT COLUMN_PRIVILEGES_GRANTEE_FOREIGN_KEY_USERS
FOREIGN KEY ( GRANTEE )
REFERENCES USERS
)
602 Database Language SQL
X3H2-92-154/DBL CBR-002
21.3 Definition Schema
Description
Function
The USAGE_PRIVILEGES table has one row for each usage privilege
descriptor. It effectively contains a representation of the usage
privilege descriptors.
Definition
IS_GRANTABLE INFORMATION_SCHEMA.CHARACTER_DATA
CONSTRAINT USAGE_PRIVILEGES_IS_GRANTABLE_NOT_NULL NOT NULL
CONSTRAINT USAGE_PRIVILEGES_IS_GRANTABLE_CHECK
CHECK ( IS_GRANTABLE IN ( 'YES', 'NO' ) ),
CONSTRAINT USAGE_PRIVILEGES_PRIMARY_KEY
PRIMARY KEY ( GRANTOR, GRANTEE, OBJECT_CATALOG, OBJECT_
SCHEMA,
OBJECT_NAME, OBJECT_TYPE ),
CONSTRAINT USAGE_PRIVILEGES_CHECK_REFERENCES_OBJECT
CHECK ( ( OBJECT_CATALOG, OBJECT_SCHEMA, OBJECT_NAME, OBJECT_
TYPE ) IN
( SELECT DOMAIN_CATALOG, DOMAIN_SCHEMA, DOMAIN_NAME,'DOMAIN'
FROM DOMAINS
UNION
SELECT CHARACTER_SET_CATALOG, CHARACTER_SET_SCHEMA, CHARACTER_
SET_NAME,
'CHARACTER SET'
FROM CHARACTER_SETS
UNION
SELECT COLLATION_CATALOG, COLLATION_SCHEMA, COLLATION_
NAME, 'COLLATION'
FROM COLLATIONS
UNION
SELECT TRANSLATION_CATALOG, TRANSLATION_SCHEMA, TRANSLATION_
NAME,
'TRANSLATION'
FROM TRANSLATIONS ) ),
CONSTRAINT USAGE_PRIVILEGES_GRANTOR_FOREIGN_KEY_USERS
FOREIGN KEY ( GRANTOR )
REFERENCES USERS,
CONSTRAINT USAGE_PRIVILEGES_GRANTEE_FOREIGN_KEY_USERS
FOREIGN KEY ( GRANTEE )
REFERENCES USERS
)
Description
Function
The CHARACTER_SETS table has one row for each character set de-
scriptor.
Definition
CHARACTER_SET_SCHEMA INFORMATION_SCHEMA.SQL_IDENTIFIER,
CHARACTER_SET_NAME INFORMATION_SCHEMA.SQL_IDENTIFIER,
FORM_OF_USE INFORMATION_SCHEMA.SQL_IDENTIFIER,
NUMBER_OF_CHARACTERS INFORMATION_SCHEMA.CARDINAL_
NUMBER,
DEFAULT_COLLATE_CATALOG INFORMATION_SCHEMA.SQL_IDENTIFIER
CONSTRAINT CHARACTER_SETS_DEFAULT_COLLATE_CATALOG_NOT_
NULL NOT NULL,
DEFAULT_COLLATE_SCHEMA INFORMATION_SCHEMA.SQL_IDENTIFIER
CONSTRAINT CHARACTER_SETS_DEFAULT_COLLATE_SCHEMA_NOT_
NULL NOT NULL,
DEFAULT_COLLATE_NAME INFORMATION_SCHEMA.SQL_IDENTIFIER
CONSTRAINT CHARACTER_SETS_DEFAULT_COLLATE_NAME_NOT_
NULL NOT NULL,
CONSTRAINT CHARACTER_SETS_PRIMARY_KEY
PRIMARY KEY ( CHARACTER_SET_CATALOG, CHARACTER_SET_
SCHEMA, CHARACTER_SET_NAME ),
CONSTRAINT CHARACTER_SETS_FOREIGN_KEY_SCHEMATA
FOREIGN KEY ( CHARACTER_SET_CATALOG, CHARACTER_SET_SCHEMA )
REFERENCES SCHEMATA,
CONSTRAINT CHARACTER_SETS_CHECK_REFERENCES_COLLATIONS
CHECK ( CHARACTER_SET_CATALOG
<> ANY ( SELECT CATALOG_NAME FROM SCHEMATA )
OR
( DEFAULT_COLLATE_CATALOG, DEFAULT_COLLATE_SCHEMA,
DEFAULT_COLLATE_NAME ) IN
( SELECT COLLATION_CATALOG, COLLATION_
SCHEMA, COLLATION_NAME
FROM COLLATIONS ) )
)
Description
4) Case:
b) FORM_OF_USE is implementation-defined.
c) NUMBER_OF_CHARACTERS is implementation-defined.
Function
The COLLATIONS table has one row for each character collation de-
scriptor.
Definition
CHARACTER_SET_SCHEMA INFORMATION_SCHEMA.SQL_IDENTIFIER
CONSTRAINT COLLATIONS_CHARACTER_SET_SCHEMA_NOT_NULL NOT NULL,
CHARACTER_SET_NAME INFORMATION_SCHEMA.SQL_IDENTIFIER
CONSTRAINT COLLATIONS_CHARACTER_SET_NAME_NOT_NULL NOT NULL,
PAD_ATTRIBUTE INFORMATION_SCHEMA.CHARACTER_DATA
CONSTRAINT COLLATIONS_PAD_ATTRIBUTE_CHECK
CHECK ( PAD_ATTRIBUTE IN ( 'NO PAD', 'PAD SPACE' ) ),
CONSTRAINT COLLATIONS_PRIMARY_KEY
PRIMARY KEY ( COLLATION_CATALOG, COLLATION_SCHEMA, COLLATION_
NAME ),
CONSTRAINT COLLATIONS_FOREIGN_KEY_SCHEMATA
FOREIGN KEY ( COLLATION_CATALOG, COLLATION_SCHEMA )
REFERENCES SCHEMATA,
CONSTRAINT COLLATIONS_CHECK_REFERENCES_CHARACTER_SETS
CHECK ( COLLATION_CATALOG
<> ANY ( SELECT CATALOG_NAME FROM SCHEMATA )
OR
( CHARACTER_SET_CATALOG, CHARACTER_SET_SCHEMA, CHARACTER_
SET_NAME )
IN
( SELECT CHARACTER_SET_CATALOG, CHARACTER_
SET_SCHEMA,
CHARACTER_SET_NAME
FROM CHARACTER_SETS ) )
)
608 Database Language SQL
X3H2-92-154/DBL CBR-002
21.3 Definition Schema
Description
PAD SPACE The collation being described has the PAD SPACE
attribute.
c) PAD_ATTRIBUTE is implementation-defined.
Information Schema and Definition Schema 609
X3H2-92-154/DBL CBR-002
21.3 Definition Schema
Function
The TRANSLATIONS table has one row for each character translation
descriptor.
Definition
CONSTRAINT TRANSLATIONS_PRIMARY_KEY
PRIMARY KEY ( TRANSLATION_CATALOG, TRANSLATION_SCHEMA, TRANSLATION_
NAME ),
CONSTRAINT TRANSLATIONS_FOREIGN_KEY_SCHEMATA
FOREIGN KEY ( TRANSLATION_CATALOG, TRANSLATION_SCHEMA )
REFERENCES SCHEMATA,
CONSTRAINT TRANSLATIONS_CHECK_REFERENCES_SOURCE
CHECK ( SOURCE_CHARACTER_SET_CATALOG
<> ANY ( SELECT CATALOG_NAME FROM SCHEMATA )
OR
( SOURCE_CHARACTER_SET_CATALOG, SOURCE_CHARACTER_
SET_SCHEMA,
SOURCE_CHARACTER_SET_NAME ) IN
( SELECT CHARACTER_SET_CATALOG, CHARACTER_SET_
SCHEMA,
CHARACTER_SET_NAME
FROM CHARACTER_SETS ) ),
CONSTRAINT TRANSLATIONS_CHECK_REFERENCES_TARGET
CHECK ( TARGET_CHARACTER_SET_CATALOG
<> ANY ( SELECT CATALOG_NAME FROM SCHEMATA )
OR
( TARGET_CHARACTER_SET_CATALOG, TARGET_CHARACTER_
SET_SCHEMA,
TARGET_CHARACTER_SET_NAME ) IN
( SELECT CHARACTER_SET_CATALOG, CHARACTER_SET_
SCHEMA,
CHARACTER_SET_NAME
FROM CHARACTER_SETS ) )
)
Description
Function
The SQL_LANGUAGES table has one row for each ISO and implementation-
defined SQL language binding and programming language for which
conformance is claimed.
Definition
CONSTRAINT SQL_LANGUAGES_STANDARD_VALID_CHECK
CHECK ( ( SQL_LANGUAGE_SOURCE = 'ISO 9075' AND
SQL_LANGUAGE_YEAR IS NOT NULL AND
SQL_LANGUAGE_CONFORMANCE IS NOT NULL AND
SQL_LANGUAGE_IMPLEMENTATION IS NULL AND
( ( SQL_LANGUAGE_YEAR = '1987' AND
SQL_LANGUAGE_CONFORMANCE IN ( '1', '2' ) AND
SQL_LANGUAGE_INTEGRITY IS NULL AND
( ( SQL_LANGUAGE_BINDING_STYLE = 'DIRECT' AND
SQL_LANGUAGE_PROGRAMMING_LANGUAGE
IS NULL )
OR
( SQL_LANGUAGE_BINDING_STYLE IN ( 'EMBEDDED',
'MODULE' )
AND
SQL_LANGUAGE_PROGRAMMING_LANGUAGE IN
( 'COBOL', 'FORTRAN', 'PASCAL', 'PLI' ) ) ) )
OR
( SQL_LANGUAGE_YEAR = '1989' AND AND
SQL_LANGUAGE_CONFORMANCE IN ( '1', '2' ) AND
SQL_LANGUAGE_INTEGRITY IN ( 'NO', 'YES' ) AND
SQL_LANGUAGE_PROGRAMMING_LANGUAGE
IS NULL )
OR
( SQL_LANGUAGE_BINDING_STYLE IN ( 'EMBEDDED',
'MODULE' )
AND
SQL_LANGUAGE_PROGRAMMING_LANGUAGE IN
( 'COBOL', 'FORTRAN', 'PASCAL', 'PLI' ) ) ) )
OR
( SQL_LANGUAGE_YEAR = '1992' AND
SQL_LANGUAGE_CONFORMANCE IN
( 'ENTRY', 'INTERMEDIATE', 'FULL' ) AND
SQL_LANGUAGE_INTEGRITY IS NULL AND
( ( SQL_LANGUAGE_BINDING = 'DIRECT' AND
SQL_LANGUAGE_PROGRAMMING_LANGUGE
IS NULL )
OR
( SQL_LANGUAGE_BINDING IN ( 'EMBEDDED', 'MODULE' )
AND
SQL_LANGUAGE_PROGRAMMING_LANGUAGE IN
( 'ADA', 'C', 'COBOL',
'FORTRAN', 'MUMPS', 'PASCAL', 'PLI' ) ) ) )
) )
OR
( SQL_LANGUAGE_SOURCE <> 'ISO 9075' )
)
)
Description
Case:
Function
Definition
Description
Function
Definition
Function
Definition
22 Status codes
22.1 SQLSTATE
Class values that begin with one of the <digit>s '0', '1', '2',
'3', or '4' or one of the <simple Latin upper case letter>s 'A',
'B', 'C', 'D', 'E', 'F', 'G', or 'H' are returned only for con-
ditions defined in this International Standard or in any other
International Standard. The class value 'HZ' is reserved for con-
ditions defined in ISO/IEC DIS 9579-2. Subclass values associated
with such classes that also begin with one of those 13 characters
are returned only for conditions defined in this International
Standard; subclass values associated with such classes that begin
with one of the <digit>s '5', '6', '7', '8', or '9' or one of the
<simple Latin upper case letter>s 'I', 'J', 'K', 'L', 'M', 'N',
'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', or 'Z' are
reserved for implementation-specified conditions and are called
implementation-defined subclasses.
Class values that begin with one of the <digit>s '5', '6', '7',
'8', or '9' or one of the <simple Latin upper case letter>s 'I',
'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V',
'W', 'X', 'Y', or 'Z' are reserved for implementation-specified
conditions and are called implementation-defined classes. All sub-
class values except '000', which means no subclass, associated with
such classes are reserved for implementation-specified conditions
and are called implementation-defined subclasses.
____________Table_23-SQLSTATE_class_and_subclass_values____________
_Condition__________________Class_Subcondition_______________Subclass
________Table_23-SQLSTATE_class_and_subclass_values_(Cont.)________
_Condition__________________Class_Subcondition_______________Subclass
________Table_23-SQLSTATE_class_and_subclass_values_(Cont.)________
_Condition__________________Class_Subcondition_______________Subclass
________Table_23-SQLSTATE_class_and_subclass_values_(Cont.)________
_Condition__________________Class_Subcondition_______________Subclass
________Table_23-SQLSTATE_class_and_subclass_values_(Cont.)________
_Condition__________________Class_Subcondition_______________Subclass
22.2 SQLCODE
______________________Table_24-SQLCODE_values______________________
_Value__Condition__________________________________________________
| 0 | successful completion |
| | |
| +100 | no data |
| | |
|_-n___|_exception_________________________________________________|
| | |
Note: SQLSTATE is the preferred status parameter. The SQLCODE sta-
tus parameter is a deprecated feature that is supported for compat-
ibility with earlier versions of this International Standard. See
Annex D, "Deprecated features".
624 Database Language SQL
X3H2-92-154/DBL CBR-002
23 Conformance
23.1 Introduction
a) Module (<module>)
b) C
c) COBOL
d) Fortran
Conformance 625
X3H2-92-154/DBL CBR-002
23.2 Claims of conformance
e) MUMPS
f) Pascal
g) PL/I
4) The definitions for all elements and actions that this Standard
specifies as implementation-defined.
- Syntax Only
- Syntax Only
- Catalog Lookup
Annex A
(informative)
a) The <key word> DISTINCT shall not be specified more than once
in a <query specification>, excluding any <subquery> of that
<query specification>.
(informative)
Implementation-defined elements
52)Subclause 6.1, "<data type>": For every <data type>, the limits
of the <data type> are implementation-defined.
132Subclause 19.9, "<embedded SQL PL/I program>": The PL/I data de-
scription clauses, in addition to the <PL/I type specification>
and the INITIAL clause, that may appear in a <PL/I variable
definition> are implementation-defined.
133Subclause 19.9, "<embedded SQL PL/I program>": If <character
set specification> is not specified when CHARACTER is specified,
then an implementation-defined <character set specification> is
implicit.
(informative)
Implementation-dependent elements
8) Subclause 4.1, "Data types": The null value for each data type
is implementation-dependent.
(informative)
Deprecated features
1) SQLCODE
Annex E
(informative)
- ABSOLUTE
- ACTION
- ADD
- ALLOCATE
- ALTER
- ARE
- ASSERTION
- AT
- BETWEEN
- BIT
- BIT_LENGTH
- BOTH
- CASCADE
- CASCADED
- CASE
- CAST
- CATALOG
- CHAR_LENGTH
- CHARACTER_LENGTH
- COALESCE
- COLLATE
- COLLATION
- COLUMN
- CONNECT
- CONNECTION
- CONSTRAINT
- CONSTRAINTS
- CONVERT
- CORRESPONDING
- CROSS
- CURRENT_DATE
- CURRENT_TIME
- CURRENT_TIMESTAMP
- CURRENT_USER
- DATE
- DAY
- DEALLOCATE
- DEFERRABLE
- DEFERRED
- DESCRIBE
- DESCRIPTOR
- DIAGNOSTICS
- DISCONNECT
- DOMAIN
- DROP
- ELSE
- END-EXEC
- EXCEPT
- EXCEPTION
- EXECUTE
- EXTERNAL
- EXTRACT
- FALSE
- FIRST
- FULL
- GET
- GLOBAL
- HOUR
- IDENTITY
- IMMEDIATE
- INITIALLY
- INNER
- INPUT
- INSENSITIVE
- INTERSECT
- INTERVAL
- ISOLATION
- JOIN
- LAST
- LEADING
- LEFT
- LEVEL
- LOCAL
- LOWER
- MATCH
- MINUTE
- MONTH
- NAMES
- NATIONAL
- NATURAL
- NCHAR
- NEXT
- NO
- NULLIF
- OCTET_LENGTH
- ONLY
- OUTER
- OUTPUT
- OVERLAPS
- PAD
- PARTIAL
- POSITION
- PREPARE
- PRESERVE
- PRIOR
- READ
- RELATIVE
- RESTRICT
- REVOKE
- RIGHT
- ROWS
- SCROLL
- SECOND
- SESSION
- SESSION_USER
- SIZE
- SPACE
- SQLSTATE
- SUBSTRING
- SYSTEM_USER
- TEMPORARY
- THEN
- TIME
- TIMESTAMP
- TIMEZONE_HOUR
- TIMEZONE_MINUTE
- TRAILING
- TRANSACTION
- TRANSLATE
- TRANSLATION
- TRIM
- TRUE
- UNKNOWN
- UPPER
- USAGE
- USING
- VALUE
- VARCHAR
- VARYING
- WHEN
- WRITE
- YEAR
- ZONE
Incompatibilities with ISO/IEC 9075:1989 683
684 Database Language SQL
X3H2-92-154/DBL CBR-002
Annex F
(informative)
. . . , 8 a completion condition is
!!, 8 raised, 10
|, 22, 27 ACTION, 84, 274, 276, 590,
::=, 7 591, 592, 678
<1987>, 16 <action>, 64, 245, 246,
<1989>, 16 329, 330, 332, 333, 338,
<1992>, 16, 17 632
< >, 7 <action list>, 245
[ ], 8 <actual identifier>, 98
{ }, 8 Ada, 3, 49, 61, 342, 344,
|, 8 352, 356, 357, 489, 490,
500, 502
Index 1
<Ada unqualified type <alter column definition>,
specification>, 500 266, 283, 286, 287, 288,
<Ada variable definition>, 645
490, 500, 501, 502, 639 <alter domain action>, 304
ADD, 84, 284, 291, 307, <alter domain statement>,
310, 678 52, 281, 304, 305, 306,
<add column definition>, 307, 308, 338, 368, 482,
283, 284, 285, 645 633
<add domain constraint <alter table action>, 283
definition>, 304, 307, <alter table statement>,
634 52, 262, 263, 265, 272,
Additional common elements, 274, 281, 283, 284, 286,
239 289, 291, 292, 338, 368,
<add table constraint 482, 645
definition>, 272, 283, ambiguous cursor name, 443,
291, 310, 586, 646, 665 462, 619
AFTER, 85 <ampersand>, 79, 80, 489,
ALIAS, 85 491
ALL, 84, 124, 126, 176, AND, 84, 211, 228, 229,
183, 184, 196, 197, 200, 230, 272, 538, 539, 542,
201, 202, 220, 245, 246, 543, 544, 545, 546, 547,
294, 300, 332, 338, 401, 548, 549, 550, 551, 552,
402, 403, 412, 586, 616, 553, 554, 555, 556, 557,
641, 672 558, 559, 561, 562, 570,
<all>, 220 571, 580, 581, 612, 613,
ALLOCATE, 84, 431, 465, 617, 618
482, 678 an exception condition is
<allocate cursor statement> raised, 10
, 49, 53, 55, 57, 58, ANSI/IEEE 770/X3.160, 517
59, 62, 104, 369, 447, ANSI/IEEE 770/X3.97, 517
449, 465, 466, 469, 476, ANSI/MDC X11.1, 515
477, 482, 635, 638 ANSI/MIL-STD-1815A, 3, 501
<allocate descriptor ANSI X3.135, xiii, xvi, 75,
statement>, 54, 60, 76, 85, 677, 678
62, 104, 369, 431, 482 ANSI X3.159, 505
ALTER, 84, 283, 286, 292, ANSI X3.198, 512
304, 310, 338, 482, 678 ANSI X3.23, 3, 509
<alter column action>, 286 ANSI X3.53, 3, 521
ANSI X3.9, 512
Index 3
ASSERTIONS_FOREIGN_KEY_ BETWEEN, 84, 211, 678
SCHEMATA, 598 <between predicate>, 205,
ASSERTIONS_INITIALLY_ 211, 444, 446
DEFERRED_NOT_NULL, 598 BIT, 19, 35, 84, 107, 109,
ASSERTIONS_IS_DEFERRABLE_ 351, 352, 356, 357, 358,
NOT_NULL, 598 359, 360, 361, 362, 363,
ASSERTIONS_PRIMARY_KEY, 598 364, 366, 425, 429, 440,
assignable, 5, 34, 35, 231 445, 500, 502, 505, 506,
<asterisk>, 79, 80, 124, 507, 510, 512, 513, 514,
157, 158, 168, 191, 512 517, 518, 519, 520, 522,
ASYNC, 85
AT, 84, 165, 166, 678 523, 570, 635, 639, 678
AUTHORIZATION, 84, 255, <bit>, 89, 90, 92
257, 341, 343, 420, 484, <bit concatenation>, 27,
535, 567, 644 160, 162, 163
<authorization identifier>, <bit factor>, 160, 162, 163
44, 46, 64, 65, 66, 72, <bit length expression>,
73, 98, 102, 103, 116, 128, 131, 630
245, 246, 255, 256, 258, <bit primary>, 160, 161,
260, 261, 283, 289, 290, 163
294, 297, 298, 300, 302, bit string, 26
Bit string comparison and
304, 309, 310, 312, 313, assignment, 27
316, 318, 321, 323, 326, bit string data type
328, 329, 330, 331, 332, descriptor, 26
333, 336, 341, 342, 348, <bit string literal>, 82,
397, 398, 407, 409, 420, 86, 89, 92, 93, 95, 97,
421, 487, 526, 568, 600, 266, 267, 629
601, 603, 605, 655, 657, Bit strings, 26
663, 669 <bit string type>, 107,
AVG, 84, 124, 125, 126, 659 109, 113, 453, 454, 630
bit string variable, 27
- B - <bit substring function>,
Backus Naur Form, 7 27, 133, 134, 137
Backus Normal Form, 7 <bit value expression>,
<1989 base>, 16 133, 134, 137, 160, 162,
base table, 45 163, 631
base table descriptor, 39 <bit value function>, 132,
BEFORE, 85 137, 630
BEGIN, 84, 490
661
Index 5
Catalogs, 45 <character factor>, 160,
CATALOG_NAME, 83, 480, 481, 161, 162
486, 487, 536, 538, 539, Characteristics of numbers,
541, 542, 543, 544, 545, 28
546, 547, 548, 549, 550, character not in repertoire
551, 552, 553, 554, 555, , 111, 620
556, 557, 558, 559, 561, <character primary>, 160,
562, 569, 571, 573, 580, 162
583, 584, 585, 586, 591, character repertoire, 5, 7,
595, 596, 606, 608, 610, 20, 21, 23, 24, 35, 46,
611 74, 85, 86, 92, 93, 100,
<C bit variable>, 504, 505, 109, 111, 129, 133, 134,
507, 639 136, 145, 160, 208, 237,
<C character variable>, 248, 249, 250, 266, 312,
504, 505, 506, 507, 664 315, 316, 506, 607, 660,
<C class modifier>, 504 669
<C derived variable>, 504, <character representation>,
507, 639, 651 88, 89, 92, 93, 95, 97,
CHAR, 84, 107, 108, 356, 216, 500, 501, 505, 506,
360, 361, 500, 501, 502, 508, 509, 520, 521, 629
517, 518, 519, 520, 522, <character set definition>,
664 52, 255, 257, 311, 312,
character, 5 323, 368, 482, 644, 646
CHARACTER, 19, 20, 21, 35, character set descriptor,
49, 84, 107, 108, 109, 21, 44, 250, 311, 312,
113, 248, 255, 259, 263, 318, 606
301, 311, 313, 329, 332, <character set name>, 44,
351, 352, 356, 357, 358, 93, 99, 103, 104, 105,
359, 360, 361, 362, 363, 108, 248, 249, 259, 302,
364, 365, 366, 367, 426, 311, 312, 313, 316, 321,
429, 440, 445, 447, 482, 329, 331, 333, 419, 452,
483, 500, 501, 504, 505, 454, 656, 657
506, 508, 509, 510, 512, <character set source>, 311
Index 7
CHARACTER_SETS_PRIMARY_KEY, <check constraint
606 definition>, 262, 264,
CHARACTER_SET_CATALOG, 83, 270, 271, 281, 282, 301,
426, 427, 428, 434, 436, 309, 593, 594, 633
439, 440, 441, 452, 454, Checking of constraints, 41
456, 457, 538, 539, 544, CHECK_CLAUSE, 551, 593, 594
554, 555, 556, 569, 604, CHECK_COLUMN_USAGE, 559,
606, 607, 608, 609, 610, 561, 596
611, 663 CHECK_COLUMN_USAGE base
CHARACTER_SET_NAME, 83, table, 596
354, 426, 427, 428, 434, CHECK_COLUMN_USAGE_CHECK_
436, 439, 440, 441, 452, REFERENCES_COLUMNS, 596
454, 456, 457, 538, 539, CHECK_COLUMN_USAGE_FOREIGN_
544, 554, 555, 556, 569, KEY_CHECK_CONSTRAINTS,
604, 606, 607, 608, 609, 596
CHECK_COLUMN_USAGE_PRIMARY_
610, 611, 663 KEY, 596
CHARACTER_SET_SCHEMA, 83, CHECK_CONSTRAINTS, 551,
426, 427, 428, 434, 436, 574, 586, 593, 594, 595,
439, 440, 441, 452, 454, 596, 598, 640
456, 457, 538, 539, 544, CHECK_CONSTRAINTS base
554, 555, 556, 569, 604, table, 593
606, 607, 608, 609, 610, CHECK_CONSTRAINTS view, 551
611, 663 CHECK_CONSTRAINTS_PRIMARY_
<char length expression>, KEY, 593
128, 130 CHECK_CONSTRAINTS_SOURCE_
CHAR_LENGTH, 84, 128, 679 CHECK, 593
CHECK, 40, 75, 84, 264, CHECK_OPTION, 356, 543,
281, 296, 297, 299, 325, 578, 579
389, 393, 395, 487, 537, CHECK_OPTION_CHECK, 578
565, 570, 571, 572, 573, CHECK_OPTION_NOT_NULL, 578
574, 576, 578, 579, 580, CHECK_TABLE_IN_COLUMNS, 576
CHECK_TABLE_USAGE, 595
583, 584, 585, 586, 587, CHECK_TABLE_USAGE base
588, 590, 591, 593, 595, table, 595
596, 598, 600, 602, 604, CHECK_TABLE_USAGE_CHECK_
606, 608, 610, 611, 612, REFERENCES_TABLES, 595
Index 9
<collate clause>, 21, 23, <collation definition>, 53,
24, 36, 37, 160, 161, 255, 257, 314, 315, 316,
163, 187, 188, 251, 262, 317, 331, 335, 368, 482,
263, 264, 265, 301, 302, 632, 634, 635, 637, 639,
303, 311, 331, 337, 372, 661
631, 632, 633 collation descriptor, 21,
Collating coercibility 44, 313, 315, 317, 318,
rules for dyadic 323, 608
operators, 24 <collation name>, 36, 37,
Collating coercibility 99, 103, 104, 251, 259,
rules for monadic 265, 302, 310, 314, 315,
operators, 24 316, 318, 329, 331, 333,
collating sequence, 6 335, 444, 452, 454, 629
<collating sequence COLLATIONS, 539, 545, 555,
definition>, 314, 315 572, 604, 606, 608, 640
Collating sequence usage COLLATIONS base table, 608
for comparisons, 25 <collation source>, 311,
collation, 6, 20, 21, 24, 312, 314, 315, 316
35, 36, 37, 44, 53, 64, COLLATIONS view, 555
65, 66, 87, 99, 103, COLLATIONS_CHARACTER_SET_
104, 251, 255, 256, 257, CATALOG_NOT_NULL, 608
258, 259, 263, 265, 301, COLLATIONS_CHARACTER_SET_
302, 310, 311, 312, 314, NAME_NOT_NULL, 608
315, 316, 317, 318, 319, COLLATIONS_CHARACTER_SET_
323, 329, 330, 331, 333, SCHEMA_NOT_NULL, 608
334, 335, 336, 337, 368, COLLATIONS_CHECK_
436, 444, 452, 454, 482, REFERENCES_CHARACTER_
483, 555, 572, 605, 607, SETS, 608
COLLATIONS_FOREIGN_KEY_
608, 609, 629, 632, 634, SCHEMATA, 608
635, 637, 639, 661, 665, COLLATIONS_PAD_ATTRIBUTE_
674 CHECK, 608
COLLATION, 84, 259, 311, COLLATIONS_PRIMARY_KEY, 608
314, 315, 316, 318, 329, COLLATION_CATALOG, 83, 427,
331, 332, 482, 679 434, 436, 438, 452, 454,
539, 544, 545, 555, 570,
571, 572, 604, 606, 608,
609
526, 671
Index 13
CONDITION_NUMBER, 83, 354, CONSTRAINT, 84, 292, 308,
479, 481, 485 338, 484, 536, 565, 568,
conformance, 9, 12, 16, 17, 569, 570, 571, 572, 573,
75, 76, 563, 612, 614, 574, 576, 578, 580, 583,
625, 626, 627 584, 585, 586, 588, 590,
Conformance, 625 591, 593, 595, 596, 598,
CONNECT, 84, 349, 407, 483, 600, 602, 604, 605, 606,
527, 679 608, 610, 611, 612, 679
CONNECTION, 84, 349, 410, <constraint attributes>,
484, 527, 679 252, 253, 262, 263, 270,
connection does not exist, 301, 309, 325, 633
349, 410, 412, 527, 620 <constraint check time>,
connection exception, 71, 252, 253
349, 408, 409, 410, 412, constraint mode, 40, 41,
527, 620 67, 74, 253, 270, 326,
connection failure, 71, 350, 401, 402, 528
410, 620 <constraint name>, 99, 103,
Connection management, 407 105, 252, 259, 270, 292,
<connection name>, 71, 99,
103, 104, 407, 408, 410, 302, 308, 309, 325, 326,
412, 488 328, 338, 401, 402, 586,
connection name in use, 616, 640, 670
408, 620 <constraint name
<connection object>, 410, definition>, 252, 253,
411, 412 262, 263, 265, 270, 271,
<connection target>, 407 301, 302, 309, 645, 665,
CONNECTION_NAME, 83, 352, 670
354, 480, 481, 488 <constraint name
<connect statement>, 54, definition> and
65, 70, 71, 72, 74, 349, <constraint attributes>,
369, 407, 408, 409, 483, 252
488, 527, 636, 655, 662, <constraint name list>,
669, 672 401, 402
consistent, 673 CONSTRAINTS, 84, 401, 403,
constraint, 45 679
Index 15
created local temporary CURRENT_USER, 70, 84, 114,
table, 37, 38, 39, 72, 115, 116, 117, 266, 267,
258, 260, 261, 275, 281, 268, 269, 282, 325, 375,
655, 668 530, 538, 539, 541, 542,
CROSS, 84, 180, 182, 679 543, 545, 546, 547, 548,
<cross join>, 180, 183, 549, 550, 551, 552, 553,
184, 631 554, 555, 556, 557, 558,
<C storage class>, 504 559, 561, 562, 641, 645,
CURRENT, 84, 384, 391, 412, 658, 679
472, 474, 476, 477 cursor, 49
<current date value CURSOR, 84, 371, 464, 465,
function>, 139 482, 483, 484
current SQL-connection, 71, <cursor name>, 62, 99, 103,
72, 408, 409, 410, 411, 341, 342, 371, 375, 377,
412, 413 381, 384, 391, 392, 443,
current SQL-session, 44, 462, 464, 467, 469, 471,
45, 72, 73, 93, 100, 472, 474, 475, 476, 477,
101, 103, 104, 115, 309, 492, 635, 636
401, 408, 409, 410, 411, cursor operation conflict,
415, 417, 419, 420, 421, 279, 385, 387, 392, 395,
422, 487, 526, 653, 654, 486, 622
656 Cursors, 49
<current timestamp value <cursor specification>, 62,
function>, 139 119, 371, 372, 373, 374,
<current time value 375, 377, 381, 384, 391,
function>, 139 442, 448, 449, 464, 465,
CURRENT_DATE, 70, 84, 139, 467, 469, 472, 474, 476,
153, 645, 669, 679 477, 635, 636, 638, 647
CURRENT_TIME, 84, 139, 645, cursor specification cannot
669, 679 be executed, 459, 621
CURRENT_TIMESTAMP, 84, 139, CURSOR_NAME, 83, 352, 354,
645, 669, 679 480, 481, 486, 487
Index 17
<datetime type>, 107, 108, <deallocate prepared
111, 113, 426, 453, 454, statement>, 50, 54,
630, 640 60, 61, 63, 369, 449,
<datetime value>, 91, 92, 483, 635, 637
95 DEC, 84, 108, 366, 515,
<datetime value expression> 516, 520
, 128, 129, 130, 155, DECIMAL, 19, 27, 34, 84,
156, 165, 166, 167, 168, 107, 108, 109, 110, 360,
169, 170, 642 361, 425, 426, 429, 440,
<datetime value function>, 516, 520, 522, 571, 657,
139, 140, 165, 266, 267, 658
268, 269, 282, 325, 375, DECLARE, 84, 371, 397, 464,
641 490, 520, 521
DATETIME_INTERVAL_CODE, 83, <declare cursor>, 46, 49,
426, 427, 434, 436, 439, 50, 53, 56, 57, 58, 60,
440, 441, 453, 454, 455, 341, 342, 371, 374, 375,
456, 457, 663 377, 381, 384, 391, 464,
DATETIME_INTERVAL_PRECISION 476, 477, 489, 492, 493,
, 83, 427, 434, 436, 495, 496, 647, 662, 665,
439, 440, 441, 453, 455, 668, 671, 673, 674, 675,
456, 457, 663 677
DATETIME_PRECISION, 539, declared local temporary
544, 570, 571, 572 table, 37, 39, 72, 101,
<date value>, 90, 91, 96 103, 245, 275, 281, 283,
DAY, 30, 31, 32, 33, 84, 294, 397, 398, 459, 486,
95, 112, 167, 238, 239, 487, 655
240, 430, 441, 445, 679 DEFAULT, 84, 173, 175, 255,
<days value>, 91, 94 266, 274, 278, 279, 288,
<day-time interval>, 91 306, 311, 312, 314, 316,
<day-time literal>, 91, 95
DEALLOCATE, 84, 342, 433, 349, 388, 391, 393, 407,
447, 449, 483, 526, 679 408, 410, 412, 527, 590,
<deallocate descriptor 591, 592, 642, 648, 663
statement>, 54, 60, 62, <default clause>, 35, 262,
342, 369, 433, 483, 526 266, 267, 268, 287, 301,
302, 305, 309
default collating sequence,
5
Index 19
<delete statement: dependent, 10, 13, 14, 15,
positioned>, 50, 53, 19, 37, 39, 40, 48, 49,
55, 57, 59, 279, 369, 50, 51, 64, 65, 66, 69,
384, 385, 387, 392, 395, 72, 74, 122, 140, 171,
472, 476, 483 174, 192, 197, 199, 200,
<delete statement: 208, 237, 270, 279, 289,
searched>, 53, 55, 56, 292, 296, 300, 302, 304,
58, 59, 119, 122, 369, 309, 335, 338, 342, 346,
384, 386, 387, 392, 403, 350, 351, 373, 379, 380,
442, 483, 484, 485, 525, 382, 383, 397, 400, 412,
673 435, 436, 440, 441, 448,
DELETE_RULE, 550, 590, 592 452, 454, 485, 493, 494,
<delimited identifier>, 76, 495, 526, 530, 531, 557,
82, 86, 87, 98, 533 558, 562, 607, 667, 668,
<delimited identifier body> 669, 670, 671, 672, 673,
, 82, 86, 87, 88, 100, 674, 677, 678
533, 629 dependent privilege
<delimited identifier part> descriptors still exist,
, 82, 86 338, 621
<delimiter token>, 82, 86, deprecated, 47, 75, 346,
629, 640 347, 356, 357, 358, 359,
depend, 12, 35, 41, 44, 59,
335, 336, 452 360, 361, 496, 502, 507,
dependency graph, 335 510, 514, 516, 519, 522,
dependend on, 292 624
Deprecated features, 675
DEPTH, 85
<derived column>, 122, 182,
191, 192, 195, 379, 452
<derived column list>, 118,
119, 120, 641
derived table, 37
<derived table>, 118, 119,
120, 178, 193, 200, 630,
631
derived table descriptor,
40
Index 21
<direct SQL data statement> domain, 15, 35, 36, 37, 40,
, 525, 528, 639, 652 43, 44, 45, 47, 52, 64,
<direct SQL statement>, 64, 65, 66, 75, 76, 98, 103,
67, 71, 73, 74, 93, 100, 105, 109, 115, 144, 145,
101, 349, 415, 417, 419, 154, 192, 236, 255, 256,
525, 526, 527, 528, 529, 257, 258, 262, 263, 264,
614, 625, 627, 640, 651, 265, 266, 267, 268, 281,
655, 656 282, 290, 301, 302, 303,
dirty read, 68 304, 305, 306, 307, 308,
DISCONNECT, 84, 355, 412, 309, 310, 318, 329, 330,
483, 679 331, 333, 334, 336, 337,
disconnect error, 413, 623 338, 368, 446, 482, 483,
<disconnect object>, 412
<disconnect statement>, 54, 533, 539, 540, 541, 562,
71, 369, 412, 413, 483, 564, 565, 569, 570, 572,
636, 672 573, 574, 575, 581, 593,
distinct, 5, 6, 7, 19, 20, 595, 596, 605, 633, 634,
22, 29, 38, 39, 183, 640, 644, 646
187, 273, 277, 278, 279, DOMAIN, 84, 258, 301, 304,
298, 373, 493, 494, 495, 309, 329, 338, 482, 564,
496, 531, 668, 670, 673, 565, 680
677 domain constraint, 40, 43
DISTINCT, 84, 124, 126, <domain constraint>, 35,
193, 194, 195, 208, 539, 115, 154, 301, 302, 307,
541, 544, 617, 630, 631, 564
670 domain constraint
division by zero, 158, 620 descriptor, 36, 40,
43, 302, 309, 337, 338
Domain constraints, 43
domain definition, 35
<domain definition>, 52,
109, 115, 255, 256, 257,
266, 281, 301, 302, 303,
310, 368, 483, 644, 646
Index 23
DROP, 84, 258, 259, 288, <drop translation
289, 290, 292, 294, 300, statement>, 53, 259,
306, 308, 309, 313, 318, 323, 324, 368, 483, 634,
323, 328, 338, 398, 483, 635, 637, 639
680 <drop view statement>, 52,
<drop assertion statement>, 258, 290, 300, 338, 368,
52, 259, 328, 338, 368, 483, 646
483, 634, 635, 637, 639 duplicate, 6, 7, 126, 181,
<drop behavior>, 258, 289, 194, 195, 201, 202, 223,
292, 294, 300, 309, 333 332, 619
<drop character set dyadic, 24, 157, 158, 161,
statement>, 52, 259, 443
313, 368, 483, 646 dyadic operator, 6, 24, 443
<drop collation statement>, DYNAMIC, 483
53, 259, 318, 319, 368, <dynamic close statement>,
483, 634, 635, 637, 639 50, 53, 55, 57, 58, 59,
<drop column default 62, 369, 471, 483
clause>, 286, 288, 645 <dynamic cursor name>, 99,
<drop column definition>, 104, 105, 467, 469, 471,
283, 289, 290, 645 472, 474, 475, 638, 640
<drop domain constraint <dynamic declare cursor>,
definition>, 304, 308, 49, 53, 56, 57, 58, 60,
634 62, 341, 343, 448, 464,
<drop domain default 467, 469, 471, 472, 474,
clause>, 304, 306, 634 476, 477, 489, 492, 494,
<drop domain statement>, 495, 638, 647, 651
52, 258, 309, 310, 338, <dynamic delete statement:
368, 483, 646 positioned>, 50, 53,
<drop schema statement>, 55, 57, 59, 60, 62, 369,
52, 258, 259, 368, 483, 472, 483
644 <dynamic fetch statement>,
<drop table constraint 50, 53, 55, 57, 58, 59,
definition>, 283, 292, 62, 369, 441, 451, 456,
293, 646 457, 469, 470, 483, 638,
<drop table statement>, 52, 663
258, 294, 295, 368, 398,
483, 644
- E -
EACH, 85
Index 25
embedded, 1, 2, 49, 51, <embedded SQL declare
52, 55, 56, 57, 58, 60, section>, 61, 489, 490,
61, 62, 63, 75, 79, 114, 491, 495, 496, 501, 505,
115, 116, 489, 490, 491, 509, 512, 515, 517, 521
492, 493, 494, 495, 496, <embedded SQL end declare>,
497, 498, 499, 500, 501, 61, 489, 490, 491, 495,
502, 504, 505, 506, 507, 517
508, 509, 510, 512, 513, <embedded SQL Fortran
514, 515, 516, 517, 518, program>, 61, 489, 491,
519, 520, 521, 522, 613, 493, 495, 496, 498, 512,
614, 625, 627, 639, 651, 513, 514
655, 661, 662, 663, 673, <embedded SQL host program>
674, 675, 678 , 61, 63, 489, 490, 491,
<embedded character set 492, 493, 496, 497, 499,
declaration>, 489, 490, 614, 625, 627, 673, 674,
492, 493, 495, 496, 651, 678
663 <embedded SQL MUMPS
<embedded exception declare>, 489, 490,
declaration>, 55, 489, 491, 495
495, 497, 498, 499 <embedded SQL MUMPS
Embedded SQL, 489 program>, 61, 489, 491,
<embedded SQL Ada program>, 493, 498, 515, 516
61, 489, 491, 493, 495, <embedded SQL Pascal
498, 500, 501, 502 program>, 61, 489, 491,
<embedded SQL begin 493, 495, 498, 517, 518,
declare>, 61, 489, 490, 519
491, 495, 517 <embedded SQL PL/I program>
<embedded SQL COBOL , 61, 489, 491, 493,
program>, 61, 489, 491, 495, 498, 520, 521, 522
493, 495, 498, 508, 509, <embedded SQL statement>,
510, 675 61, 115, 489, 490, 491,
<embedded SQL C program>, 492, 493, 495, 501, 505,
61, 489, 491, 493, 495, 509, 512, 515, 517, 521,
498, 504, 505, 506, 507 639, 651
Embedded syntax, 61
exception condition, 10
Index 27
Exceptions, 10 explicit, 8, 10, 15, 20,
EXEC, 84, 489, 491 23, 31, 35, 41, 44, 45,
EXECUTE, 84, 354, 459, 462, 50, 66, 67, 68, 69, 70,
483, 680 71, 72, 74, 86, 101,
<execute immediate 102, 104, 111, 125, 130,
statement>, 14, 44, 143, 152, 153, 174, 196,
45, 54, 59, 61, 63, 64, 197, 198, 202, 241, 242,
73, 93, 100, 101, 115, 253, 256, 258, 260, 270,
369, 415, 417, 419, 462, 272, 283, 284, 292, 294,
483, 653, 654, 656 296, 297, 300, 301, 302,
<execute statement>, 14, 304, 309, 311, 312, 313,
54, 59, 61, 64, 369, 315, 316, 318, 321, 323,
441, 447, 448, 455, 456, 325, 326, 328, 329, 333,
457, 459, 460, 483, 663 334, 335, 341, 348, 377,
<existing character set 379, 392, 400, 446, 447,
name>, 311, 312 469, 474, 488, 493, 579,
EXISTS, 84, 222, 271, 273,
303, 544, 576, 617, 618 584, 594, 629, 632, 654,
<exists predicate>, 191, 655, 656, 661, 662, 667
205, 222 Explicit, 23, 24, 25, 26,
35, 161, 187, 372
<explicit table>, 196, 197,
202, 632
explicit type conversion,
35
<exponent>, 90, 95
exposed, 118, 119
<extended cursor name>, 62,
99, 102, 104, 443, 462,
465, 466, 467, 629, 657
<extended statement name>,
62, 99, 102, 104, 447,
448, 465, 629, 657, 672
Extensions and options, 626
EXTERNAL, 84, 314, 320,
661, 680
<external collation>, 314,
317
Index 29
form-of-use conversion, 6, FROM, 84, 128, 130, 132,
20, 22, 103, 104, 133, 133, 134, 149, 151, 152,
134, 136, 137, 444, 630, 153, 154, 178, 180, 182,
657, 659 183, 184, 197, 198, 271,
<form-of-use conversion>, 272, 273, 276, 289, 294,
22, 132, 133, 136, 137, 300, 303, 310, 311, 313,
444, 630, 659 314, 318, 320, 323, 333,
<form-of-use conversion 362, 363, 364, 366, 377,
name>, 99, 103, 104, 380, 384, 386, 403, 407,
132, 133, 134, 136, 630, 408, 415, 417, 419, 420,
657 431, 442, 444, 445, 447,
FORM_OF_USE, 554, 606, 607, 465, 469, 472, 476, 485,
665 537, 538, 539, 541, 542,
FORTRAN, 83, 243, 359, 364, 543, 544, 545, 546, 547,
493, 612, 613, 614 548, 549, 550, 551, 552,
<Fortran host identifier>,
490, 512, 513 553, 554, 555, 556, 557,
<Fortran type specifica- 558, 559, 561, 562, 563,
tion>, 512, 513, 514, 571, 572, 573, 576, 578,
639, 651 580, 581, 583, 584, 585,
<Fortran variable 586, 588, 591, 593, 595,
definition>, 490, 512, 596, 604, 606, 608, 610,
513 611, 616, 617, 618, 647
FOUND, 84, 352, 497, 499 <from clause>, 118, 177,
Index 31
<group by clause>, 38, 118, - I -
177, 187, 189, 193, 203, identified privilege
296, 383, 631, 635, 643 descriptor, 335
grouped table, 38, 124, <identifier>, 44, 46, 62,
177, 187, 189, 192, 194 71, 73, 98, 99, 100,
grouped view, 177, 179, 102, 105, 408, 419, 431,
195, 203, 296, 383, 631, 447, 451, 465, 481, 533,
632, 635, 643 534, 564, 630, 656, 657,
<grouping column reference> 677
, 187 <identifier>s for use
<grouping column reference with <get diagnostics
list>, 187 statement>, 481
Index 33
implicit, 13, 20, 31, 41, IN, 84, 128, 212, 445, 539,
44, 67, 69, 70, 71, 72, 542, 543, 545, 546, 547,
73, 74, 101, 102, 103, 548, 554, 555, 556, 570,
104, 108, 109, 110, 111, 571, 572, 573, 574, 576,
115, 121, 122, 124, 125, 578, 580, 581, 583, 584,
130, 134, 142, 143, 149, 585, 586, 588, 590, 591,
151, 152, 153, 166, 174, 593, 595, 596, 598, 600,
181, 182, 232, 240, 241, 602, 604, 606, 608, 611,
242, 252, 253, 255, 256, 612, 613, 618
258, 260, 263, 266, 268, include, 6, 13, 14, 15, 19,
270, 272, 275, 276, 283, 21, 22, 30, 32, 34, 36,
284, 292, 294, 296, 297, 37, 39, 40, 41, 42, 43,
300, 301, 302, 304, 309, 44, 48, 50, 75, 76, 86,
311, 312, 313, 315, 316, 100, 111, 119, 121, 122,
318, 320, 321, 323, 325, 126, 135, 145, 153, 186,
326, 328, 329, 333, 334, 192, 193, 194, 236, 246,
335, 341, 344, 362, 363, 248, 249, 250, 251, 253,
364, 365, 366, 367, 372, 260, 261, 264, 265, 268,
377, 379, 388, 392, 397, 270, 271, 273, 275, 276,
399, 400, 403, 405, 407, 282, 283, 284, 288, 289,
417, 431, 446, 447, 469, 291, 292, 294, 296, 297,
474, 476, 477, 488, 492, 299, 300, 301, 302, 304,
493, 501, 506, 510, 513, 308, 309, 310, 311, 312,
518, 521, 579, 584, 594, 313, 315, 316, 318, 321,
633, 655, 656, 657, 660, 323, 325, 326, 328, 329,
661, 662, 663, 664, 669, 330, 331, 335, 336, 337,
672 372, 383, 384, 386, 389,
Implicit, 23, 24, 25, 26, 392, 394, 397, 452, 454,
35, 122, 134 495, 496, 505, 506, 521,
implicit type conversion, 569, 581, 635, 640, 641,
35 643, 668, 686
implicit zero-bit padding, Incompatibilities with
149, 151, 152, 232, 268, ISO/IEC 9075:1989, 677
623 independent, 14, 335, 336
independent node, 335, 336
Index typography, 15
indicator, 231, 656
Index 35
initially deferred, 575, insufficient item
587, 599 descriptor areas, 452,
initially immediate, 253, 453, 623
575, 587, 599 INT, 84, 108, 356, 357,
INITIALLY_DEFERRED, 541, 366, 500, 502, 515, 516
549, 553, 574, 575, 585, INTEGER, 19, 27, 34, 84,
587, 598, 599 108, 110, 209, 352, 357,
INNER, 84, 180, 181, 182, 358, 359, 360, 361, 425,
183, 680 426, 429, 440, 502, 507,
innermost, 8, 11, 118 510, 512, 513, 514, 516,
<in predicate>, 205, 212, 517, 519, 522, 565, 571,
444, 446 657, 662
<in predicate value>, 212 integrity constraint, 1,
INPUT, 84, 450, 680 40, 67, 69, 74, 154,
input parameter, 61, 62,
347, 348, 350, 357, 362, 236, 253, 270, 325, 385,
363, 364, 365, 366, 367, 387, 403, 486
459, 467, 661 Integrity constraints, 40
INSENSITIVE, 50, 84, 371, integrity constraint
372, 374, 376, 464, 465, violation, 154, 236,
635, 638, 680 253, 403, 486, 621, 622
INSERT, 64, 66, 84, 245, <integrity no>, 16, 17
246, 261, 284, 289, 298, <integrity yes>, 16, 17
329, 330, 333, 334, 388, <intermediate>, 16, 17
Intermediate SQL, 625, 629
389, 398, 484, 600, 601, Intermediate SQL
602, 603, 632 Specifications, 629
<insert column list>, 174, INTERSECT, 84, 196, 197,
388, 389, 446 200, 201, 202, 208, 643,
<insert columns and source> 670, 680
, 388, 390, 648 INTERVAL, 19, 30, 31, 32,
<insert statement>, 53, 55, 33, 49, 73, 83, 84, 91,
56, 58, 59, 119, 173, 94, 108, 112, 113, 123,
174, 176, 202, 299, 369, 166, 167, 169, 170, 209,
388, 390, 442, 444, 446, 227, 228, 353, 422, 426,
484, 485, 525, 631, 632, 427, 429, 434, 436, 439,
636, 642, 648, 673 440, 441, 445, 453, 454,
Index 37
invalid escape character, ISO/IEC 9075, xi, xiii,
215, 620 xvi, 75, 76, 85, 677,
invalid escape sequence, 678, 685, 686
215, 620 ISO/IEC 9579-2, 3, 619, 622
invalid parameter value, ISO/IEC 9899, 3, 243, 505
348, 620 ISO/IEC DIS 10032, 1
invalid schema name, 417, ISO 1989, 3, 243, 509
622 ISO 2022, 3, 249
invalid SQL descriptor ISO 6160, 3, 243, 521
name, 431, 433, 435, ISO 7185, 3, 243, 517
439, 451, 622 ISO 8601, 3, 5
invalid SQL statement name, ISO 8652, 3, 243, 501
ISO 9075, 612, 613, 614,
449, 450, 459, 465, 467, 663, 665
622 ISOLATION, 84, 399, 680
invalid time zone isolation level, 68, 69,
displacement value, 70, 74, 76, 350, 399,
167, 422, 620 400, 528, 662
invalid transaction state, <isolation level>, 399
350, 384, 386, 389, 392, IS_DEFERRABLE, 541, 549,
394, 400, 412, 420, 527, 553, 574, 575, 585, 587,
528, 622 598
invalid transaction IS_GRANTABLE, 546, 547,
termination, 403, 405, 548, 600, 601, 602, 603,
622 604, 605
<in value list>, 212, 213, IS_NULLABLE, 544, 580, 582
444, 446, 632 IS_UPDATABLE, 543, 578, 579
IS, 36, 84, 142, 218, 229, IS_UPDATABLE_CHECK, 578
230, 264, 272, 500, 504, IS_UPDATABLE_NOT_NULL, 578
506, 508, 512, 517, 520, <item number>, 434, 435,
562, 570, 571, 580, 581, 436, 438, 439
Index 39
<left paren>, 16, 79, 80, levels of conformance, 75
107, 108, 118, 124, 128, Lexical elements, 79
132, 133, 139, 141, 144, LIKE, 23, 84, 214, 215, 216
155, 168, 173, 180, 196, <like predicate>, 23, 205,
203, 212, 229, 239, 245, 214, 216, 447
260, 272, 274, 281, 296, LIMIT, 85
297, 314, 320, 325, 346, <limited collation
388, 390, 489, 491, 500, definition>, 311
literal, 23, 24
508, 515, 520 <literal>, 19, 89, 102,
LENGTH, 83, 356, 425, 426, 114, 116, 146, 147, 149,
427, 434, 436, 439, 440, 151, 152, 153, 154, 191,
441, 452, 453, 454, 455, 266, 267, 268, 432, 433,
456, 457, 663 437, 441, 443, 458, 530,
<length>, 63, 93, 107, 108, 629, 637, 638, 640
109, 356, 357, 358, 359, LOCAL, 38, 40, 84, 99, 102,
360, 361, 445, 447, 500, 104, 165, 166, 167, 260,
501, 502, 504, 505, 506, 261, 296, 299, 397, 422,
507, 508, 509, 510, 512, 576, 577, 578, 579, 680
513, 515, 516, 517, 518, <local table name>, 98,
519, 520, 521, 522, 639 103, 397, 486, 487
<length expression>, 23, local temporary table, 37,
27, 29, 128, 129, 131, 38, 39, 72, 101, 103,
630, 641, 659 245, 258, 260, 261, 275,
LESS, 85 281, 283, 294, 397, 398,
<less than operator>, 80, 459, 486, 487, 577, 655,
207, 373, 531 668
<less than or equals LOOP, 85
operator>, 83, 207 <low>, 16, 17
LEVEL, 84, 399, 680 LOWER, 22, 84, 132, 136,
Leveling, 75 681
Leveling Rules, 9, 12, 15, lower case, 22, 81, 87, 88,
625 135, 136, 506, 534, 640
Leveling the SQL Language,
629
<level of isolation>, 399,
400, 662
<levels clause>, 296, 297,
299, 633
Index 41
<module>, 38, 39, 45, 46, <module name clause>, 341,
47, 48, 49, 51, 55, 56, 344, 493
61, 62, 63, 65, 67, 71, Modules, 46
72, 73, 74, 93, 100, monadic, 24, 95, 133, 134,
101, 103, 104, 115, 116, 158
256, 260, 261, 297, 302, monadic operator, 6, 24,
312, 316, 321, 326, 341, 133, 134
342, 343, 344, 346, 348, MONTH, 30, 31, 32, 33, 84,
349, 350, 352, 371, 375, 95, 111, 112, 113, 238,
377, 381, 384, 391, 397, 239, 240, 430, 445, 681
<months value>, 91, 94, 241
403, 405, 408, 409, 411, MORE, 83, 479, 481, 482
449, 450, 459, 464, 467, multiple server transac-
469, 471, 472, 474, 493, tions, 407, 410, 621
495, 496, 614, 625, 627, multiset, 6, 7, 36, 37, 38,
634, 646, 654, 655, 656, 178, 183, 184, 332
657, 658, 661, 662, 668, MUMPS, 4, 61, 83, 243, 244,
669, 670, 671, 673, 674, 359, 360, 365, 489, 490,
678 491, 493, 495, 498, 515,
<module authorization 516, 613, 614, 626, 644,
clause>, 45, 46, 72, 664
101, 102, 341, 343, 493, <MUMPS character variable>,
654, 657, 669 515, 516, 664
<module authorization <MUMPS host identifier>,
identifier>, 46, 65, 490, 515
256, 341, 342, 348, 408, <MUMPS length specifica-
656, 661, 662, 673, 678 tion>, 515, 516
<module character set <MUMPS numeric variable>,
specification>, 46, 515, 516
<MUMPS type specification>,
85, 86, 92, 93, 100, 515
344, 345, 493, 647, 661 <MUMPS variable definition>
<module contents>, 341, , 490, 515, 516
343, 647
module language, 46, 75
<module name>, 46, 61, 74,
99, 103, 344, 352, 493,
669, 673
Index 43
null, 6, 7, 19, 36, 42, 43, <null predicate> semantics,
48, 116, 126, 129, 130, 218
131, 135, 136, 137, 142, <null specification>, 173,
145, 156, 158, 162, 163, 174, 391
166, 169, 173, 174, 182, null value, 6, 7, 19, 36,
183, 192, 205, 207, 215, 42, 126, 129, 130, 131,
218, 224, 225, 228, 231, 135, 136, 137, 142, 145,
234, 267, 268, 278, 279, 156, 158, 162, 163, 166,
373, 391, 422, 436, 444, 169, 174, 183, 207, 215,
452, 454, 456, 458, 506, 218, 224, 225, 228, 231,
525, 531, 573, 579, 581, 234, 267, 268, 278, 279,
594, 614, 644, 662, 665, 435, 436, 454, 456, 458,
668, 671, 674 525, 579, 594, 614, 662,
NULL, 19, 36, 84, 141, 142, 665, 668, 671, 674
144, 145, 173, 192, 218, null value, no indicator
262, 264, 266, 267, 272, parameter, 231, 435, 620
273, 274, 278, 279, 543, null value eliminated in
544, 562, 569, 570, 571, set function, 126, 623
574, 576, 578, 580, 581, number, 27
NUMBER, 84, 479, 481, 482
585, 588, 590, 591, 592, <number of conditions>,
598, 600, 602, 604, 606, 399, 400, 672
608, 610, 612, 613, 618, Numbers, 27
645 NUMBER_OF_CHARACTERS, 554,
nullability, 36, 265 606, 607, 665
nullability characteristic, NUMERIC, 19, 27, 34, 84,
36, 37, 265 107, 109, 110, 353, 358,
nullable, 42, 47, 182, 192, 425, 426, 429, 440, 445,
199, 200, 452, 582 510, 539, 544, 565, 570,
NULLABLE, 84, 427, 434, 571, 572, 658
436, 438, 452, 453, 454, numeric data type
544, 580, 582 descriptor, 27
null character, 363, 506, <numeric primary>, 157, 158
661 <numeric type>, 107
NULLIF, 84, 141, 142, 444, <numeric value expression>,
446, 681 133, 155, 157, 158
<null predicate>, 205, 218, <numeric value function>,
444 128, 131, 157, 630, 641
484
Index 45
<open statement>, 50, 53, OPTION, 40, 65, 75, 84,
55, 57, 58, 59, 342, 248, 296, 297, 299, 329,
368, 371, 375, 464, 465, 330, 331, 333, 335, 336,
484, 493, 494, 495, 496, 337, 356, 389, 393, 395,
673 487, 533, 543, 550, 578,
OPERATION, 85 579, 590, 591, 601, 603,
Operations involving bit 605, 677
strings, 27 OR, 36, 84, 228, 229, 230,
Operations involving 539, 546, 547, 548, 571,
character strings, 22 573, 580, 581, 583, 584,
Operations involving 585, 586, 591, 595, 596,
datetimes and intervals, 606, 608, 611, 612, 613
34 ORDER, 84, 371, 372, 374,
Operations involving 464, 530, 635, 638
numbers, 29 <order by clause>, 50, 371,
operator, 6, 7, 8, 12, 13, 372, 373, 391, 474, 530,
22, 23, 24, 27, 29, 34, 531, 668, 671, 674
35, 80, 83, 95, 133, <ordering specification>,
134, 157, 158, 160, 161, 371
166, 169, 170, 197, 198, ORDINAL_POSITION, 544, 552,
200, 201, 202, 207, 208, 580, 581, 588, 589
229, 237, 373, 391, 434, Other operators involving
438, 443, 445, 479, 500, bit strings, 27
505, 531, 659, 670 Other operators involving
OPERATORS, 85 character strings, 23
Operators that operate on OTHERS, 85
bit strings and return Other terms, 14
bit strings, 27 OUTER, 84, 180, 618, 681
Operators that operate <outer join type>, 180
on character strings outermost, 11, 118
and return character outer reference, 122, 124,
strings, 22 126, 181, 185, 189, 190,
192, 194, 386, 395, 641,
678
OUTPUT, 84, 450, 681
output parameter, 347, 348,
357, 362, 363, 364, 365,
366, 367, 661
Index 47
persist, 37, 39, 44, 51, possibly non-deterministic,
52, 67, 72, 258, 260, 40, 189, 193, 200, 282,
261, 275, 281, 397, 398, 325
577 possibly nullable, 36, 182,
persistent, 7, 37, 39, 44, 192, 452, 582
46, 51, 52, 67, 258, precede, 12, 242, 297, 341,
260, 261, 275, 281, 397, 363, 373, 403, 492, 493,
577 505, 509, 512, 521, 531,
persistent base table, 37 667
persistent table, 44 PRECISION, 19, 27, 34, 85,
phantom, 68 108, 110, 352, 357, 358,
<PL/I host identifier>, 359, 425, 426, 427, 429,
490, 520, 521 434, 436, 439, 440, 441,
<PL/I type fixed binary>, 453, 454, 455, 456, 457,
520 500, 502, 507, 512, 513,
<PL/I type fixed decimal>, 539, 544, 565, 570, 571,
520 572, 658, 663
<PL/I type float binary>, <precision>, 63, 107, 108,
520 109, 110, 358, 361, 445,
<PL/I type specification>,
520, 521, 522, 523, 639, 515, 516, 520, 522, 657,
651, 664, 665 658
<PL/I variable definition>, <predicate>, 205, 206, 216,
490, 520, 521, 522, 664 229, 632
PLI, 84, 243, 355, 361, Predicates, 205
367, 493, 612, 613, 614, PREORDER, 85
615 Preparable and immediately
<plus sign>, 80, 90, 157, executable SQL-
158, 165, 168 statements, 56
POSITION, 85, 128, 445, <preparable dynamic delete
544, 552, 580, 581, 588, statement: positioned>,
589, 681 53, 56, 59, 60, 62, 442,
<position expression>, 23, 443, 460, 462, 463, 476,
27, 29, 128, 129, 130, 484, 638
Index 49
privilege not granted, 332, PUBLIC, 66, 75, 85, 102,
623 245, 246, 248, 315, 321,
privilege not revoked, 338, 334, 533, 539, 542, 545,
623 546, 547, 548, 554, 555,
Privileges, 64 556, 601, 603, 605
PRIVILEGES, 85, 245, 246,
294, 300, 332, 338, 539, - Q -
542, 545, 546, 547, 548, <qualified identifier>, 98,
554, 555, 556, 600, 602, 102, 119, 252, 325, 486,
604, 605, 640 487
<privileges>, 245, 329, <qualified join>, 180, 181
330, 331, 332, 333, 338, <qualified local table
389 name>, 98, 101, 104, 397
PRIVILEGE_TYPE, 546, 547, <qualified name>, 39, 44,
548, 600, 601, 602, 603 73, 98, 99, 101, 102,
procedure, 47 417, 656
PROCEDURE, 85, 346 <qualifier>, 121, 125, 191,
<procedure>, 14, 39, 46, 390, 643
47, 48, 49, 55, 56, 61, <quantified comparison
63, 65, 67, 71, 72, 74, predicate>, 205, 220,
103, 256, 341, 342, 346, 447
347, 348, 349, 350, 352, <quantifier>, 220, 221
371, 397, 408, 409, 411, <query expression>, 11,
413, 460, 463, 493, 494, 15, 37, 38, 40, 75, 119,
495, 496, 527, 528, 627, 173, 176, 193, 196, 197,
655, 661, 662, 670, 671, 200, 202, 203, 204, 237,
673, 674, 675 282, 284, 289, 294, 296,
<procedure name>, 47, 61, 297, 298, 299, 300, 309,
99, 103, 346, 348, 352, 313, 318, 323, 325, 330,
493, 494, 661, 671, 673 331, 334, 335, 336, 371,
Procedures, 47 372, 375, 387, 388, 389,
Processing methods, 627 390, 392, 396, 444, 446,
programming languages, 49, 467, 474, 530, 579, 581,
243 583, 584, 631, 632, 636,
PROTECTED, 85 642, 643, 646, 648, 671,
677
Query expressions, 173
Index 51
referential constraint, 41, Remote Database Access, 3,
42 622
<referential constraint REPEATABLE, 68, 69, 84, 399
definition>, 42, 45, repertoire, 5, 7, 20, 21,
270, 271, 274, 276, 280, 23, 24, 35, 46, 74, 76,
645 85, 86, 92, 93, 100,
<referential triggered 109, 111, 129, 133, 134,
action>, 265, 274, 280, 135, 136, 145, 147, 148,
633, 645 149, 150, 151, 160, 208,
REFERENTIAL_CONSTRAINTS, 237, 248, 249, 250, 266,
550, 559, 586, 590, 617, 311, 312, 315, 316, 506,
640 607, 660, 669, 674
REFERENTIAL_CONSTRAINTS REPLACE, 85
base table, 590 requires, 6, 42, 71, 583
REFERENTIAL_CONSTRAINTS reserved, 61, 73, 83, 84,
view, 550 85, 87, 100, 408, 411,
REFERENTIAL_CONSTRAINTS_ 448, 466, 619, 626, 655,
CONSTRAINT_TYPE_CHECK, 678
590 <reserved word>, 83, 84,
REFERENTIAL_CONSTRAINTS_ 85, 87, 100, 626, 678
PRIMARY_KEY, 590 RESIGNAL, 85
REFERENTIAL_DELETE_RULE_ RESTRICT, 85, 258, 289,
CHECK, 590 292, 294, 300, 309, 337,
REFERENTIAL_DELETE_RULE_ 354, 681
NOT_NULL, 590 restricted data type
REFERENTIAL_MATCH_OPTION_ attribute violation,
CHECK, 590 456, 458, 621
REFERENTIAL_MATCH_OPTION_ <result>, 141, 142, 143
NOT_NULL, 590 <result expression>, 141,
REFERENTIAL_UPDATE_RULE_ 142
CHECK, 590 <result using clause>, 451,
REFERENTIAL_UPDATE_RULE_ 456, 457, 459, 460, 638
NOT_NULL, 590 Retrieval assignment, 231
<regular identifier>, 82, RETURN, 85
86, 87, 88, 98, 533, RETURNED_LENGTH, 84, 427,
534, 629 434, 436, 438, 458
RELATIVE, 85, 377, 378, RETURNED_OCTET_LENGTH, 84,
379, 681 427, 434, 436, 438, 458
Index 53
<schema authorization SCHEMATA, 538, 541, 543,
identifier>, 65, 255, 544, 549, 550, 551, 552,
256 553, 557, 558, 559, 561,
<schema character set name> 562, 569, 571, 573, 574,
, 311 576, 580, 583, 584, 585,
<schema character set 586, 591, 595, 596, 598,
specification>, 93, 606, 608, 610, 611, 640
100, 255, 256, 257, 263, SCHEMATA base table, 569
644, 660 SCHEMATA view, 538
<schema collation name>, SCHEMATA_FOREIGN_KEY, 569
314, 315 SCHEMATA_PRIMARY_KEY, 569
<schema definition>, 44, <schema translation name>,
52, 65, 93, 100, 101, 320, 321
252, 255, 256, 260, 261, SCHEMA_NAME, 84, 354, 480,
263, 296, 301, 311, 315, 481, 486, 487, 538, 541,
320, 325, 368, 484, 566, 543, 544, 549, 550, 551,
568, 660 552, 553, 557, 558, 559,
Schema definition and 561, 562, 569
manipulation, 255 SCHEMA_OWNER, 538, 541,
<schema element>, 255, 256, 543, 544, 549, 550, 551,
632, 644 552, 553, 557, 558, 559,
<schema name>, 15, 39, 44, 561, 562, 569
45, 46, 64, 72, 73, 98, SCHEMA_OWNER_NOT_NULL, 569
99, 101, 102, 103, 104, scope, 1, 10, 14, 39, 62,
249, 252, 255, 256, 257, 63, 70, 99, 102, 103,
258, 260, 263, 283, 294, 104, 118, 119, 121, 122,
296, 297, 300, 301, 302, 125, 260, 283, 356, 386,
304, 309, 311, 312, 313, 392, 394, 397, 431, 433,
315, 316, 318, 320, 321, 447, 449, 450, 451, 459,
323, 325, 326, 328, 341, 465, 466, 467, 475, 492,
397, 398, 415, 417, 486, 501, 669
487, 493, 616, 644, 654, Scope, 1
656, 657, 661, 668, 669 scope clause, 118, 119,
<schema name clause>, 101, 431, 433
255, 257, 644, 657 <scope option>, 99, 102,
104, 431, 433, 447, 451
Index 55
<separator>, 82, 83, 86, set, 3, 5, 6, 7, 11, 19,
89, 92, 93, 100, 491, 20, 21, 22, 23, 30, 32,
512 35, 36, 37, 38, 41, 44,
sequence, 5, 7, 9, 12, 20, 45, 46, 47, 48, 52, 54,
21, 22, 23, 24, 25, 26, 60, 62, 64, 65, 66, 67,
32, 35, 37, 47, 67, 69, 68, 70, 71, 72, 73, 74,
72, 92, 95, 97, 104, 80, 85, 86, 87, 89, 92,
115, 122, 125, 133, 134, 93, 97, 98, 99, 100,
145, 155, 161, 187, 191, 102, 103, 104, 105, 107,
207, 208, 214, 215, 216, 108, 109, 115, 124, 126,
220, 224, 237, 249, 250, 127, 133, 134, 136, 142,
251, 264, 297, 314, 315, 153, 155, 173, 176, 178,
316, 317, 318, 372, 388, 181, 183, 184, 185, 186,
497, 501, 506, 509, 521, 187, 189, 190, 191, 192,
660, 661 193, 194, 195, 197, 198,
SEQUENCE, 85 199, 200, 201, 202, 208,
SERIALIZABLE, 68, 69, 84, 222, 231, 232, 233, 234,
350, 399, 528 235, 237, 238, 246, 248,
serialization failure, 69, 249, 250, 253, 255, 256,
622 257, 258, 259, 261, 263,
SERVER_NAME, 84, 479, 481,
488 267, 273, 275, 278, 279,
SESSION, 85, 420, 484, 682 281, 286, 287, 298, 301,
Session management, 415 302, 304, 305, 306, 311,
SESSION_USER, 85, 114, 115, 312, 313, 314, 315, 316,
116, 117, 266, 267, 268, 317, 318, 320, 321, 323,
269, 282, 325, 375, 530, 329, 330, 331, 332, 333,
641, 645, 658, 682 334, 335, 336, 337, 338,
Index 57
<signed integer>, 90 <simple value specifica-
<signed numeric literal>, tion>, 62, 71, 99, 102,
89, 90, 95, 146, 147, 114, 116, 167, 347, 377,
267 378, 399, 408, 425, 426,
significant, 27, 28, 31, 431, 433, 434, 438, 442,
33, 34, 146, 149, 151, 443, 447, 451, 465, 480,
154, 158, 166, 169, 170, 657
171, 209, 238, 240, 241, <simple when clause>, 141
242, 267, 363, 512, 518, simply contain, 11, 24, 36,
653 119, 124, 156, 158, 162,
SIMILAR, 85 163, 165, 166, 167, 168,
<simple case>, 141, 142 169, 173, 174, 175, 191,
<simple Latin letter>, 22, 192, 193, 197, 201, 267,
79, 98 372, 375, 443, 444, 446,
<simple Latin lower case 467, 579, 631, 642
letter>, 79, 81, 87, 88, simply underlying table,
135, 136, 640 38, 193, 200, 299, 372,
<simple Latin upper case 384, 391, 472, 474
letter>, 79, 81, 87, <single datetime field>,
135, 136, 619, 666 239, 240, 241, 242
<simple table>, 196, 197, SIZE, 85, 399, 682
200, 201, 202, 632, 670 SMALLINT, 19, 27, 34, 85,
<simple target specifi- 108, 110, 352, 356, 357,
cation 1>, 434, 435, 358, 359, 361, 362, 425,
672 426, 429, 440, 500, 502,
<simple target specifi- 507, 510, 522, 571, 657,
cation 2>, 434, 435, 662
672 <solidus>, 80, 157, 158,
<simple target specifica- 168
tion>, 114, 116, 347, SOME, 85, 220
425, 426, 434, 435, 447, <some>, 220, 221
479, 480, 482, 485 <sort key>, 371
<simple value specification <sort specification>, 371,
1>, 438 372, 373, 530, 531, 675
<simple value specification <sort specification list>,
2>, 438, 439 371
Index 59
SQL-agent, 48, 66, 68, 70, SQL-data, 1, 10, 12, 31,
71, 72, 74, 96, 342, 35, 40, 43, 45, 46, 50,
343, 348, 349, 350, 352, 51, 52, 53, 55, 56, 57,
399, 400, 401, 403, 405, 58, 59, 60, 67, 68, 69,
408, 409, 410, 411, 412, 70, 231, 234, 281, 351,
413, 526, 527, 528, 646, 379, 382, 403, 404, 405,
654, 656, 661, 668, 669, 528, 655, 662, 668
670, 671, 672 <SQL data change statement>
SQL-agents, 66 , 368, 369
SQL-client, 70, 71, 74, <SQL data statement>, 350,
409, 656, 669 368
SQL-client unable to SQL descriptor area, 62,
establish SQL-connection 64, 104, 431, 432, 433,
, 409, 620 434, 435, 436, 438, 439,
SQLCODE, 47, 48, 49, 85, 451, 453, 457, 458, 460,
346, 347, 352, 356, 357, 469, 470, 663, 667
358, 359, 360, 361, 482, <sql diagnostics
485, 492, 494, 495, 496, information>, 479
500, 502, 507, 510, 514, <SQL diagnostics statement>
516, 519, 522, 624, 654, , 48, 74, 349, 351, 368,
661, 662, 664, 665, 666, 369, 647
668, 675 <SQL dynamic data
SQLCODE values, 624 statement>, 67, 350,
<SQL conformance>, 16, 17 369, 655
SQL-connection, 52, 54, 55, <SQL dynamic statement>,
57, 58, 60, 70, 71, 72, 104, 368, 369, 451, 635,
104, 407, 408, 409, 410, 647
411, 412, 413, 662, 672 SQL dynamic statements, 61
SQL-connections, 70 <SQL edition>, 16, 17
<SQL connection statement>, <SQL embedded language
74, 348, 349, 368, 369, character>, 79
488, 525, 526, 527, 635, SQL-environment, 45, 46,
640 70, 71, 72, 74, 75, 344,
654, 655, 663
SQLERROR, 85, 497, 499
SQLEXCEPTION, 85
SQL Flagger, 76, 77, 626
Index 61
SQL-statement, 1, 10, 12, SQL-transaction, 7, 41, 45,
14, 41, 45, 48, 50, 51, 49, 50, 52, 54, 55, 56,
52, 55, 56, 57, 58, 59, 58, 60, 67, 68, 69, 70,
60, 61, 63, 64, 65, 66, 71, 75, 76, 349, 350,
67, 68, 69, 71, 72, 116, 384, 386, 389, 392, 394,
139, 140, 174, 192, 197, 399, 400, 401, 403, 404,
199, 200, 253, 256, 277, 405, 407, 410, 420, 448,
279, 280, 342, 349, 368, 527, 528, 654, 655, 662,
407, 410, 449, 482, 484, 668, 672, 677
485, 486, 492, 497, 526, SQL-transaction isolation
533, 654, 658, 667, 668, levels and the three
669, 673, 674 phenomena, 68
SQL-statement character SQL-transactions, 67
codes for use in the <SQL transaction statement>
diagnostics area, 482 , 368, 369, 442, 525,
<SQL statement name>, 14, 635, 639, 647
59, 99, 105, 442, 447, <SQL variant>, 16
448, 449, 450, 459, 640 SQLWARNING, 85
SQL-statements, 51 SQL_IDENTIFIER, 536, 564,
SQL-statements and 568, 569, 570, 573, 574,
transaction states, 576, 578, 580, 583, 584,
59 585, 588, 590, 593, 595,
SQL-statements classified 596, 598, 600, 602, 604,
by function, 52 606, 608, 610
<SQL statement variable>, SQL_IDENTIFIER domain, 564
14, 59, 442, 443, 462 SQL_LANGUAGES, 563, 612,
<SQL terminal character>, 640
79 SQL_LANGUAGES base table,
<SQL terminator>, 489, 490, 612
491 SQL_LANGUAGES view, 563
SQL_LANGUAGES_SOURCE_NOT_
NULL, 612
SQL_LANGUAGES_STANDARD_
VALID_CHECK, 612
SQL_LANGUAGE_BINDING_STYLE,
563, 612, 613, 614
SQL_LANGUAGE_CONFORMANCE,
563, 612, 613, 614
Index 63
SUBSTRING, 22, 85, 132, Syntax Rules, 9, 10, 12,
133, 149, 151, 353, 362, 13, 14, 15, 64, 77, 82,
363, 364, 366, 445, 682 89, 139, 162, 208, 237,
substring error, 135, 137, 270, 284, 302, 342, 347,
621 371, 377, 382, 388, 392,
successful completion, 47, 394, 407, 408, 415, 417,
351, 622, 624 419, 420, 431, 435, 439,
SUM, 85, 124, 125, 126, 659 442, 443, 447, 456, 458,
Syntactic containment, 11 459, 462, 465, 469, 475,
syntactic element, 11, 12,
13, 72 476, 477, 495, 496, 497,
Syntactic substitution, 13 500, 501, 504, 505, 506,
syntax error or access rule 508, 509, 512, 513, 515,
violation, 12, 13, 486, 517, 518, 520, 521, 525,
487, 622 526, 530, 625, 663, 665,
syntax error or access rule 667, 677, 678
violation in direct SQL _SYSTEM, 66, 248, 261, 289,
statement, 12, 486, 487, 290, 294, 298, 300, 302,
526, 622 310, 312, 313, 316, 318,
syntax error or access rule 321, 323, 330, 331, 332,
violation in dynamic SQL 334, 335, 336, 398
statement, 12, 443, 462, <system descriptor
486, 487, 622 statement>, 369
SYSTEM_USER, 85, 114, 115,
116, 117, 192, 266, 267,
268, 269, 282, 325, 375,
530, 641, 645, 658, 682
- T -
table, 37
Index 65
<table value constructor>, TABLE_CONSTRAINTS_TABLE_
175, 176, 196, 197, 200, SCHEMA_NOT_NULL, 585
202, 212, 390, 444, 446, TABLE_CONSTRAINTS_UNIQUE_
631, 632, 642, 648 CHECK, 586
<table value constructor TABLE_NAME, 84, 480, 481,
list>, 176 486, 487, 542, 543, 544,
TABLE_CATALOG, 542, 543, 545, 546, 547, 549, 552,
544, 545, 546, 547, 549, 557, 558, 559, 561, 562,
552, 557, 558, 559, 561, 572, 576, 578, 580, 581,
562, 572, 576, 578, 580, 583, 584, 585, 586, 587,
581, 583, 584, 585, 586, 588, 589, 595, 596, 597,
587, 588, 589, 591, 595, 600, 601, 602, 603
596, 597, 600, 601, 602, TABLE_OR_DOMAIN_CATALOG,
603 539, 545, 570, 571, 572,
TABLE_CONSTRAINTS, 549, 573, 581
559, 561, 585, 586, 588, TABLE_OR_DOMAIN_CHECK_
590, 591, 593, 616, 618 COMBINATIONS, 570
TABLE_CONSTRAINTS base TABLE_OR_DOMAIN_DATA_TYPE_
table, 585 NOT_NULL, 570
TABLE_CONSTRAINTS view, 549 TABLE_OR_DOMAIN_NAME, 539,
TABLE_CONSTRAINTS_CHECK_ 545, 570, 571, 572, 573,
REFERENCES_TABLES, 585 581
TABLE_CONSTRAINTS_CHECK_ TABLE_OR_DOMAIN_SCHEMA,
VIEWS, 586 539, 545, 570, 571, 572,
TABLE_CONSTRAINTS_DEFERRED_ 573, 581
CHECK, 585 TABLE_PRIVILEGES, 542, 546,
TABLE_CONSTRAINTS_ 600, 640
INITIALLY_DEFERRED_ TABLE_PRIVILEGES base table
NOT_NULL, 585 , 600
TABLE_CONSTRAINTS_IS_ TABLE_PRIVILEGES view, 546
DEFERRABLE_NOT_NULL, TABLE_PRIVILEGES_FOREIGN_
585 KEY_TABLES, 600
TABLE_CONSTRAINTS_PRIMARY_ TABLE_PRIVILEGES_GRANTABLE_
KEY, 585 CHECK, 600
TABLE_CONSTRAINTS_TABLE_ TABLE_PRIVILEGES_GRANTABLE_
CATALOG_NOT_NULL, 585 NOT_NULL, 600
TABLE_CONSTRAINTS_TABLE_ TABLE_PRIVILEGES_GRANTEE_
NAME_NOT_NULL, 585 FOREIGN_KEY_USERS, 600
Index 67
<time precision>, 108, 110, transaction, 7, 41, 45, 48,
111, 113, 139, 140, 426, 49, 50, 51, 52, 54, 55,
453, 454, 630 56, 58, 59, 60, 67, 68,
TIMESTAMP, 19, 29, 30, 31, 69, 70, 71, 74, 75, 76,
49, 85, 90, 94, 108, 253, 349, 350, 368, 369,
110, 111, 122, 123, 129, 384, 386, 389, 392, 394,
139, 153, 166, 429, 440, 399, 400, 401, 403, 404,
446, 571, 682 405, 407, 410, 412, 420,
<timestamp literal>, 90, 442, 448, 484, 486, 525,
94, 96 526, 527, 528, 635, 637,
<timestamp precision>, 108, 639, 647, 648, 654, 655,
110, 111, 113, 139, 140, 662, 665, 668, 672, 677
426, 453, 454, 630 TRANSACTION, 85, 353, 354,
<timestamp string>, 82, 86, 355, 399, 484, 682
90 <transaction access mode>,
<time string>, 82, 90 399, 400
<time value>, 90, 91, 96 transaction-initiating, 67,
<time zone>, 165, 166, 167 349, 407, 410, 526, 527
<time zone field>, 128, 129 Transaction management, 399
<time zone interval>, 90, <transaction mode>, 399
94, 95, 96 transaction resolution
<time zone specifier>, 165, unknown, 71, 620
166, 167 transaction rollback, 69,
TIMEZONE_HOUR, 30, 85, 112, 71, 253, 403, 404, 486,
128, 130, 682 622, 655, 662
TIMEZONE_MINUTE, 30, 85, transaction states, 59
112, 128, 682 TRANSLATE, 85, 132, 682
TO, 31, 85, 123, 154, 166,
170, 209, 238, 239, 240,
248, 315, 320, 321, 329,
330, 331, 332, 349, 407,
422, 430, 441, 497, 499,
527
<token>, 82, 86, 491
<token> and <separator>, 82
TRAILING, 85, 132, 136, 682
Index 69
TRIM, 85, 132, 134, 152, Type conversions and mixing
153, 154, 353, 407, 408, of data types, 34
415, 417, 419, 420, 431, - U -
447, 465, 682 UNCOMMITTED, 68, 69, 84,
<trim character>, 132, 134, 399, 400
136, 444 UNDER, 85
trim error, 136, 621 underlying column, 122,
<trim function>, 22, 132, 155, 177, 192, 200, 201,
134, 136, 137, 138, 444, 297, 298, 331
641 underlying data type, 144
<trim operands>, 132 underlying table, 37, 38,
<trim source>, 132, 134, 193, 200, 298, 299, 330,
136, 444 334, 372, 384, 387, 389,
<trim specification>, 132, 390, 391, 392, 396, 472,
134, 136 474, 476, 477
TRUE, 85, 229, 230, 356, <underscore>, 80, 81, 82,
682 87, 88, 89, 98, 101,
Truth table for the AND 215, 629
boolean, 230 UNION, 85, 176, 180, 181,
Truth table for the IS 182, 183, 184, 196, 197,
boolean, 230 200, 201, 202, 208, 542,
Truth table for the OR
boolean, 230 559, 561, 572, 586, 593,
<truth value>, 229, 230, 604, 616, 631, 643, 670
632 UNIQUE, 41, 85, 223, 224,
TYPE, 84, 85, 352, 353, 225, 270, 272, 273, 550,
354, 355, 356, 425, 426, 559, 580, 585, 586, 587,
427, 434, 436, 439, 440, 588, 590, 591, 616, 617,
441, 452, 453, 454, 455, 618, 645
456, 457, 458, 500, 502, <unique column list>, 41,
539, 542, 544, 545, 546, 270, 272, 273, 275, 645
547, 548, 549, 554, 555, unique constraint, 41, 42
556, 570, 571, 572, 573, <unique constraint
576, 578, 580, 581, 585, definition>, 36, 270,
586, 587, 588, 590, 591, 272, 273, 275, 677
600, 601, 602, 603, 604, unique matching rows, 277,
605, 618, 663, 664 278, 279
Type conversions, 34
Index 71
<update statement: USAGE_PRIVILEGES_IS_
searched>, 53, 55, 56, GRANTABLE_CHECK, 604
58, 60, 119, 122, 299, USAGE_PRIVILEGES_IS_
369, 385, 392, 394, 396, GRANTABLE_NOT_NULL,
442, 484, 485, 525, 648, 604
673 USAGE_PRIVILEGES_OBJECT_
UPDATE_RULE, 550, 590, 591 TYPE_CHECK, 604
UPPER, 22, 85, 132, 135, USAGE_PRIVILEGES_PRIMARY_
682 KEY, 604
upper case, 22, 81, 87, Use of terms, 10
135, 136, 506, 534, 619, USER, 85, 114, 115, 117,
666 266, 407
USAGE, 65, 66, 85, 135, <user-defined character
145, 245, 248, 249, 251, repertoire name>, 248,
264, 302, 310, 312, 313, 249
315, 316, 318, 321, 323, <user name>, 72, 99, 103,
329, 330, 331, 333, 336, 407, 408, 409, 662
337, 358, 359, 508, 510, USERS, 568, 569, 600, 602,
533, 539, 548, 552, 554, 605
USERS base table, 568
555, 556, 557, 558, 559, USERS_PRIMARY_KEY, 568
561, 562, 583, 584, 588, USER_NAME, 568
595, 596, 604, 605, 617, USING, 85, 132, 180, 354,
618, 640, 664, 682 451, 539, 561, 618, 682
usage privilege descriptor, <using arguments>, 451,
66 455, 456, 457, 459, 469,
USAGE_PRIVILEGES, 539, 548, 470
554, 555, 556, 604, 605, <using clause>, 451, 455,
640 456, 457, 459, 467, 469
USAGE_PRIVILEGES base table using clause does not
, 604 match dynamic parameter
USAGE_PRIVILEGES view, 548 specifications, 455, 621
USAGE_PRIVILEGES_CHECK_ using clause does not match
REFERENCES_OBJECT, 604 target specifications,
USAGE_PRIVILEGES_GRANTEE_ 457, 621
FOREIGN_KEY_USERS, 605 using clause required for
USAGE_PRIVILEGES_GRANTOR_ dynamic parameters, 460,
FOREIGN_KEY_USERS, 605 467, 621
- V - <target specification>,
Valid operators involving 114
datetimes and intervals, VARCHAR, 85, 107, 108, 113,
34 504, 505, 506, 507, 515,
Valid values for fields in 516, 640, 651, 664, 682
datetime items, 112 variable, 14, 23, 24, 47,
Valid values for fields in 48, 49, 59, 61, 62, 63,
INTERVAL items, 32, 112 114, 115, 116, 192, 442,
value, 19 443, 451, 462, 489, 490,
VALUE, 36, 85, 114, 115, 492, 493, 494, 495, 496,
116, 309, 434, 438, 509, 497, 498, 499, 500, 501,
565, 641, 664, 682 502, 504, 505, 506, 507,
<value expression>, 119, 508, 509, 510, 512, 513,
122, 124, 125, 126, 127, 514, 515, 516, 517, 518,
141, 142, 144, 145, 155, 519, 520, 521, 522, 525,
156, 173, 176, 181, 185, 630, 639, 651, 655, 664,
186, 187, 191, 192, 193, 673
194, 212, 213, 382, 391, VARIABLE, 85
392, 393, 394, 395, 396, variable-length, xiii, 76,
443, 444, 445, 446, 447, 109, 115, 133, 134, 145,
474, 475, 630, 632, 636, 148, 149, 150, 151, 152,
641, 642, 643, 648, 677 161, 162, 163, 216, 232,
<value expression primary>, 234, 235, 237, 266, 268,
155, 156, 157, 160, 161, 365, 366, 506, 516, 564,
165, 168, 642 658, 663
VALUES, 85, 176, 212, 388, variable-length coding, 5,
574, 578, 586, 598, 648 6
<variable specification>,
114, 115, 116, 525
Index 73
VARYING, 19, 20, 26, 35, VIEW, 85, 258, 290, 296,
85, 107, 108, 109, 113, 300, 338, 483, 484, 538,
263, 301, 351, 357, 360, 539, 541, 542, 543, 544,
361, 362, 363, 364, 365, 546, 547, 548, 549, 550,
366, 367, 425, 426, 429, 551, 552, 553, 554, 555,
440, 445, 447, 458, 506, 556, 557, 558, 559, 561,
516, 520, 521, 522, 523, 562, 563, 576, 577, 578,
564, 570, 635, 639, 640, 579, 583, 584, 586, 640
647, 651, 682 <view column list>, 296,
<vertical bar>, 80, 81 297, 334, 335
view, 10, 11, 37, 38, 39, <view definition>, 11, 37,
40, 44, 45, 52, 64, 67, 52, 119, 255, 296, 297,
75, 77, 119, 177, 179, 299, 334, 335, 368, 484,
195, 203, 255, 256, 258, 579, 646
267, 268, 284, 289, 290, view descriptor, 39, 40,
294, 296, 297, 299, 300, 44, 284, 289, 294, 297,
309, 318, 323, 326, 330, 299, 300, 313, 318, 323,
331, 334, 335, 336, 337, 326, 336, 338, 578, 581
338, 368, 383, 389, 393, viewed table, 10, 37, 38,
395, 398, 483, 484, 487, 67, 75, 296, 300, 543,
533, 538, 539, 540, 541, 557, 558, 577, 578, 668
542, 543, 544, 546, 547, VIEWS, 543, 576, 578, 583,
548, 549, 550, 551, 552, 584, 586, 640
553, 554, 555, 556, 557, VIEWS base table, 578
VIEWS view, 543
558, 559, 560, 561, 562, VIEWS_IN_TABLES_CHECK, 578
563, 576, 577, 578, 579, VIEWS_IS_UPDATABLE_CHECK_
581, 583, 584, 631, 632, OPTION_CHECK, 578
633, 635, 643, 646, 652, VIEWS_PRIMARY_KEY, 578
667, 668, 677, 678 VIEW_CATALOG, 557, 558,
583, 584
VIEW_COLUMN_USAGE, 558,
584, 640
VIEW_COLUMN_USAGE base
table, 584
VIEW_COLUMN_USAGE view, 558
VIEW_COLUMN_USAGE_CHECK_
REFERENCES_COLUMNS, 584
682
WHENEVER, 85, 497
<when operand>, 141, 142,
444, 446
Index 75
- Y - <years value>, 91, 94, 95,
YEAR, 30, 31, 32, 33, 85, 241
571, 683