ISO/IEC 9075-2:2003/Cor 1:2005
(Corrigendum)Information technology - Database languages - SQL - Part 2: Foundation (SQL/Foundation) - Technical Corrigendum 1
Information technology - Database languages - SQL - Part 2: Foundation (SQL/Foundation) - Technical Corrigendum 1
Technologies de l'information — Langages de base de données — SQL — Partie 2: Fondations (SQL/Foundation) — Rectificatif technique 1
General Information
Relations
Frequently Asked Questions
ISO/IEC 9075-2:2003/Cor 1:2005 is a standard published by the International Organization for Standardization (ISO). Its full title is "Information technology - Database languages - SQL - Part 2: Foundation (SQL/Foundation) - Technical Corrigendum 1". This standard covers: Information technology - Database languages - SQL - Part 2: Foundation (SQL/Foundation) - Technical Corrigendum 1
Information technology - Database languages - SQL - Part 2: Foundation (SQL/Foundation) - Technical Corrigendum 1
ISO/IEC 9075-2:2003/Cor 1:2005 is classified under the following ICS (International Classification for Standards) categories: 35.060 - Languages used in information technology. The ICS classification helps identify the subject area and facilitates finding related standards.
ISO/IEC 9075-2:2003/Cor 1:2005 has the following relationships with other standards: It is inter standard links to ISO/IEC 9075-2:2008. Understanding these relationships helps ensure you are using the most current and applicable version of the standard.
You can purchase ISO/IEC 9075-2:2003/Cor 1:2005 directly from iTeh Standards. The document is available in PDF format and is delivered instantly after payment. Add the standard to your cart and complete the secure checkout process. iTeh Standards is an authorized distributor of ISO standards.
Standards Content (Sample)
INTERNATIONAL STANDARD ISO/IEC 9075-2:2003
TECHNICAL CORRIGENDUM 1
Published 2005-11-15
INTERNATIONAL ORGANIZATION FOR STANDARDIZATION • МЕЖДУНАРОДНАЯ ОРГАНИЗАЦИЯ ПО СТАНДАРТИЗАЦИИ • ORGANISATION INTERNATIONALE DE NORMALISATION
INTERNATIONAL ELECTROTECHNICAL COMMISSION • МЕЖДУНАРОДНАЯ ЭЛЕКТРОТЕХНИЧЕСКАЯ КОМИССИЯ • COMMISSION ÉLECTROTECHNIQUE INTERNATIONALE
Information technology — Database languages — SQL —
Part 2:
Foundation (SQL/Foundation)
TECHNICAL CORRIGENDUM 1
Technologies de l'information — Langages de base de données — SQL —
Partie 2: Fondations (SQL/Foundation)
RECTIFICATIF TECHNIQUE 1
Technical Corrigendum 1 to ISO/IEC 9075-2:2003 was prepared by Joint Technical Committee
ISO/IEC JTC 1, Information technology, Subcommittee SC 32, Data management and interchange.
Statement of purpose for rationale
A statement indicating the rationale for each change to ISO/IEC 9075-2:2003 is included. This is to inform the users of
ISO/IEC 9075-2:2003 why it was judged necessary to change the original wording. In many cases, the reason is editorial
or to clarify the wording; in some cases, it is to correct an error or an omission in the original wording.
Notes on numbering
Where this Technical Corrigendum introduces new Syntax, Access, General, and Conformance Rules, the new rules
have been numbered as follows:
Rules inserted between, for example, Rules 7) and 8) are numbered 7.1), 7.2), etc. [or 7)a.1), 7)a.2), etc.]. Those
inserted before Rule 1) are numbered 0.1), 0.2, etc.
Where this Technical Corrigendum introduces new subclauses, the new subclauses have been numbered as follows:
Subclauses inserted between, for example, 4.3.2 and 4.3.3 are numbered 4.3.2a, 4.3.2b, etc. Those inserted before,
for example, 4.3.1 are numbered 4.3.0, 4.3.0a, etc.
ICS 35.060 Ref. No. ISO/IEC 9075-2:2003/Cor.1:2005(E)
© ISO/IEC 2005 – All rights reserved
Published in Switzerland
ISO/IEC 9075-2:2003/Cor.1:2005(E)
ii © ISO/IEC 2005 – All rights reserved
ISO/IEC 9075-2:2003/Cor.1:2005(E)
Contents Page
Foreword. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
3 Definitions, notations, and conventions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
3.1 Definitions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
3.1.6 Definitions provided in Part 2. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
4 Concepts. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
4.13 Columns, fields and attributes. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
4.14 Tables. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
4.14.2 Types of tables. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
4.14.3 Table descriptors. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
4.17 Integrity constraints. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4
4.17.1 Overview of integrity constraints. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
4.17.2 Checking of constraints. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
4.17.3 Table constraints. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
4.17.4 Domain constraints. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
4.17.5 Assertions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
4.18 Functional dependencies. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
4.18.6 Known functional dependencies in a . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
4.18.15 Known functional dependencies in a . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
4.20 SQL-Schemas. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
4.27 SQL-invoked routines. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
4.27.3 Execution of SQL-invoked routines. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
4.27.4 Routine descriptors. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
4.27.5 Result sets returned by SQL-invoked procedures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
4.32 Cursors. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
4.32.1 General description of cursors. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
4.32.2 Operations on and using cursors. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
4.33 SQL-statements. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
4.33.3 SQL-statements and SQL-data access indication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
4.33.4 SQL-statements and transaction states. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
4.34 Basic security model. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
4.34.1 Authorization identifiers. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
4.34.1.1 SQL-session authorization identifiers. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
4.34.2 Privileges. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
4.34.3 Roles. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
4.34.4 Security model definitions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
© ISO/IEC 2005 – All rights reserved iii
ISO/IEC 9075-2:2003/Cor.1:2005(E)
4.37 SQL-sessions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
4.37.3 SQL-session properties. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
4.38 Triggers. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
4.38.2 Trigger execution. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .16
5 Lexical elements. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .16
5.1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
5.2 and . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
5.3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .17
5.4 Names and identifiers. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
6 Scalar expressions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
6.1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
6.4 and . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
6.9 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
6.10 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
6.12 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .22
6.13 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
6.27 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
6.29 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
7 Query expressions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
7.6 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
7.7 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
7.8 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
7.10 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
7.11 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
7.12 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
7.13 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
7.14 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
7.15 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
8 Predicates. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
8.2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .38
9 Additional common rules. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
9.24 Determination of view and view component privileges . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
10 Additional common elements. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
10.4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
10.8 and . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
10.9 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
11 Schema definition and manipulation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
11.2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
11.3
11.4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
11.6
iv © ISO/IEC 2005 – All rights reserved
ISO/IEC 9075-2:2003/Cor.1:2005(E)
11.7 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
11.8 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
11.9 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
11.18 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
11.22 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
11.24 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
11.30 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
11.37 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
11.41 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
11.42 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .60
11.50 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .60
11.51 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
12 Access control. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .61
12.1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
12.2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
12.3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
12.4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
12.5 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
12.6 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
12.7 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
12.8 Grantor determination. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
13 SQL-client modules. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .81
13.4 Calls to an . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
13.5 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
14 Data manipulation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .84
14.1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84
14.2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .85
14.3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .85
14.4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
14.6 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86
14.7 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86
14.8 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
14.9 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88
14.10 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90
14.11 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
14.16 Effect of deleting rows from base tables. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92
14.17 Effect of deleting some rows from a derived table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93
14.19 Effect of inserting tables into base tables. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93
14.20 Effect of inserting a table into a derived table. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94
14.21 Effect of inserting a table into a viewed table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
14.22 Effect of replacing rows in base tables. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
14.23 Effect of replacing some rows in a derived table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97
© ISO/IEC 2005 – All rights reserved v
ISO/IEC 9075-2:2003/Cor.1:2005(E)
14.24 Effect of replacing some rows in a viewed table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97
14.27 Execution of triggers. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98
14.28 Effect of opening a cursor. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98
14.29 Determination of the current row of a cursor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100
14.30 Effect of closing a cursor. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102
16 Transaction management. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103
16.1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103
16.2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104
16.3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105
16.6 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106
16.7 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106
16.8 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
17 Connection management. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .109
17.1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109
18 Session management. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .110
18.1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110
18.2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111
18.3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111
19 Dynamic SQL. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .112
19.2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112
19.3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112
19.4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113
19.5 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113
19.6 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113
19.8 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113
19.9 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114
19.10 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115
19.11 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115
19.12 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115
19.13 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116
19.14 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116
19.15 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116
19.16 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118
19.17 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118
19.19 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119
19.20 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119
19.21 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120
19.22 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120
19.23 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120
vi © ISO/IEC 2005 – All rights reserved
ISO/IEC 9075-2:2003/Cor.1:2005(E)
22 Diagnostics management. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .121
22.1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121
23 Status codes. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .121
23.1 SQLSTATE. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121
24 Conformance. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122
24.3 Implied feature relationships of SQL/Foundation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122
Annex A SQL Conformance Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123
Annex B Implementation-defined elements. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .123
Annex C Implementation-dependent elements. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .124
Annex E Incompatibilities with ISO/IEC 9075:1999 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125
Annex F SQL feature taxonomy. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126
© ISO/IEC 2005 – All rights reserved vii
ISO/IEC 9075-2:2003/Cor.1:2005(E)
Tables
Table Page
32 SQLSTATE class and subclass values. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121
34 Implied feature relationships of SQL/Foundation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122
34 Implied feature relationships of SQL/Foundation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122
4 Feature taxonomy for optional features. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126
viii © ISO/IEC 2005 – All rights reserved
ISO/IEC 9075-2:2003/Cor.1:2005(E)
Information technology — Database languages — SQL —
Part 2:
Foundation (SQL/Foundation)
TECHNICAL CORRIGENDUM 1
Foreword
1. Rationale:Correct intent of this second edition.
th
Replace the 6 paragraph with:
This second edition of ISO/IEC 9075-2, together with ISO/IEC 9075-11:2003, cancels and replaces
ISO/IEC 9075-2:1999 and ISO/IEC 9075-5:1999, which have been technically revised. It also
incorporates the Amendments ISO/IEC 9075-2:1999/Amd.1:2001 and
ISO/IEC 9075-5:1999/Amd.1:2001 and the Technical Corrigenda ISO/IEC 9075-2:1999/Cor.1:2000,
ISO/IEC 9075-2:1999/Amd.1:2001/Cor.1:2003, ISO/IEC 9075-2:1999/Cor.2:2003,
ISO/IEC 9075-5:1999/Cor.1:2000, ISO/IEC 9075-5:1999/Amd.1:2001/Cor.1:2003 and
ISO/IEC 9075-5:1999/Cor.2:2003.
2. Rationale:Remove incorrect reference to obsolete part.
th th
In the 7 paragraph, delete the 5 bullet.
3 Definitions, notations, and conventions
3.1 Definitions
3.1.6 Definitions provided in Part 2
1. Rationale:Editorial.
Replace the definition of “assignable” with:
3.1.6.1 assignable (of types, taken pairwise): The characteristic of a data type T1 that permits a
value of T1 to be assigned to a site of a specified data type T2 (where T1 and T2 may be the
same data type).
© ISO/IEC 2005 – All rights reserved 1
ISO/IEC 9075-2:2003/Cor.1:2005(E)
2. Rationale:Restore the correct definition of “assignment”.
Replace the definition of “assignment” with:
3.1.6.2 assignment: The operation whose effect is to ensure that the value at a site T (known as the
target) is identical to a given value S (known as the source). Assignment is frequently indicated
by the use of the phrase “T is set to S” or “the value of T is set to S”.
3. Rationale:Remove erroneous word “comparable” from definition.
Replace the definition of “identical” with:
3.1.6.15 identical (of a pair of values): Indistinguishable, in the sense that it is impossible, by any
means specified in ISO/IEC 9075, to detect any difference between them. For the full definition,
see Subclause 9.8, “Determination of identical values”.
4. Rationale:Definitions required for correction to dynamic result sets.
Insert the following definitions:
3.1.6.29.1 result set: A sequence of rows brought into existence by opening a cursor and ranged over
by that cursor.
3.1.6.29.2 result set sequence: A sequence of returned result sets.
3.1.6.29.3 returned result set: A result set created during execution of an SQL-invoked procedure and
not destroyed when that execution terminates. Such a result set can be accessed by using a
cursor other than the one that brought it into existence.
3.1.6.42.1 with-return cursor: A cursor that, when opened, creates a result set that is capable of
becoming a returned result set. The WITH RETURN option of and cursor statement> specifies a with-return cursor.
4 Concepts
4.13 Columns, fields and attributes
1. Rationale:Missing item in the column descriptor.
th
In the 6 paragraph, insert the following item to the list of items in a column descriptor:
— An indication of whether C is updatable or not.
2 © ISO/IEC 2005 – All rights reserved
ISO/IEC 9075-2:2003/Cor.1:2005(E)
4.14 Tables
4.14.2 Types of tables
1. Rationale:Editorial.
st
Replace the 1 paragraph with:
A table is either a base table, a derived table, a transient table, or a viewed table. A base table is either a
persistent base table, a global temporary table, a created local temporary table, or a declared local temporary
table.
2. Rationale:Delete obsolete reference to element type of a .
rd
Replace the 3 paragraph with:
A derived table is a table derived directly or indirectly from one or more other tables by the evaluation of
a .
3. Rationale:Editorial.
th
Append the following text to the 4 paragraph:
Base tables and views are identified by
cannot be used for both a base table and a view.
4. Rationale:Define view components, for use in view component privilege descriptors.
th
Insert the following paragraph after the 4 paragraph:
A ,
a is called a view component.
4.14.3 Table descriptors
1. Rationale:Track simple updatability in derived table descriptors.
th
In the 5 paragraph, insert the following item to the list of items in a derived table descriptor:
— An indication of whether the derived table is simply updatable or not.
© ISO/IEC 2005 – All rights reserved 3
ISO/IEC 9075-2:2003/Cor.1:2005(E)
4.17 Integrity constraints
4.17.1 Overview of integrity constraints
1. Rationale:Every constraint descriptor is to include a .
st
Insert the following at the end of the 1 paragraph:
— An applicable .
NOTE 28.1 — The applicable included in the descriptor is not necessarily the that might
be contained in the SQL-statement whose execution brings the constraint descriptor into existence. The General Rules for the
SQL-statement in question specify the applicable to be included in the constraint descriptor, in some cases
deriving it from a given . For example, the syntax for table constraints allows universal quantification over the
rows of the table in question to be implicit; in the applicable included in the descriptor, that universal quantifi-
cation is made explicit, to allow for uniform treatment of all types of constraint.
4.17.2 Checking of constraints
1. Rationale:Clarify when constraints are checked.
Replace the entire Subclause with:
Every constraint is either deferrable or non-deferrable. Within an SQL-transaction, every constraint has
a constraint mode; if a constraint is nondeferrable, then its constraint mode is always immediate; otherwise,
it is either immediate or deferred. Every constraint has an initial constraint mode that specifies the constraint
mode for that constraint at the start of each SQL-transaction and immediately after definition of that con-
straint. If a constraint is deferrable, then its constraint mode within the current SQL-transaction may be
changed (from immediate to deferred, or from deferred to immediate) by execution of a mode statement>.
The checking of a constraint depends on its constraint mode within the current SQL-transaction. Whenever
an SQL-statement is executed, every constraint whose mode is immediate is checked, at a certain point
after any changes to SQL-data and schemas resulting from that execution have been effected, to see if it
is satisfied. A constraint is satisfied if and only if the applicable s included in its
descriptor evaluates to True or Unknown. If any constraint is not satisfied, then any changes to SQL-data
or schemas resulting from executing that statement are canceled. (See the General Rules of Subclause 13.5,
“”.)
NOTE 29 — This includes SQL-statements that are executed as a direct result or an indirect result of executing a different SQL-
statement. It also includes statements whose effects explicitly or implicitly include setting the constraint mode to immediate.
The constraint mode can be set to immediate either explicitly by execution of a statement>, or implicitly at the end of the current SQLtransaction.
When a is executed, all constraints are effectively checked and, if any constraint is
not satisfied, then an exception condition is raised and the SQL-transaction is terminated by an implicit
.
4 © ISO/IEC 2005 – All rights reserved
ISO/IEC 9075-2:2003/Cor.1:2005(E)
4.17.3 Table constraints
1. Rationale:Every constraint descriptor includes a .
st
Replace the 1 paragraph with:
A constraint whose definition is part of some base table definition is a table constraint. Being part of a
particular table definition allows for convenient syntactic shorthands in which universal quantification
over the rows of the table in question is implied.
A table constraint is either a unique constraint, a referential constraint, or a table check constraint. A table
constraint descriptor is either a unique constraint descriptor, a referential constraint descriptor, or a table
check constraint descriptor, respectively.
2. Rationale:Every constraint descriptor includes a .
th th
Delete the 11 and 12 paragraphs
4.17.4 Domain constraints
1. Rationale:Every constraint descriptor includes a , and clarify how domain constraints
are applied.
Replace the entire Subclause with:
A domain constraint is a constraint that is specified for a domain. It is applied to all columns that are based
on that domain, and to all values cast to that domain.
A domain constraint is described by a domain constraint descriptor. In addition to the components of every
constraint descriptor, a domain constraint descriptor includes:
— The template for the generation of domain constraint usage s.
— A possibly empty set of domain constraint usages.
A domain constraint usage descriptor is created implicitly by the evaluation of a
whose is a . If C is such a column and D is the domain
identified by the , then every domain constraint DC defined for D implies a domain con-
straint usage, to the effect that each value in C satisfies DC.
In addition to the components of every constraint descriptor, a domain constraint usage descriptor includes:
— The name of the applicable column.
— The applicable that evaluates whether each value in C satisfies DC.
A domain constraint is satisfied by SQL-data if and only if, for every table T that has a column named C
based on that domain, the applicable recorded in the appropriate domain constraint
usage evaluates to True or Unknown.
© ISO/IEC 2005 – All rights reserved 5
ISO/IEC 9075-2:2003/Cor.1:2005(E)
A domain constraint is satisfied by the result of a if and only if the specified template
, with each occurrence of the VALUE replaced by that
result, evaluates to True or Unknown.
4.17.5 Assertions
1. Rationale:Every constraint descriptor includes a .
Replace the entire Subclause with:
An assertion is a constraint whose descriptor is an independent schema component not included in any
table descriptor.
4.18 Functional dependencies
4.18.6 Known functional dependencies in a
1. Rationale:Rules for inheriting funtional dependencies in were omitted.
th
Insert the following after the 5 paragraph:
If A↦ B is a known functional dependency in T1, CA is the counterpart of A in R, and CB is the counterpart
of B in R, then CA↦ CB is a known functional dependency in R when one of the following is true:
— CROSS, INNER, or LEFT is specified.
— RIGHT or FULL is specified and at least one column in A is known not nullable.
If A↦ B is a known functional dependency in T2, CA is the counterpart of A in R, and CB is the counterpart
of B in R, then CA↦ CB is a known functional dependency in R when one of the following is true:
— CROSS, INNER, or RIGHT is specified.
— LEFT or FULL is specified and at least one column in A is known not nullable.
4.18.15Known functional dependencies in a
1. Rationale:Remove incorrect reference to .
nd
Replace the 2 paragraph with:
A that is a that is a that is a is covered
by previous Subclauses of this Clause.
6 © ISO/IEC 2005 – All rights reserved
ISO/IEC 9075-2:2003/Cor.1:2005(E)
4.20 SQL-Schemas
1. Rationale:Editorial.
th
Replace the 5 paragraph with:
Base tables and views are identified by
followed by a , followed by an . The identifies the schema that
includes the table descriptor of the base table or view identified by the
of base tables and views defined in different schemas can have equivalent s.
NOTE 44.1 — Equivalence of s is defined in Subclause 5.2, “ and ”.
4.27 SQL-invoked routines
4.27.3 Execution of SQL-invoked routines
1. Rationale:The treatment of the authorization stack is inconsistent with Subclauses 4.34.1.1 and 10.4.
st nd rd th th th th
Replace the 1 , 2 , 3 , 4 , 5 , 6 and 7 paragraphs with:
When an SQL-invoked routine is invoked, a copy of the current SQL-session context is pushed onto the
stack and some values are modified (see the General Rules of Subclause 10.4, “”)
before the is executed. The treatment of the authorization stack is described in
Subclause 4.34.1.1, “SQL-session authorization identifiers”.
4.27.4 Routine descriptors
1. Rationale:Change of terminology.
st th
In the 1 paragraph, replace the 8 bullet with:
— If the SQL-invoked routine is an SQL-invoked procedure, then the maximum number of returned
result sets.
2. Rationale:An external routine does not have two authorization identifiers.
st th th
In the 1 paragraph, in the 15 bulleted item, delete the 5 bulleted subitem (“The external routine
authorization identifier . ”).
© ISO/IEC 2005 – All rights reserved 7
ISO/IEC 9075-2:2003/Cor.1:2005(E)
4.27.5 Result sets returned by SQL-invoked procedures
1. Rationale:New subclause for result sets returned by SQL-invoked procedures.
Insert the following new subclause:
4.27.5 Result sets returned by SQL-invoked procedures
NOTE 48.1 — Subclause 3.1.6, “De
...








Questions, Comments and Discussion
Ask us and Technical Secretary will try to provide an answer. You can facilitate discussion about the standard in here.
Loading comments...