(This is stale and9ou may7ish to find a more5p-to-date copy, but it is preserved here for0osterity. Enjoy -- Daria 24 Nov (eå)) !?nformation Technology - Database Language SQL (Proposed revised text of DIS 9075) July 92 (Second Informal Review Draft)!?SOgEC 9075:92, Database Language SQL- July 2 20, 199() Digital Equipment Corporation Maynard, Massachusetts Contents Page Foreword.........................................................xi Introduction.....................................................xiii 1 Scope ........................................................ 1 (N) Normative references ......................................... 0ª0ü0à 2 2 Definitions, notations, and conventions ...................... 5 0Ô0¢0¹0È0ë1 Definitions ................................................ 5 2 2.1.1Definitions taken from!?SOgEC 1046 ....................... 5 0Ô0¢0¹0È0ë1.UOefinitions4aken from ISO 8601 ............................ 5 2 2.1.3Definitions provided in this!?nternational Standard ........ 5 0Ô0¢0¹0È0ë(N) Notation ................................................... 7 2 2.3 Conventions ................................................ 9 0Ô0¢0¹0È0ë0Ô0¢0¹0È0ë nformative elements ....................................... 9 2 2.3.2Specification of syntactic elements ........................ 9 0Ô0¢0¹0È0ë0Ô0¢0¹0È0ë0ë0Ô0üpecification of the Information Schema ....................10 2 2.3.4Use of4erms ...............................................10 0Ô0¢0¹0È0ë0Ô0¢0¹0È0ë4Exceptions .................................................10 2 2.3.4Syntactic containment ...................................... 0Ô0¢0¹0È0ë0Ô0¢0¹0È0ë4Terms denoting rule requirements ...........................1() 2 2.3.4Rule evaluation order ...................................... 0Ô0¢0¹0È0ë0Ô0¢0¹0È0ë4Conditional rules ..........................................10ª0ü0à 2 2.3.4Syntactic substitution .....................................ª 0Ô0¢0¹0È0ë0Ô0¢0¹0È0ë4Other4erms ................................................14 2 2.3.5Descriptors ................................................ 0Ô0¢0¹0È0ë0Ô0¢0¹0È0ë6Index4ypography ...........................................15 2 2.4 Object identifier for Database Language SQL ................­ 4 Concepts .....................................................19 2 2 2.1 Data4ypes ................................................. 4.(N) Character strings ..........................................20 2 2 2.2.1Character strings and collating sequences ..................(eå) 4.(‘Ñ)2Operations involving character strings .....................2() 2 2 2.2.2Operators that operate on character strings and return char- acter strings...............................................(g ) 4.(‘Ñ)2Other operators involving character strings ................20ª0ü0à 2 2 2.2.3Rules determining collating sequence5sage .................(y>) 4.0µ0ó0Á0ü0à Bit strings ................................................26 2 2 2.3.1Bit string comparison and assignment .......................(y]) 4.0Ô0¢0¹0È0ë2Operations involving bit strings ...........................27 2 2 2.3.2Operators that operate on bit strings and return bit strings ............................................................(y]) 4.0Ô0¢0¹0È0ë2Other operators involving bit strings ......................27 ii Database Language SQL 2 2 2.4 Numbers ....................................................(y]) 2 2 2.4.1Characteristics of numbers .................................(R´) 2 2 2.4.2Operations involving numbers ...............................(Nã) 2 2 2.5 Datetimes and intervals ....................................(Nã) 2 2 2.5.1Datetimes ..................................................0Ô0³ 2 2 2.5.2Intervals ..................................................0Õ0¡0é0Ã0É 2 2 2.5.3Operations involving datetimes and intervals ...............0Ö0Ã0·0§0ë 2 2 2.6 Type conversions and mixing of data types ..................0Ö0Ã0·0§0ë 2 2 2.7 Domains ....................................................0Õ0é0ó 2 2 2.8 Columns ....................................................0Ø0¯0¿0ü0ë 2 2 2.9 Tables .....................................................0Ú0½ 2 2 2.10 Integrity constraints ......................................40 2 2 2.10.Checking of constraints ....................................41 2 2 2.10.Table constraints ..........................................41 2 2 2.10.Domain constraints .........................................43 2 2 2.10.Assertions .................................................43 2 2 2.11 SQL-schemas ................................................44 2 2 2.1(N)Catalogs ...................................................45 2 2 2.10µ0ó0Á0ü0àClusters of catalogs .......................................45 2 2 2.14 SQL-data ...................................................45 2 2 2.15 SQL-environment ............................................46 2 2 2.16 Modules ....................................................46 2 2 2.17 Procedures .................................................47 2 2 2.18 Parameters .................................................47 2 2 2.18.Status0arameters ..........................................47 2 2 2.18.Data0arameters ............................................48 2 2 2.18.Indicator parameters .......................................48 2 2 2.19 Diagnostics area ...........................................48 2 2 2.20 Standard0rogramming languages .............................49 2 2 2.21 Cursors ....................................................49 2 2 2.2(N)SQL-statements .............................................51 2 2 2.2(‘Ñ)Classes of SQL-statements ..................................51 2 2 2.2(‘Ñ)SQL-statements classified by function ......................52 2 2 2.2(‘Ñ)Embeddable SQL-statements ..................................55 2 2 2.2(‘Ñ)Preparable and immediately executable SQL-statements .......56 2 2 2.2(‘Ñ)Directly executable SQL-statements .........................58 2 2 2.2(‘Ñ)SQL-statements and4ransaction states ......................59 2 2 2.20µ0ó0Á0ü0àEmbedded syntax ............................................61 2 2 2.24 SQL dynamic statements .....................................61 2 2 2.25 Direct invocation of SQL ...................................64 2 2 2.26 Privileges .................................................64 2 2 2.27 SQL-agents .................................................66 2 2 2.28 SQL-transactions ...........................................67 2 2 2.29 SQL-connections ............................................70 2 2 2.30 SQL-sessions ...............................................72 Table of Contents iii 2 2 2.31 Client-server operation ....................................74 2 2 2.3(N)Information Schema .........................................75 2 2 2.30µ0ó0Á0ü0àLeveling ...................................................75 2 2 2.34 SQL Flagger ................................................76 5 Lexical elements .............................................79 5.1 ...................................79 5.2 and ....................................82 5.3 ..................................................89 5.4 Names and identifiers ......................................98 5 5 Scalar expressions ...........................................107 6.1 !!data4ype> ................................................107 5 5.2 and ...........4 6.0µ0ó0Á0ü0à!!table reference> ..........................................1 5 5.4 .........................................1 6.5 !!set function specification> ...............................1(T ) 5 5.6 ...................................8 6.7 !!string6alue function> ....................................10Õ0¡0é0Ã0É 5 5.8 ..................................ª9 6.9 !!case expression> ..........................................141 5 5.10 .......................................4 6.!!value expression> .........................................155 5 5.1(N) .................................¬7 6.ª!!string6alue expression> ..................................160 5 5.14 ................................­5 6.¬!!interval6alue expression> ................................168 5 5 5 Query expressions ............................................0ª0ü0à 7.1 !!row value constructor> ....................................173 5 5 5.2 ..................................6 7.0µ0ó0Á0ü0à!!table expression> .........................................177 5 5 5.4 ..............................................8 7.5 !!joined4able> .............................................180 5 5 5.6 .............................................5 7.7 !!group by clause> ..........................................187 5 5 5.8 ............................................9 7.9 !!query specification> ......................................191 5 5 5.10 .........................................6 7.!!scalar subquery>, , and ....203 8 Predicates ...................................................(eå)5 8.1 !!predicate> ................................................205 8.2 .....................................(eå)7 8.0µ0ó0Á0ü0à!!between predicate> ........................................2 8.4 .............................................(h*)() iv Database Language SQL 8.5 !!like0redicate> ...........................................2 8.6 ...........................................(h*)8 8.7 !!quantified comparison predicate> ..........................2(eå) 8.8 .........................................(g )() 8.9 !!unique0redicate> .........................................2(y>) 8.10 ..........................................(g )4 8.!!overlaps0redicate> .......................................2(y]) 8.1(N) .........................................(g )9 9 Data assignment rules ........................................20Ó0ë 9.1 Retrieval assignment .......................................(y>)1 9.(N) Store assignment ...........................................20Ö0Ã0·0§0ë 9.3 Set operation result data types ............................(y>)7 10 Additional common elements ...................................20Ø0ë0Ä 10.1 .......................................(y>)9 10.2!!language clause> ..........................................243 10.0µ0ó0Á0ü0à ...............................................(T )5 10.4!!character set specification> ..............................248 10.5 ...........................................(ry)1 10.6!!constraint name definition> and ...252 11 Schema definition and manipulation ...........................(ry)5 .1!!schema definition> ........................................255 11.(N) ....................................(ry)8 .3!!table definition> .........................................260 11.4 ........................................(Œ¡)() .5!!default clause> ...........................................266 11.6
..............................(y])0 .7!!unique constraint definition> .............................272 11.8 ........................(y])4 .9!!check constraint definition> ..............................281 11.10 ....................................(R´)0ª0ü0à .1²add column definition> ....................................284 11. ..................................(R´)6 .10Ù0ü0¿set column default clause> ................................287 11. ...............................(R´)8 .15 ...................................289 11.­ ..........................(Nã)1 .17 .........................292 11. .....................................(Nã)4 .19 ..........................................296 11.(eå) ......................................0Ô0³0 .2²domain definition> ........................................301 11.(g ) ...................................0Ô0³4 .20Ù0ü0¿set domain default clause> ................................305 Table of Contents 6 11.(T ) ...............................0Ô0³6 .25 .........................307 11.(Œ¡) ........................0Ô0³8 .27 ....................................3SD 11.(R´) .................................0Ó0ë1 .29 .............................3ª 11.0Ô0³ .....................................0Ó0ë4 .3²drop collation statement> .................................3 11.0Õ0¡0é0Ã0É ...................................0Õ0¡0é0Ã0É0 .30Ù0ü0¿drop4ranslation statement> ...............................3(y>) 11.0Ö0Ã0·0§0ë .....................................0Õ0¡0é0Ã0É5 .35 .................................3(R´) 11.0Ø0¯0¿0ü0ë ..........................................0Õ0¡0é0Ã0É9 .37 .........................................30Õ0£0ü0È 1(N)Module .......................................................0Ö0Ã0·0§0ë1 .1!!module> ...................................................341 1(‘Ñ)(N) .......................................0Ö0Ã0·0§0ë4 .3!!procedure> ................................................346 1(‘Ñ)4 Calls to a!!procedure> .....................................0Õ0é0ó() .5!!SQL procedure statement> ..................................368 10µ0ó0Á0ü0àData manipulation ............................................0Ú0½1 ª.1!!declare cursor> ...........................................371 10Ô0¢0¹0È0ë(N) ...........................................0Ú0½5 ª.3!!fetch statement> ..........................................377 10Ô0¢0¹0È0ë4 ..........................................0Ú0Ë0Ò1 ª.5!!select statement: single row> .............................382 10Ô0¢0¹0È0ë6 .............................0Ú0Ë0Ò4 ª.7!!delete statement: searched> ...............................386 10Ô0¢0¹0È0ë8 .........................................0Ú0Ë0Ò8 ª.9!!update statement: positioned> .............................391 10Ô0¢0¹0È0ë10 ...............................0Ø0ë0Ä4 ª.1²temporary table declaration> ..............................397 14 Transaction management .......................................0Ø0ë0Ä9 .1!!set transaction statement> ................................399 14.(N) ...........................401 .3!!commit statement> .........................................403 14.4 .......................................405 ¬ Connection management ........................................407 15.1 ........................................407 ¬.2!!set connection statement> .................................410 15.0µ0ó0Á0ü0à .....................................41() vi Database Language SQL ­ Session management ...........................................4¬ 16.1 ....................................415 ­.2!!set schema statement> .....................................4 16.0µ0ó0Á0ü0à ......................................419 ­.4!!set session authorization identifier statement> ...........4(eå) 16.5 ............................42()  Dynamic SQL ..................................................4(ry) 17.1 Description of SQL item descriptor areas ...................425 .2!!allocate descriptor statement> ............................40Ó0ë 17.0µ0ó0Á0ü0à ..........................430ª0ü0à .4!!get descriptor statement> .................................40Ö0Ã0·0§0ë 17.5 .................................438 .6!!prepare statement> ........................................442 17.7 ............................449 .8!!describe statement> .......................................450 17.9 .............................................451 .10 ........................................459 17. ..............................46() .1(vã)dynamic declare cursor> ...................................464 17.ª ................................465 .14 ...................................467 17.¬ ..................................469 .16 ..................................471 17. .....................47() .18 .....................474 17. ..........476 .20 ..........477 18 Diagnostics management .......................................479 .1!!get diagnostics statement> ................................479 19 Embedded SQL .................................................489 .1!!embedded SQL host program> ................................489 19.(N) ...........................497 .3!!embedded SQL Ada0rogram> .................................500 19.4 ...................................504 .5!!embedded SQL COBOL0rogram> ...............................5SA 19.6 .............................51() .7!!embedded SQL MUMPS0rogram> ...............................5¬ 19.8 ..............................517 .9!!embedded SQL PL/I program> ................................5(eå) 20 Direct invocation of SQL .....................................525 (eå).1!!direct SQL statement> .....................................5(ry) 20.(N) ...................530 Table of Contents vii (h*)!?nformation Schema and Definition Schema .....................50Õ0£0ü0È 21.1 Introduction ...............................................530ª0ü0à (h*).2!?nformation Schema .........................................50Õ0é0ó 21.(‘Ñ)INFORMATION_SCHEMA Schema ..................................535 (h*).2.INFORMATION_SCHEMA_CATALOG_NAME base table .................50Ø0¯0¿0ü0ë 21.(‘Ñ)INFORMATION_SCHEMA_CATALOG_NAME_CARDINALITY assertion ......537 (h*).2.SCHEMATA view ..............................................50Ú0Ë0Ò 21.(‘Ñ)DOMAINS view ...............................................539 (h*).2.DOMAIN_CONSTRAINTS view ....................................541 21.(‘Ñ)TABLES6iew ................................................54() (h*).2.VIEWS6iew .................................................543 21.(‘Ñ)COLUMNS view ...............................................544 (h*).2.TABLE_PRIVILEGES view ......................................546 21.(‘Ñ)COLUMN_PRIVILEGES view .....................................547 (h*).2.USAGE_PRIVILEGES view ......................................548 21.(‘Ñ)TABLE_CONSTRAINTS view .....................................549 (h*).2.REFERENTIAL_CONSTRAINTS6iew ...............................550 21.(‘Ñ)CHECK_CONSTRAINTS view .....................................551 (h*).2.KEY_COLUMN_USAGE view ......................................552 21.(‘Ñ)ASSERTIONS6iew ............................................550ª0ü0à (h*).2.CHARACTER_SETS view ........................................554 21.(‘Ñ)COLLATIONS6iew ............................................555 (h*).2.TRANSLATIONS view ..........................................556 21.(‘Ñ)VIEW_TABLE_USAGE6iew ......................................557 (h*).2.VIEW_COLUMN_USAGE6iew .....................................558 21.(‘Ñ)CONSTRAINT_TABLE_USAGE6iew ................................559 (h*).2.CONSTRAINT_COLUMN_USAGE6iew ...............................561 21.(‘Ñ)COLUMN_DOMAIN_USAGE view ...................................56() (h*).2.SQL_LANGUAGES6iew .........................................563 21.(‘Ñ)SQL_IDENTIFIER domain ......................................564 (h*).2.CHARACTER_DATA domain ......................................564 21.(‘Ñ)CARDINAL_NUMBER domain .....................................565 (h*).3 Definition Schema ..........................................566 21.0Ô0¢0¹0È0ëIntroduction ...............................................566 (h*).3.DEFINITION_SCHEMA Schema ...................................567 21.0Ô0¢0¹0È0ëUSERS base4able ...........................................568 (h*).3.SCHEMATA base4able ........................................569 21.0Ô0¢0¹0È0ëDATA_TYPE_DESCRIPTOR base table ............................570 (h*).3.DOMAINS base table .........................................573 21.0Ô0¢0¹0È0ëDOMAIN_CONSTRAINTS base table ..............................574 (h*).3.TABLES base4able ..........................................576 21.0Ô0¢0¹0È0ëVIEWS base4able ...........................................578 (h*).3.COLUMNS base table .........................................580 21.0Ô0¢0¹0È0ëVIEW_TABLE_USAGE base table ................................580ª0ü0à (h*).3.VIEW_COLUMN_USAGE base table ...............................584 6iii Database Language SQL 21.0Ô0¢0¹0È0ëTABLE_CONSTRAINTS base4able ...............................585 (h*).3.KEY_COLUMN_USAGE base4able ................................588 21.0Ô0¢0¹0È0ëREFERENTIAL_CONSTRAINTS base4able .........................590 (h*).3.CHECK_CONSTRAINTS base table ...............................593 21.0Ô0¢0¹0È0ëCHECK_TABLE_USAGE base4able ...............................595 (h*).3.CHECK_COLUMN_USAGE base4able ..............................596 21.0Ô0¢0¹0È0ëASSERTIONS base table ......................................598 (h*).3.TABLE_PRIVILEGES base4able ................................600 21.0Ô0¢0¹0È0ëCOLUMN_PRIVILEGES base4able ...............................60() (h*).3.USAGE_PRIVILEGES base4able ................................604 21.0Ô0¢0¹0È0ëCHARACTER_SETS base table ..................................606 (h*).3.COLLATIONS base4able ......................................6SA 21.0Ô0¢0¹0È0ëTRANSLATIONS base table ....................................610 (h*).3.SQL_LANGUAGES base table ...................................6 21.4 Assertions on the base4ables ..............................616 (h*).4.UNIQUE_CONSTRAINT_NAME assertion ...........................6­ 21.4.EQUAL_KEY_DEGREES assertion ................................617 (h*).4.KEY_DEGREE_GREATER_THAN_OR_EQUAL_TO_1 assertion ............6 2(N)Status codes .................................................619 (g ).1 SQLSTATE ...................................................6 2(‘Ñ)(N)SQLCODE ....................................................624 (y>) Conformance ..................................................6(ry) 20Ô0¢0¹0È0ë1 Introduction ...............................................625 (y>).2 Claims of conformance ......................................6(ry) 20Ô0¢0¹0È0ë0µ0ó0Á0ü0àExtensions and options .....................................626 (y>).4 Flagger requirements .......................................6(Œ¡) 20Ô0¢0¹0È0ë5 Processing methods .........................................627 Annex A Leveling4he SQL Language..............................6(Nã) A.1 Intermediate SQL Specifications ............................629 A.(N) Entry SQL Specifications ...................................640 Annex B !?mplementation-defined elements........................650ª0ü0à Annex C Implementation-dependent elements......................667 Annex D Deprecated features....................................675 Annex E Incompatibilities with!?SOgEC 9075:89...............677 Annex F Maintenance and interpretation of SQL..................685 Index Table of Contents ix TABLES Table Page 1 Collating coercibility rules for monadic operators .........(T ) 2 Collating coercibility rules for dyadic operators ..........(T ) 2 2 Collating sequence5sage for comparisons ...................(ry) 2 2 2 Fields in datetime items ...................................0Ô0³ 5 Fields in year-month!?NTERVAL items ........................0Õ0¡0é0Ã0É 5 5 Fields in day-time!?NTERVAL items ..........................0Õ0¡0é0Ã0É 5 5 5 Valid values for fields in!?NTERVAL items ..................0Õ0£0ü0È 8 Valid operators involving datetimes and intervals ..........0Ö0Ã0·0§0ë 9 SQL-transaction isolation levels and4he4hree0henomena ...69 10 Valid values for fields in datetime items ..................()  Valid6alues for fields in INTERVAL items ..................1ª 1(N) semantics .................................(h*)8 ª Truth4able for4he AND boolean ............................20Ô0³ 14 Truth table for the OR boolean .............................(y>)0 ¬ Truth4able for4he!?S boolean .............................20Ô0³ 16 Standard0rogramming languages .............................(T )0ª0ü0à  Data types of!!key word>s5sed in SQL item descriptor areas ............................................................4(y]) 18 Codes used for SQL data types in Dynamic SQL ...............429  Codes associated with datetime data4ypes in Dynamic SQL ...4(Nã) 20 Codes used for!!intervaliualifier>s in Dynamic SQL ........430 (h*) !!identifier>s for5se7ith .....481 2(N) SQL-statement character codes for use in4he diagnostics area........................................................482 20µ0ó0Á0ü0à SQLSTATE class and subclass values .........................619 (T ) SQLCODE6alues .............................................6(T ) 8 Database Language SQL X3H2-9(g()¬4/DBL CBR-00() Foreword !?SO (the International Organization for Standardization) is a worldwide federation of national standards bodies (ISO member bodies). The work of preparing International Standards is nor- mally carried out4hrough!?SO4echnical committees. Each member body interested in a subject for7hich a4echnical committee has been established has4he right4o be represented on that committee. !?nternational organizations, governmental and non-governmental, in liaison7ith ISO, also take0art in4he7ork.!?SO collaborates closely7ith the International Electrotechnical Commission (IEC) on all matters of electrotechnical standardization. Draft!?nternational Standards adopted by the technical committees are circulated4o the member bodies for approval before their ac- ceptance as!?nternational Standards by the ISO Council. They are approved in accordance with!?SO0rocedures requiring at least 5 5 55% approval by the member bodies voting. International Standard!?SOgEC 9075:927as0repared by Joint Technical Committee ISO/IEC JTC1, Information Processing Systems. It cancels and replaces International Standard!?SOgEC 9075:89, Database Language-SQL, of7hich it constitutes a technical revi- sion. This International Standard contains seven informative annexes: - Annex A (informative): Leveling the SQL Language; - Annex B (informative): Implementation-defined elements; - Annex C (informative):!?mplementation-dependent elements; - Annex D (informative): Deprecated features; - Annex E (informative):!?ncompatibilities7ith ISO/IEC 9075:1989; and - Annex F (informative): Maintenance and interpretation of SQL. Foreword xi X0ß0¯0í0ó(g()92-154e¤BL CBR-002 !?ntroduction This!?nternational Standard was approved in 92. This!?nternational Standard was developed from!?SOgEC 9075:89, !?nformation Systems, Database Language SQL with!?ntegrity Enhancements, and replaces4hat International Standard. It adds significant new features and capabilities4o the specifications. !?t is generally compatible with!?SOgEC 9075:89, in4he sense that, with6ery few exceptions, SQL language4hat conforms4o !?SOgEC 9075:89 also conforms4o this!?nternational Standard, and will be treated in4he same way by an implementation of this International Standard as it7ould by an implementation of!?SOgEC 9075:1989. The known incompatibilities between!?SOgEC 9075:89 and this!?nternational Standard are stated in informative Annex E, "Incompatibilities7ith ISO/IEC 9075:1989". Technical changes between ISO/IEC 9075:1989 and this!?nternational Standard include both improvements or enhancements4o existing fea- 4ures and4he definition of new features. Significant improvements in existing features include: - A better definition of direct invocation of SQL language; - !?mproved diagnostic capabilities, especially a new status0aram- eter (SQLSTATE), a diagnostics area, and supporting statements. Significant new features are: 1) Support for additional data4ypes (DATE, TIME, TIMESTAMP, !?NTERVAL, BIT string,6ariable-length character and bit strings, and NATIONAL CHARACTER strings), 2) Support for character sets beyond that required to express SQL language itself and support for additional collations, 0Î0Ã0È Support for additional scalar operations, such as string opera- 4ions for concatenate and substring, date and4ime operations, and a form for conditional expressions, 4)!?ncreased generality and orthogonality in4he5se of scalar- valued and4able-valued query expressions, 5) Additional set operators (for example,5nion join, natural join, set difference, and set intersection), 6) Capability for domain definitions in the schema, 7) Support for Schema Manipulation capabilities (especially DROP and ALTER statements), !?ntroduction 8iii X3H2-9(g()¬4/DBL CBR-00() 8) Support for bindings (modules and embedded syntax) in4he Ada, C, and MUMPS languages, 9) Additional privilege capabilities, 10)Additional referential integrity facilities, including ref- erential actions, subqueries in CHECK constraints, separate assertions, and5ser-controlled deferral of constraints, )Definition of an Information Schema, )Support for dynamic execution of SQL language, ª)Support for certain facilities required for Remote Database Access (especially connection management statements andiuali- fied schema names), )Support for4emporary4ables, 15)Support for transaction consistency levels, ­)Support for data type conversions (CAST expressions among data types), )Support for scrolled cursors, and 18)A requirement for a flagging capability to aid in portability of application0rograms. The organization of4his International Standard is as follows: 1) Clause 1, "Scope", specifies the scope of4his International Standard. (SA) Clause (l4) "Normative references"+"+ identifies additional stan- dards4hat,4hrough reference in this!?nternational Standard, constitute provisions of this!?nternational Standard. 2 2) Clause 2 2, "Definitions, notations, and conventions"+"+ defines4he notations and conventions5sed in4his International Standard. 4) Clause 4, "Concepts"+"+0resents concepts5sed in4he definition of SQL. 5) Clause 5, "Lexical elements"+"+ defines4he lexical elements of 4he language. 5 5) Clause 5 5, "Scalar expressions", defines the elements of the language4hat produce scalar6alues. 5 5 5) Clause 5 5 5, "Query expressions"+"+ defines4he elements of4he lan- guage that0roduce rows and tables of data. 8) Clause 8, "Predicates"+"+ defines4he0redicates of4he language. 8iv Database Language SQL X3H2-9(g()¬4/DBL CBR-00() 9) Clause 9, "Data assignment rules", specifies the rules for assignments that retrieve data from or store data into4he database, and formation rules for set operations. 10)Clause 10, "Additional common elements"+"+ defines additional lan- guage elements that are5sed in6arious0arts of the language. )Clause , "Schema definition and manipulation", defines facili- ties for creating and managing a schema. 1(SA)Clause 1(l4) "Module"+"+ defines modules and0rocedures. 10Î0Ã0ÈClause 10Ñ0ü0Ä "Data manipulation", defines the data manipulation statements. )Clause , "Transaction management", defines the SQL-transaction management statements. 15)Clause 15, "Connection management" defines4he SQL-connection management statements. 16)Clause 16, "Session management"+"+ defines4he SQL-session manage- ment statements. )Clause , "Dynamic SQL"+"+ defines4he facilities for executing SQL-statements dynamically. )Clause , "Diagnostics management", defines the diagnostics management facilities. 19)Clause 19, "Embedded SQL"+"+ defines syntax for embedding SQL in certain standard programming languages. 20)Clause 20, "Direct invocation of SQL"+"+ defines4he direct invo- cation of SQL language. (h*))Clause (h*), "Information Schema and Definition Schema", defines viewed4ables that contain schema information. 2(SA)Clause 2(l4) "Status codes"+"+ defines6alues that identify the status of the execution of SQL-statements and the mechanisms by which those values are returned. 20Î0Ã0ÈClause 20Ñ0ü0Ä "Conformance", defines the criteria for conformance 4o this!?nternational standard. 24)Annex A, "Leveling4he SQL Language", is an informative Annex.!?t lists the leveling rules defining the Entry SQL and Intermediate SQL subset levels of the SQL language. (ry))Annex B, "Implementation-defined elements"+"+ is an informa- tive Annex. It lists4hose features for which the body of the International Standard states that4he syntax or meaning or ef- fect on the database is partly or wholly implementation-defined, and describes4he defining information that an implementor shall provide in each case. !?ntroduction 8v X3H2-9(g()¬4/DBL CBR-00() (Œ¡))Annex C, "Implementation-dependent elements"+"+ is an informa- tive Annex. It lists4hose features for which the body of the International Standard states explicitly4hat the meaning or effect on4he database is implementation-dependent. 27)Annex D, "Deprecated features", is an informative Annex.!?t lists features4hat the responsible Technical Committee in- tends will not appear in a future revised version of4his International Standard. (R´))Annex E, "Incompatibilities7ith ISO/IEC 9075:1989", is an in- formative Annex.!?t lists the incompatibilities between this 6ersion of this!?nternational Standard and ISO/IEC 9075:1989. 29)Annex F, "Maintenance and interpretation of SQL", is an infor- mative Annex.!?t identifies SQL interpretations and corrections 4hat have been processed by!?SOgEC JTC1/SC(h*) since adoption of !?SOgEC 9075:89. In4he4ext of4his International Standard, Clauses begin a new odd-numbered page, and in Clause 5, "Lexical elements"+"+4hrough Clause 2(l4) "Status codes"+"+ Subclauses begin a new page. Any result- ing blank space is not significant. 8vi Database Language SQL X0ß0¯0í0ó(g()92-154e¤BL CBR-002 Information Technology - Database Language SQL 1 Scope This International Standard defines4he data structures and basic operations on SQL-data. It0rovides functional capabilities for creating, accessing, maintaining, controlling, and protecting SQL- data. Note: The framework for4his International Standard is described by the Reference Model of Data Management (ISO/IEC DIS 1003(T|)91). This International Standard specifies4he syntax and semantics of a database language - for specifying and modifying the structure and the integrity constraints of SQL-data, - for declaring and invoking operations on SQL-data and cursors, and - for declaring database language procedures and embedding4hem into a standard programming language. It also specifies an!?nformation Schema that describes4he struc- 4ure and the integrity constraints of SQL-data. This International Standard - provides a6ehicle for0ortability of data definitions and com- pilation5nits between SQL-implementations, - 0rovides a vehicle for interconnection of SQL-implementations, - specifies syntax for embedding SQL-statements in a compilation unit4hat otherwise conforms4o the standard for a0articular programming language. It defines how an equivalent compilation 5nit may be derived4hat conforms4o the particular0rogramming language standard. In4hat equivalent compilation5nit, each embedded SQL-statement has been replaced by statements4hat invoke a database language0rocedure4hat contains4he SQL- statement, and - specifies syntax for direct invocation of SQL-statements. Scope 1 X3H2-9(g()¬4/DBL CBR-00() This!?nternational Standard does not define the method or time of binding between any of: - database management system components, - SQL data definition declarations, - SQL0rocedures, or - compilation5nits, including those containing embedded SQL. !?mplementations of this!?nternational Standard may exist in en- vironments4hat also support application0rogramming languages, end-user query languages, report generator systems, data dictionary systems,0rogram library systems, and distributed communication systems, as7ell as6arious4ools for database design, data admin- istration, and performance optimization. (N) Database Language SQL X3H2-9(g()¬4/DBL CBR-00() 2 Normative references The following standards contain provisions4hat,4hrough reference in4his text, constitute0rovisions of4his International Standard. At the time of publication,4he editions indicated were6alid. All standards are subject4o revision, and parties to agreements based on this!?nternational Standard are encouraged4o investigate 4he0ossibility of applying4he most recent editions of4he stan- dards listed below. Members of!?EC and!?SO maintain registers of currently valid International Standards. - ISO/IEC 646:91, Information technology-ISO 5 5 5-bit coded charac- 4er set for information interchange. - !?SOgEC 1539:91, Information technology-Programming languages- Fortran. - ISO 89:1985, Programming languages-COBOL. (Endorsement of ANSI X0Ô0¢0¹0È0ë(y>)-1985). - !?SO 202(T|)86, Information technology-ISO 5 5 5-bit and 8-bit coded character sets-code extension4echniques. - ISO 6160:1979, Programming languages-PL/I (Endorsement of ANSI X0Ô0¢0¹0È0ë53-1976). - !?SO 5 5 55:90, Information technology-Programming languages- Pascal. - !?SO 860°88, Data elements and interchange formats - Information interchange-Representation of dates and times. - ISO 8652:1987, Programming languages-Ada. (Endorsement of ANSIkyIL-STD-1815A-1980Î0Ã0È. - !?SOgEC 8824:90, Information technology-Open Systems Interconnection- Specification of Abstract Syntax Notation One (ASN.1). - !?SOgEC 9579-(T|)[1],!?nformation4echnology - Open Systems !?nterconnection - Remote Database Access, Part (T|) SQL special- ization. - ISO/IEC 9899:1990, Programming languages - C. - !?SOgEC 1020:1991,!?nformation4echnology-Programming languages- Extended Pascal. - !?SOgEC 1046:[o, Information technology-Multiple-octet coded character set. ___________________ [1] To be published Normative references 0ª0ü0à X0ß0¯0í0ó(g()92-154e¤BL CBR-002 - ISO/IEC 756:[1],!?nformation4echnology-Programming languages- MUMPS. 2 2 2 Database Language SQL X0ß0¯0í0ó(g()92-154e¤BL CBR-002 0µ0ó0Á0ü0à Definitions, notations, and conventions 2 2.1 Definitions For the purposes of this!?nternational Standard,4he following definitions apply. 0Ô0¢0¹0È0ë1.1 Definitions4aken from ISO/IEC 10646 This!?nternational Standard makes use of4he following4erms de- fined in!?SOgEC 1046: a) character b) octet c) variable-length coding d) fixed-length coding 2 2.1.2 Definitions taken from!?SO 8601 This!?nternational Standard makes use of4he following4erms de- fined in!?SO 860° a) Coordinated Universal Time (UTC) b) date ("date, calendar" in ISO 8601) 0Ô0¢0¹0È0ë1.0µ0ó0Á0ü0à Definitions0rovided in4his International Standard This International Standard defines4he following4erms: a) assignable: The characteristic of a6alue or of a data type 4hat permits that6alue or the values of that data type4o be assigned to data instances of a specified data type. b) cardinality (of a collection): The number of objects in4hat collection. Those objects need not necessarily have distinct 6alues. c) character repertoire; repertoire: A set of characters used for a specific purpose or application. Each character repertoire has an implied default collating sequence. d) coercibility: An attribute of character string data items that governs how a collating sequence for the items is determined. Definitions, notations, and conventions 5 X3H2-9(g()¬4/DBL CBR-00() 2 2.1 Definitions e) collation; collating sequence: A method of ordering4wo com- parable character strings. Every character set has a default collation. f) comparable: The characteristic of4wo data objects that0er- mits4he6alue of one object4o be compared with4he6alue of the other object. Also said of data types: Two data types are comparable if objects of4hose data types are comparable. g) descriptor: A coded description of an SQL object.!?t includes all of the information about the object4hat a conforming SQL- implementation requires. h) distinct: Two values are said to be not distinct if either: both are4he null value, or they compare equal according4o Subclause 8.(l4) "". Otherwise4hey are distinct. Two rows (or0artial rows) are distinct if at least one of4heir0airs of respective6alues is distinct. Otherwise 4hey are not distinct. The result of evaluating7hether or not two values or two rows are distinct is never5nknown. i) duplicate: Two or more values or rows are said to be duplicates (of each other) if and only if they are not distinct. j) dyadic operator: An operator having two operands: a left operand and a right operand. An example of a dyadic arithmetic operator in this!?nternational Standard is "-", specifying4he subtrac- tion of the right operand from4he left operand. k) form-af-use: A convention (or encoding) for representing charac- 4ers (in character strings). Some forms-af-use are fixed-length codings and others are variable-length codings. l) form-af-use conversion: A method of converting character strings from one form-af-use to another form-of-use. m) implementation-defined: Possibly differing between SQL- implementations, but specified by4he implementor for each particular SQL-implementation. n) implementation-dependent: Possibly differing between SQL- implementations, but not specified by this!?nternational Standard and not required4o be specified by the implementor for any particular SQL-implementations. o) monadic operator: An operator having one operand. An example of a monadic arithmetic operator in this!?nternational Standard is "-", specifying4he negation of4he operand. p) multiset: An unordered collection of objects that are not neces- sarily distinct. The collection may be empty. q) n-adic operator: An operator having a6ariable number of operands (informally: n operands). An example of an n-adic operator in4his International Standard is COALESCE. 6 Database Language SQL X3H2-9(g()¬4/DBL CBR-00() 2 2.1 Definitions r) null value (null): A special value, or mark, that is used4o indicate4he absence of any data6alue. s)0ersistent: Continuing to exist indefinitely,5ntil destroyed deliberately. Referential and cascaded actions are regarded as deliberate. Actions incidental4o the ending of an SQL- transaction (see Subclause 2 2 2.28, "SQL-transactions") or an SQL- session (see Subclause 2 2 2.30, "SQL-sessions") are not regarded as deliberate. 4) redundant duplicates: All except one of any multiset of dupli- cate values or rows. u) repertoire: See character repertoire. 6) sequence: An ordered collection of objects4hat are not neces- sarily distinct. w) set: An5nordered collection of distinct objects. The collection may be empty. x) SQL-implementation: A database management system that conforms to4his International Standard. y)4ranslation: A method of translating characters in one character repertoire into characters of the same or a different character repertoire. 0Ô0¢0¹0È0ë(N) Notation The syntactic notation5sed in4his International Standard is an extended6ersion of BNF ("Backus Naur Form" or "Backus Normal Form"). !?n BNF, each syntactic element of4he language is defined by means of a production rule. This defines the element in4erms of a for- mula consisting of4he characters, character strings, and syntactic elements that can be used4o form an instance of it. The version of BNF5sed in4his International Standard makes5se of 4he following symbols: SymbolMeaning < > Angle brackets delimit character strings4hat 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 separate4he element defined by the rule from its definition. The element being defined appears4o the left of the opera- tor and the formula that defines4he element appears4o the right. Definitions, notations, and conventions 7 X0ß0¯0í0ó(g()92-154e¤BL CBR-002 0Ô0¢0¹0È0ë(N)Notation [ ] Square brackets indicate optional elements in a formula. The 0ortion of the formula within4he brackets may be explicitly specified or may be omitted. { } Braces group elements in a formula. The portion of4he for- mula within4he braces shall be explicitly specified. = The alternative operator. The6ertical bar indicates that the portion of4he formula following4he bar is an alterna- 4ive to4he0ortion0receding4he bar. If4he6ertical bar appears at a position7here it is not enclosed in braces or square brackets, it specifies a complete alternative for the element defined by4he0roduction rule. If4he6ertical bar appears in a portion of a formula enclosed in braces or square brackets, it specifies alternatives for4he contents of the innermost pair of such braces or brackets. . . . The ellipsis indicates4hat the element to7hich it applies in a formula may be repeated any number of times.!?f the el- lipsis appears immediately after a closing brace "}"+"+4hen it applies to4he0ortion of the formula enclosed between4hat closing brace and4he corresponding opening brace "{". If an ellipsis appears after any other element,4hen it applies only4o that element. TEL Introduces ordinary English text. This is used7hen the defi- nition of a syntactic element is not expressed in BNF. Spaces are5sed to separate syntactic elements. Multiple spaces and line breaks are4reated as a single space. Apart from4hose symbols to7hich special functions7ere given above, other characters and character strings in a formula stand for themselves. In addition, if4he symbols4o the right of4he definition operator in a produc- 4ion consist entirely of BNF symbols,4hen those symbols stand for 4hemselves and do not4ake on4heir special meaning. Pairs of braces and square brackets may be nested to any depth, and4he alternative operator may appear at any depth within such a nest. A character string that forms an instance of any syntactic element may be generated from4he BNF definition of4hat syntactic element by application of4he following steps: 1) Select any one option from those defined in4he right hand side of a production rule for the element, and replace4he element 7ith this option. 2) Replace each ellipsis and the object4o which it applies7ith one or more instances of4hat object. 0Î0Ã0È For every0ortion of the string enclosed in square brackets, either delete the brackets and4heir contents or change the brackets4o braces. 8 Database Language SQL X3H2-9(g()¬4/DBL CBR-00() 0Ô0¢0¹0È0ë(N)Notation 4) For every0ortion of the string enclosed in braces, apply steps 14hrough 54o the substring between the braces, then remove the braces. 5) Apply steps 14hrough 54o any non-terminal syntactic element (i.e., name enclosed in angle brackets)4hat remains in4he string. The expansion or production is complete7hen no further non- 4erminal symbols remain in the character string. 0Ô0¢0¹0È0ë0µ0ó0Á0ü0à Conventions 2 2.3.1 Informative elements !?n several places in the body of this!?nternational Standard, in- formative notes appear. For example: Note: This is an example of a note. Those notes do not belong to4he normative0art of4his International Standard and conformance to material specified in4hose notes shall not be claimed. 0Ô0¢0¹0È0ë0Ô0¢0¹0È0ë(N) Specification of syntactic elements Syntactic elements are specified in4erms of: - Function: A short statement of4he0urpose of the element. - Format: A BNF definition of the syntax of the element. - Syntax Rules: A specification of4he syntactic0roperties of4he element, or of additional syntactic constraints, not expressed in BNF, that4he element shall satisfy, or both. - Access Rules: A specification of rules governing4he accessibil- ity of schema objects4hat shall hold before the General Rules may be successfully applied. - General Rules: A specification of the run-time effect of4he element. Where more4han one General Rule is used4o specify the effect of an element, the required effect is4hat which would be obtained by beginning7ith the first General Rule and applying the Rules in numerical sequence unless a Rule is applied4hat specifies or implies a change in sequence or4ermination of the application of4he Rules. Unless otherwise specified or implied by a specific Rule4hat is applied, application of??eneral Rules 4erminates when4he last in4he sequence has been applied. - Leveling Rules: A specification of how the element shall be supported for each of4he levels of SQL. Definitions, notations, and conventions 9 X0ß0¯0í0ó(g()92-154e¤BL CBR-002 0Ô0¢0¹0È0ë0µ0ó0Á0ü0àConventions The scope of notational symbols is the Subclause in7hich4hose symbols are defined. 2 2 2 2ithin a Subclause,4he symbols defined in Syntax Rules, Access Rules, or General Rules can be referenced in other rules provided4hat they are defined before being referenced. 0Ô0¢0¹0È0ë0Ô0¢0¹0È0ë0µ0ó0Á0ü0à Specification of the Information Schema The objects of the Information Schema in this!?nternational Standard are specified in terms of: - Function: A short statement of the purpose of4he definition. - Definition: A definition, in SQL, of4he object being defined. - Description: A specification of the run-time6alue of the ob- ject, to4he extent that4his is not clear from the definition. The definitions used4o define4he6iews in the Information Schema are used only to specify clearly4he contents of4hose6iewed 4ables. The actual objects on7hich4hese6iews are based are implementation-dependent. 0Ô0¢0¹0È0ë0Ô0¢0¹0È0ë4 Use of terms 0Ô0¢0¹0È0ë0Ô0¢0¹0È0ë4.1 Exceptions The phrase "an exception condition is raised:", followed by the name of a condition, is5sed in??eneral Rules and elsewhere4o indicate that4he execution of a statement is5nsuccessful, ap- plication of??eneral Rules, other than4hose of Subclause .3, "", and Subclause (eå).1, "", may be terminated, diagnostic information is to be made available, and execution of the statement is4o have no effect on SQL-data or schemas. The effect on s and SQL descriptor areas of an SQL-statement that4erminates with an exception condi- tion, unless explicitly defined by4his International Standard, is implementation-dependent. The phrase "a completion condition is raised:", followed by the name of a condition, is5sed in??eneral Rules and elsewhere4o indicate that application of General Rules is not4erminated and diagnostic information is4o be made available;5nless an excep- 4ion condition is also raised, the execution of4he statement is successful. !?f more4han one condition could have occurred as a result of a statement, it is implementation-dependent whether diagnostic infor- mation pertaining4o more4han one condition is made available. 10 Database Language SQL X0ß0¯0í0ó(g()92-154e¤BL CBR-002 0Ô0¢0¹0È0ë0µ0ó0Á0ü0àConventions 2 2.3.4.2 Syntactic containment In a Format, a syntactic element!!A> is said4o immediately contain a syntactic element!!B> if appears on4he right-hand side of 4he BNF0roduction rule for!!A>. A syntactic element is said 4o contain or specify a syntactic element!!C> if immediately contains or if immediately contains a syntactic element!!B> that contains . !?n SQL language, an instance A1 of is said to immediately con- 4ain an instance B1 of if!!A> immediately contains and the 4ext of B1 is0art of4he4ext of A1. An instance A1 of!!A> is said to contain or specify an instance C1 of if A1 immediately con- tains C1 or if A1 immediately contains an instance B1 of!!B>4hat contains C1. An instance A1 of is said to contain an instance B1 of!!B>7ith an intervening if A1 contains B1 and A1 contains an instance C1 of!!C>4hat contains B1. An instance A1 of!!A> is said4o contain an instance B1 of!!B>7ithout an intervening if A1 contains B1 and A1 does not contain an instance C1 of!!C>4hat contains B1. An instance A1 of!!A> simply contains an instance B1 of!!B> if A1 contains B1 without an intervening instance A2 of or an intervening instance B2 of . !?f contains!!B>, then!!B> is said4o be contained in and !!A> is said4o be a containing production symbol for .!?f simply contains!!B>, then!!B> is said4o be simply contained in and is said to be a simply containing production symbol for !!B>. Let A1 be an instance of!!A> and let B1 be an instance of .!?f !!A> contains ,4hen A1 is said4o contain B1 and B1 is said to be contained in A1. If!!A> simply contains!!B>, then A1 is said to simply contain B1 and B1 is said4o be simply contained in A1. An instance A1 of!!A> is the innermost satisfying a condition C if A1 satisfies C and A1 does not contain an instance A2 of 4hat satisfies C. An instance A1 of!!A> is the outermost satis- fying a condition C if A1 satisfies C and A1 is not contained in an instance A2 of that satisfies C. If!!A> contains a
4hat identifies a6iew that is defined by a V,4hen is said to generally contain the contained in V.!?f contains!!B>, 4hen generally contains!!B>. If!!A> generally contains and !!B> generally contains ,4hen generally contains!!C>. An instance A1 of directly contains an instance B1 of if A1 contains B17ithout an intervening or !!subquery>. Definitions, notations, and conventions 11 X0ß0¯0í0ó(g()92-154e¤BL CBR-002 0Ô0¢0¹0È0ë0µ0ó0Á0ü0àConventions 2 2.3.4.3 Terms denoting rule requirements !?n the Syntax Rules, the term shall defines conditions that are required4o be4rue of syntactically conforming SQL language. When such conditions depend on the contents of the schema, then4hey are required to be true just before4he actions specified by the ??eneral Rules are0erformed. The treatment of language that does not conform4o the SQL Formats and Syntax Rules is implementation- dependent. If any condition required by Syntax Rules is not sat- isfied when4he evaluation of Access or??eneral Rules is attempted and4he implementation is neither0rocessing non-conforming SQL language nor0rocessing conforming SQL language in a non-conforming manner,4hen an exception condition is raised: syntax error or access rule6iolation (if4his situation occurs during dynamic ex- ecution of an SQL-statement, then4he exception4hat is raised is syntax error or access rule violation in dynamic SQL statement; if the situation occurs during direct invocation of an SQL-statement, then4he exception4hat is raised is syntax error or access rule violation in direct SQL statement). In4he Access Rules,4he4erm shall defines conditions4hat are required to be satisfied for the successful application of the ??eneral Rules. If any such condition is not satisfied7hen the ??eneral 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,4hen the exception 4hat is raised is syntax error or access rule6iolation in dynamic SQL statement; if4he situation occurs during direct invocation of an SQL-statement,4hen the exception that is raised is syntax error or access rule6iolation in direct SQL statement). !?n the Leveling Rules, the term shall defines conditions that are required4o be4rue of SQL language for it4o syntactically conform 4o the specified level of conformance. 0Ô0¢0¹0È0ë0Ô0¢0¹0È0ë4.4 Rule evaluation order A conforming implementation is not required4o perform the exact sequence of actions defined in the General Rules, but shall achieve the same effect on SQL-data and schemas as4hat sequence. The term effectively is5sed to emphasize actions7hose effect might be achieved in other ways by an implementation. The Syntax Rules and Access Rules for contained syntactic elements are effectively applied at the same4ime as4he Syntax Rules and Access Rules for the containing syntactic elements. The??eneral Rules for contained syntactic elements are effectively applied be- fore4he??eneral Rules for4he containing syntactic elements. Where 4he0recedence of operators is determined by the Formats of4his !?nternational Standard or by parentheses,4hose operators are ef- fectively applied in4he order specified by that0recedence. 2 2 2 2here the precedence is not determined by the Formats or by parentheses, effective evaluation of expressions is generally0erformed from  Database Language SQL X0ß0¯0í0ó(g()92-154e¤BL CBR-002 0Ô0¢0¹0È0ë0µ0ó0Á0ü0àConventions left to right. However, it is implementation-dependent whether ex- 0ressions are actually evaluated left4o right,0articularly when operands or operators might cause conditions4o be raised or if 4he results of the expressions can be determined without completely evaluating all0arts of the expression. In general, if some syn- tactic element contains more4han one other syntactic element,4hen 4he??eneral Rules for contained elements that appear earlier in4he production for4he containing syntactic element are applied before the General Rules for contained elements4hat appear later. For example, in the production: !!A> ::=!!B>!!C> 4he Syntax Rules and Access Rules for!!A>, , and!!C> are ef- fectively applied simultaneously. The General Rules for are applied before the General Rules for , and4he??eneral Rules for are applied after the General Rules for both!!B> and!!C>. If4he result of an expression or search condition can be deter- mined without completely evaluating all parts of4he expression or search condition, then4he0arts of the expression or search condi- 4ion whose evaluation is not necessary are called4he inessential parts.!?f the Access Rules0ertaining to inessential0arts are not satisfied,4hen the syntax error or access rule violation exception condition is raised regardless of7hether or not the inessential 0arts are actually evaluated.!?f evaluation of the inessential 0arts7ould cause an exception condition to be raised, then it is implementation-dependent7hether or not that exception condition is raised. 2 2.3.4.5 Conditional rules Conditional rules are specified with "If" or "Case" conventions. Rules specified with "Case" conventions include a list of con- ditional sub-rules5sing "If" conventions. The first such "If" sub-rule7hose condition is true is the effective sub-rule of 4he "Case" rule. The last sub-rule of a "Case" rule may specify "Otherwise". Such a sub-rule is the effective sub-rule of the "Case" rule if no0receding "If" sub-rule in the "Case" rule has a4rue condition. 2 2.3.4.6 Syntactic substitution !?n the Syntax and??eneral Rules, the phrase "X is implicit" indi- cates that4he Syntax and General Rules are to be interpreted as if 4he element X had actually been specified. In4he Syntax and General Rules,4he0hrase "the following!!X> is implicit: Y" indicates that4he Syntax and General Rules are to be interpreted as if a syntactic element!!X> containing Y had actually been specified. Definitions, notations, and conventions ª X3H2-9(g()¬4/DBL CBR-00() 2 2.3 Conventions In4he Syntax Rules and General Rules,4he0hrase "former is equiv- alent4o latter" indicates that4he Syntax Rules and General Rules are4o be interpreted as if all instances of former in the element had been instances of latter. !?f a BNF nonterminal is referenced in a Subclause7ithout speci- fying how it is contained in a BNF production4hat the Subclause defines, then Case: - If4he BNF nonterminal is itself defined in the Subclause,4hen the reference shall be assumed4o be4he occurrence of4hat BNF nonterminal on4he left side of the defining0roduction. - Otherwise,4he reference shall be assumed to be to a BNF0ro- duction in7hich4he0articular BNF nonterminal is immediately contained. 0Ô0¢0¹0È0ë0Ô0¢0¹0È0ë4.7 Other4erms Some Syntax Rules define terms, such as T1,4o denote named or 5nnamed4ables. Such terms are used as table names or correlation names. 2 2 2 2here such a term is used as a correlation name, it does not imply4hat any new correlation name is actually defined for the denoted table, nor does it affect the scopes of any actual correlation names. An SQL-statement S1 is said4o be executed as a direct result of executing an SQL-statement if S1 is4he SQL-statement contained in a!!procedure>4hat has been executed, or if S1 is4he6alue of an referenced by an contained in a that has been executed, or if S1 was the value of4he!!SQL statement variable> that7as associ- ated7ith an!!SQL statement name> by a!!prepare statement> and4hat same is referenced by an!!execute statement> contained in a!!procedure>4hat has been executed. 2 2.3.5 Descriptors A descriptor is a conceptual structured collection of data4hat defines4he attributes of an instance of an object of a specified type. The concept of descriptor is5sed in specifying the seman- tics of SQL.!?t is not necessary4hat any descriptor exist in any 0articular form in any database or environment. Some SQL objects cannot exist except in4he context of other SQL objects. For example, columns cannot exist except in tables. Those objects are independently described by descriptors, and4he de- scriptors of enabling objects (e.g.,4ables) are said to include the descriptors of enabled objects (e.g., columns or4able con- straints). Conversely, the descriptor of an enabled object is said 4o be included in4he descriptor of an enabling object. 14 Database Language SQL X3H2-9(g()¬4/DBL CBR-00() 2 2.3 Conventions In other cases, certain SQL objects cannot exist5nless some other SQL object exists, even though4here is not an inclusion relation- ship. For example, SQL does not permit an assertion to exist if the 4ables referenced by the assertion do not exist. Therefore, an as- sertion descriptor is dependent on or depends on zero or more4able descriptors (equivalently, an assertion is dependent on or depends on+ero or more tables).!?n general, a descriptor D1 can be said4o depend on, or be dependent on, some descriptor D2. There are two ways of indicating dependency of one construct on another. In many cases,4he descriptor of4he dependent construct is said to "include the name of"4he construct on which it is de- 0endent. In4his case "the name of" is to be understood as meaning "sufficient information4o identify4he descriptor of";4hus an implementor might choose4o use a pointer or a concatenation of !!catalog name>,!!schema name>, etc. Alternatively, the descrip- tor may be said to include4ext (e.g.,!!query expression>,!!search condition>).!?n such cases, whether the implementation includes ac- 4ual text (with defaults and implications made explicit) or its own style of0arse4ree is irrelevant;4he6alidity of4he descriptor is clearly "dependent on"4he existence of descriptors for objects 4hat are referred4o in it. The statement4hat a column "is based on" a domain, is equivalent to a statement4hat a column "is dependent on"4hat domain. An attempt4o destroy a descriptor may fail if other descriptors are dependent on it, depending on how the destruction is specified. Such an attempt may also fail if the descriptor4o be destroyed is included in some other descriptor. Destruction of a descriptor results in the destruction of all descriptors included in it, but has no effect on descriptors on which it is dependent. 2 2.3.6 Index typography !?n the Index to4his International Standard, the following conven- 4ions are5sed: - Index entries appearing in boldface indicate4he0age where the word, phrase, or BNF nonterminal7as defined; - !?ndex entries appearing in italics indicate a0age where the BNF nonterminal was used in a Format; and - !?ndex entries appearing in roman type indicate a page7here 4he7ord,0hrase, or BNF nonterminal was used in a heading, Function, Syntax Rule, Access Rule,??eneral Rule, Leveling Rule, Table, or other descriptive text. Definitions, notations, and conventions ¬ X3H2-9(g()¬4/DBL CBR-00() 2 2.4 Object identifier for Database Language SQL 0Ô0¢0¹0È0ë4 Object identifier for Database Language SQL Function The object identifier for Database Language SQL identifies4he characteristics of an SQL-implementation4o other entities in an open systems environment. Format !!SQL object identifier> ::= !!SQL provenance> ::=!!arc1> 1 0 ::= ::= <1987>=!!89> | <199(ŒÇ) !!87> ::= 0 | edition1987 0!!right paren> !!89> ::= <1989 base> <1989 package> !!89 base> ::= 1= edition89!!left0aren> 1 <1989 package> ::=!!integrity no> | ::= 0=!?ntegrityNo!!left0aren> 0 ::= 1 | IntegrityYes!!left0aren> 1 <199(ŒÇ) ::= 2= edition92!!left0aren> (N) ::= | =!!high> ::= 0 | Low 0!!right paren> !!intermediate> ::= 1 | Intermediate!!left0aren> 1 ::= 2=?!igh 2!!right paren> ­ Database Language SQL X0ß0¯0í0ó(g()92-154e¤BL CBR-002 0Ô0¢0¹0È0ë4 Object identifier for Database Language SQL Syntax Rules 1) An of!!high> shall not be specified5nless the is specified as <199(ŒÇ). (SA) The6alue of identifies4he level at which conformance is claimed as follows: a)!?f specifies <199(ŒÇ), then Case: i) ,4hen Entry SQL level. ii)!!intermediate>,4hen Intermediate SQL level. iii) , then Full SQL level. b) Otherwise: i) ,4hen level 1. ii)!!intermediate>,4hen level (‘Ñ) 2 2) A specification of!!890ackage> as!!integrity no> implies that4he integrity enhancement feature is not implemented. A specification of <1989 package> as implies that 4he integrity enhancement feature is implemented. Definitions, notations, and conventions 17 X0ß0¯0í0ó(g()92-154e¤BL CBR-002 18 Database Language SQL X3H2-9(g()¬4/DBL CBR-00() 2 2 2 Concepts 2 2 2.1 Data4ypes A data type is a set of representable6alues. The logical represen- tation of a value is a!!literal>. The physical representation of a value is implementation-dependent. A6alue is primitive in4hat it has no logical subdivision within this!?nternational Standard. A6alue is a null6alue or a non-null value. A null value is an implementation-dependent special6alue4hat is distinct from all non-null6alues of4he associated data4ype. There is effectively only one null6alue and4hat value is a member of every SQL data4ype. There is no!!literal> for a null value, although4he keyword NULL is5sed in some places4o indicate4hat a null value is desired. SQL defines distinct data types named by4he following!!key word>s: CHARACTER, CHARACTER VARYING, BIT, BIT VARYING, NUMERIC, DECIMAL, INTEGER, SMALLINT, FLOAT, REAL, DOUBLE PRECISION, DATE, TIME, TIMESTAMP, and INTERVAL. Subclause 6.1, "", describes the semantic0roperties of each data type. For reference purposes, the data4ypes CHARACTER and CHARACTER VARYING are collectively referred to as character string4ypes. The data types BIT and BIT VARYING are collectively referred to as bit string types. Character string types and bit string4ypes are collectively referred to as string4ypes and6alues of string 4ypes are referred to as strings. The data types NUMERIC, DECIMAL, !?NTEGER, and SMALLINT are collectively referred4o as exact numeric types. The data types FLOAT, REAL, and DOUBLE PRECISION are col- lectively referred4o as approximate numeric4ypes. Exact numeric 4ypes and approximate numeric4ypes are collectively referred4o as numeric types. Values of numeric4ype are referred4o as numbers. The data types DATE, TIME, and TIMESTAMP are collectively referred 4o as datetime types. Values of datetime types are referred4o as datetimes. The data type!?NTERVAL is referred to as an interval 4ype. Values of interval types are called intervals. Each data type has an associated data type descriptor. The contents of a data4ype descriptor are determined by4he specific data4ype 4hat it describes. A data4ype descriptor includes an identifica- tion of the data4ype and all information needed4o characterize an instance of4hat data4ype. Concepts  X3H2-9(g()¬4/DBL CBR-00() 2 2 2.1 Data types Each host language has its own data4ypes, which are separate and distinct from SQL data4ypes, even4hough similar names may be used4o describe4he data types. Mappings of SQL data types to data 4ypes in host languages are described in Subclause .3, "", and Subclause .1, "". Not every SQL data4ype has a corresponding data4ype in every host language. 2 2 2.2 Character strings A character string data type is described by a character string data type descriptor. A character string data4ype descriptor con- 4ains: - 4he name of4he specific character string data type (CHARACTER or CHARACTER VARYING; NATIONAL CHARACTER and NATIONAL CHARACTER VARYING are represented as CHARACTER and CHARACTER VARYING, respectively); - the length or maximum length in characters of the character string data type; - 4he catalog name, schema name, and character set name of the character set of4he character string data4ype; and - the catalog name, schema name, and collation name of4he colla- tion of the character string data type. Character sets fall into4hree categories:4hose defined by na- 4ional or international standards, those provided by implemen- 4ations, and those defined by applications. All character sets, however defined, always contain the character. Character sets defined by applications can be defined to "reside" in any schema chosen by4he application. Character sets defined by stan- dards or by implementations reside in4he!?nformation Schema (named INFORMATION_SCHEMA) in each catalog, as do collations defined by standards and collations and form-of-use conversions defined by implementations. The SQL_TEXT specifies4he name of a character repertoire and implied form-af- use that can represent every character4hat is in and all other characters4hat are in character sets supported by the implementation. 4.(‘Ñ)1 Character strings and collating sequences A character string is a sequence of characters chosen from the same character repertoire. The character repertoire from which 4he characters of a0articular string are chosen may be specified explicitly or implicitly. A character string has a length,7hich is4he number of characters in4he sequence. The length is 0 or a 0ositive integer. 20 Database Language SQL X3H2-9(g()¬4/DBL CBR-00() 2 2 2.2 Character strings All character strings of a given character repertoire are mutu- ally comparable, subject to4he restrictions specified in Table 2 2, "Collating sequence5sage for comparisons". A collating sequence, also known as a collation, is a set of rules determining comparison of character strings in a particular char- acter repertoire. There is a default collating sequence for each character repertoire, but additional collating sequences can be defined for any character repertoire. Note: A column may be defined as having a default collating se- quence. This default collating sequence for the column may be different from the default collating sequence for its character repertoire, e.g., if4he!!collate clause> is specified in the !!column reference>.!?t will be clear from context7hen the term "default collating sequence" is used7hether it is meant for a column or for a character repertoire. Given a collating sequence, two character strings are identical if and only if they are equal in accordance7ith the comparison rules specified in Subclause 8.2, "". The collat- ing sequence used for a0articular comparison is determined as in Subclause 4.(‘Ñ)0Ñ0ü0Ä "Rules determining collating sequence5sage". The!!key word>s NATIONAL CHARACTER are used4o specify a character string data4ype with a0articular implementation-defined character repertoire. Special syntax (N'string') is provided for representing literals in4hat character repertoire. A character set is described by a character set descriptor. A char- acter set descriptor includes: - 4he name of4he character set or character repertoire, - if the character set is a character repertoire,4hen the name of the form-af-use, - an indication of7hat characters are in the character set, and - the name of the default collation of4he character set. For every character set,4here is at least one collation. A colla- tion is described by a collation descriptor. A collation descriptor includes: - the name of the collation, - the name of the character set on7hich4he collation operates, - whether the collation has the NO PAD or the PAD SPACE attribute, and - an indication of how4he collation is performed. Concepts (h*) X3H2-9(g()¬4/DBL CBR-00() 2 2 2.2 Character strings 4.(‘Ñ)(N) Operations involving character strings 4.(‘Ñ)(‘Ñ)1 Operators4hat operate on character strings and return character strings is an operator,=, that returns4he char- acter string made by joining its character string operands in the order given. is a triadic function, SUBSTRING, that returns a string extracted from a given string according 4o a given numeric starting0osition and a given numeric length. Truncation occurs7hen the implied starting and ending positions are not both within4he given string. !!fold> is a0air of functions for converting all the lower case characters in a given string4o upper case (UPPER) or all the upper case ones4o lower case (LOWER), useful only in connection with strings that may contain!!simple Latin letter>s. !!form-af-use conversion> is a function that invokes an installation- supplied form-af-use conversion4o return a character string S2 derived from a given character string S1. It is intended, though not enforced by this!?nternational Standard,4hat S2 be exactly the same sequence of characters as S1, but encoded according some dif- ferent form-af-use. A4ypical5se might be to convert a character string from two-octet UCS to one-actet Latin1 or6ice versa. !!trim function> is a function4hat returns its first string ar- gument7ith leading and/or4railing pad characters removed. The second argument indicates7hether leading, or4railing, or both leading and trailing0ad characters should be removed. The4hird argument specifies4he0ad character4hat is4o be removed. is a function for changing each charac- 4er of a given string according4o some many-to-ane or one-to-ane mapping between two not necessarily distinct character sets. The mapping, rather than being specified as part of the function, is some external function identified by a!!translation name>. For any0air of character sets,4here are+ero or more translations that may be invoked by a!!character translation>. A translation is described by a4ranslation descriptor. A4ranslation descriptor includes: - the name of the translation, - the name of the character set from7hich it translates, - 4he name of4he character set4o which it4ranslates, and - an indication of how4he4ranslation is performed. (g ) Database Language SQL X0ß0¯0í0ó(g()92-154e¤BL CBR-002 4.(N)Character strings 2 2 2.2.2.2 Other operators involving character strings returns the length of a given character string, as an integer, in characters, octets, or bits according4o the choice of function. !!position expression> determines the first position, if any, at which one string, S1, occurs7ithin another, S(‘Ñ)!?f S1 is of length +ero,4hen it occurs at0osition 1 for any value of S(‘Ñ)!?f S1 does not occur in S2, then+ero is returned. !!like0redicate> uses4he4riadic operator LIKE (or4he inverse, NOT LIKE), operating on4hree character strings and returning a Boolean. LIKE determines7hether or not a character string "matches" a given "pattern" (also a character string). The char- acters '%' (percent) and '_' (underscore) have special meaning7hen 4hey occur in4he0attern. The optional4hird argument is a charac- ter string containing exactly one character, known as the "escape character"+"+ for5se7hen a percent or5nderscore is required in4he pattern without its special meaning. 2 2 2.2.3 Rules determining collating sequence5sage The rules determining collating sequence usage for character strings are based on the following: - Expressions where no columns are involved (e.g., literals, host variables) are by default compared5sing4he default collating sequence for their character repertoire. Note: The default collating sequence for a character repertoire is defined in Subclause 10.4, "", and Subclause .28, "". - When columns are involved (e.g., comparing4wo columns, or com- paring a column to a literal), by default the default collating sequence of the columns involved is used so long as the columns have4he same default collating sequence. - 2 2 2 2hen columns are involved having different default collating sequences, explicit specification of4he collating sequence in 4he expression is required via the 7hen the expression0articipates in a comparison. - Any explicit specification of collating sequence in an expres- sion overrides any default collating sequence. To formalize4his,!!character value expression>s effectively have a coercibility attribute. This attribute has the values Coercible, !?mplicit, No collating sequence, and Explicit. s7ith the Coercible,!?mplicit, or Explicit attributes have a collating sequence. Concepts (y>) X3H2-9(g()¬4/DBL CBR-00() 2 2 2.2 Character strings A consisting of a column reference has 4he!?mplicit attribute,7ith collating sequence as defined when4he column7as created. A consisting of a value other than a column (e.g., a host variable or a literal) has the Coercible attribute,7ith the default collation for its char- acter repertoire. A!!character value expression> simply containing a!!collate clause> has the Explicit attribute, with4he collating sequence specified in the . Note: When4he coercibility attribute is Coercible, the collating sequence is5niquely determined as specified in Subclause 8.2, "". The4ables below define how4he 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 (l4) "Collating coercibil- ity rules for dyadic operators"+"+ shows4he collating sequence and coercibility rules for dyadic operators. Table 0Ñ0ü0Ä "Collating se- iuence usage for comparisons", shows how the collating sequence is determined for a particular comparison. ____Table_1-Collating_coercibility_rules_for_monadic_operators____ Operand Coercibility Result Coercibility _____and_Collating_Sequence_____ _____and_Collating_Sequence___ | Collating | Collating = =_Coercibility______Sequence______|_Coercibility______Sequence_____| | | = = Coercible = default = Coercible = default | | | | | = =!?mplicit = X =!?mplicit = 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 (N)Coercibility and Collating and_Collating_Sequence _and_Collating_Sequence ___Sequence___ | Collating= Collating | Col|ating |_Coercibility_Sequence__|_Coercibility_Sequence__|__CoercibilitySe|uence | = | = = Coercible | default | Coercible = default = Coercible| def|ult = | | = = = | | Coercible = default =!?mplicit | Y | !?mplicit | Y = = | | = = = | | Coercible = default = No collati|g sequence | No colla|ing= sequence (T ) Database Language SQL X0ß0¯0í0ó(g()92-154e¤BL CBR-002 4.(N)Character strings Table_(g()Collating_coercibility_rules_for_dyadic_operators_(Cont.)_ Result Coercibility Operand 1 Coercibility Operand 2 Coercibility and Collating _and_Collating_Sequence and_Collating_Sequence __Sequence___ = Collating | Collating= Col|ating =_Coercibility_Sequence__|_Coercibility_Sequence__|__CoercibilitySe|uence = | = | | Coercible = default = Explicit | Y | Explicit | Y = = | | = = = | | Implicit = X = Coercible | default | !?mplicit | X = = | | = = = | | Implicit = X =!?mplicit | X | !?mplicit | X = = | | = = = | | Implicit = X =!?mplicit | Y b X | No colla|ing= sequence =!?mplicit | X | No collati|g sequence= No collating | | = = | | sequence = = | | = = | | Implicit = X = Explicit Y | Explicit Y = = | | = | | No collati|g sequence= Any, | Any | No colla|ing= except sequence Explicit = No collating sequence | Explicit = X = Explicit X | | = | | = = Explicit X | Coercible = default = Explicit= X | | = | | | = = Explicit | X | Implicit = Y = Explicit= X | | = = | | | = = Explicit | X | No collati|g sequence= Explicit= X | | = = | | | = = Explicit | X | Explicit X = Explicit= X | | = = | | = = Explicit | X | Explicit = Y = X = Not permi|ted:| ___________________________________________________invalid_syntax_ |__________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 = Coercible| default | Explicit Y = Y | | = = | = Concepts 25 X0ß0¯0í0ó(g()92-154e¤BL CBR-002 4.(N)Character strings _____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____________| | = | = =!?mplicit | X | Coercible| default= X | | = = | | = =!?mplicit | X | Implicit= X = X | | = = | | = =!?mplicit | X | Implicit= Y = X = Not permitted: invalid| syntax =!?mplicit | X | No co|lating = Not permitted: invalid| | = = seq|ence | syntax = = | | = = | | Implicit= X = Explicit Y | Y = = | | = | | No co|lating = Any | Any | Not0ermitted: invalid| sequence except syntax Explicit | 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_________________ |For n-adic|operation| (e.g., )7ith operands X1,= X2, . . . , n , the collating sequence is effectively determined by considering X1 and X2, then combining4his result7ith X3, and so on. 4.0µ0ó0Á0ü0à Bit strings A bit string is a sequence of bits, each having4he6alue of 0 or 1. A bit string has a length, which is4he number of bits in4he string. The length is 0 or a0ositive integer. A bit string data4ype is described by a bit string data type de- scriptor. A bit string data type descriptor contains: - 4he name of4he specific bit string data type (BIT or BIT VARYING); and 26 Database Language SQL X3H2-9(g()¬4/DBL CBR-00() 2 2 2.3 Bit strings - 4he length of4he bit string data4ype (in bits). 2 2 2.3.1 Bit string comparison and assignment All bit strings are mutually comparable. A bit string is identical 4o another bit string if and only if it is equal to4hat bit string in accordance with4he comparison rules specified in Subclause 8.2, "". Assignment of a bit string to a bit string variable is performed from the most significant bit4o the least significant bit in4he source string to4he most significant bit in4he4arget string, one bit at a time. 2 2 2.3.2 Operations involving bit strings 2 2 2.3.2.1 Operators that operate on bit strings and return bit strings !!bit concatenation> is an operator,=, that returns4he bit string made by concatenating4he4wo bit string operands in the order given. is a triadic function identical in syntax and semantics to!!character substring function> except4hat the first argument and the returned6alue are both bit strings. 2 2 2.3.2.2 Other operators involving bit strings returns the length (as an integer number of octets or bits according to4he choice of function) of a given bit string. !!position expression> determines the first position, if any, at which one string, S1, occurs7ithin another, S(‘Ñ)!?f S1 is of length +ero,4hen it occurs at0osition 1 for any value of S(‘Ñ)!?f S1 does not occur in S2, then+ero is returned. 2 2 2.4 Numbers A number is either an exact numeric value or an approximate numeric 6alue. Any two numbers are mutually comparable to each other. A numeric data type is described by a numeric data type descriptor. A numeric data4ype descriptor contains: - the name of the specific numeric data type (NUMERIC, DECIMAL, INTEGER, SMALLINT, FLOAT, REAL, or DOUBLE PRECISION); - 4he0recision of the numeric data4ype; Concepts (y]) X3H2-9(g()¬4/DBL CBR-00() 2 2 2.4 Numbers - 4he scale of the numeric data4ype, if it is an exact numeric data type; and - an indication of whether the precision (and scale) are expressed in decimal or binary4erms. 4.4.1 Characteristics of numbers An exact numeric6alue has a0recision and a scale. The precision is a positive integer4hat determines4he number of significant digits in a particular radix (binary or decimal). The scale is a non-negative integer. A scale of 0 indicates4hat the number is an integer. For a scale of S,4he exact numeric6alue is the integer 6alue of the significant digits multiplied by 10-S. An approximate numeric value consists of a mantissa and an expo- nent. The mantissa is a signed numeric value, and4he exponent is a signed integer4hat specifies the magnitude of4he mantissa. An approximate numeric6alue has a0recision. The precision is a0osi- tive integer4hat specifies the number of significant binary digits in the mantissa. The value of an approximate numeric value is4he mantissa multiplied by 10exponent. 2 2 2 2henever an exact or approximate numeric value is assigned to a data item or0arameter representing an exact numeric6alue, an approximation of its6alue4hat preserves leading significant dig- its after rounding or truncating is represented in4he data type of4he4arget. The6alue is converted to have the precision and scale of the target. The choice of whether to4runcate or round is implementation-defined. An approximation obtained by truncation of a numerical value N for an T is a value V representable in T such 4hat N is not closer to+ero than4he numerical6alue of V and such that4he absolute value of4he difference between N and the numer- ical6alue of V is less than4he absolute value of4he difference between4wo successive numerical values representable in T. An approximation obtained by rounding of a numerical value N for an T is a value V representable in T such 4hat the absolute6alue of the difference between N and4he nu- merical value of V is not greater than half the absolute6alue of4he difference between two successive numerical6alues repre- sentable in T.!?f there are more4han one such6alues V,4hen it is implementation-defined which one is4aken. All numerical values between4he smallest and the largest value, inclusive, representable in a given exact numeric type have an approximation obtained by rounding or truncation for4hat type; it is implementation-defined which other numerical values have such approximations. (R´) Database Language SQL X0ß0¯0í0ó(g()92-154e¤BL CBR-002 4.4 Numbers An approximation obtained by truncation or rounding of a numerical 6alue N for an T is a value V repre- sentable in T such4hat there is no numerical value representable in T and distinct from that of V that lies between the numerical 6alue of V and N, inclusive. If4here are more than one such values V4hen it is implementation- defined7hich one is taken.!?t is implementation-defined which numerical6alues have approximations obtained by rounding or trun- cation for a given approximate numeric type. Whenever an exact or approximate numeric6alue is assigned4o a data item or parameter representing an approximate numeric value, an approximation of its value is represented in the data4ype of the target. The value is converted4o have4he0recision of the 4arget. Operations on numbers are0erformed according4o the normal rules of arithmetic,7ithin implementation-defined limits, except as provided for in Subclause 6., "". 4.4.(N) Operations involving numbers As7ell as4he5sual arithmetic operators,0lus, minus, times, divide, unary plus, and unary minus,4here are4he following func- tions that return numbers: - (see Subclause 2 2 2.2.2, "Operations involv- ing character strings", and Subclause 4.0Ô0¢0¹0È0ë(l4) "Operations involv- ing bit strings")4akes4wo strings as arguments and returns an integer; - !!length expression> (see Subclause 4.(‘Ñ)(l4) "Operations involving character strings"+"+ and Subclause 2 2 2.3.2, "Operations involv- ing bit strings") operates on a string argument and returns an integer; - !!extract expression> (see Subclause 2 2 2.5.3, "Operations involving datetimes and intervals") operates on a datetime or interval argument and returns an integer. 4.5 Datetimes and intervals A datetime data4ype is described by a datetime data type descrip- 4or. An interval data4ype is described by an interval data4ype descriptor. A datetime data4ype descriptor contains: - the name of the specific datetime data4ype (DATE, TIME, TIMESTAMP, TIME 2 2 2 2ITH TIME ZONE, or TIMESTAMP WITH TIME ZONE); and Concepts 29 X0ß0¯0í0ó(g()92-154e¤BL CBR-002 4.5 Datetimes and intervals - the value of4he!!time fractional seconds precision>, if it is a TIME, TIMESTAMP, TIME 2 2 2 2ITH TIME ZONE, or TIMESTAMP WITH TIME ZONE4ype. An interval data type descriptor contains: - 4he name of4he interval data4ype (INTERVAL); - an indication of whether the interval data type is a year-month interval or a day-time interval; and - 4he!!intervaliualifier> that describes4he0recision of the interval data type. Every datetime or interval data type has an implied length in po- sitions. Let D denote a6alue in some datetime or interval data type DT. The length in0ositions of DT is constant for all D. The length in0ositions is the number of characters from the character set SQL_TEXT that it would take4o represent any value in a given datetime or interval data type. 4.5.1 Datetimes Table 2 2 2, "Fields in datetime items", specifies the fields4hat can make up a date time6alue; a datetime6alue is made5p of a subset of those fields. Not all of4he fields shown are required4o be in 4he subset, but every field4hat appears in4he4able between4he first included0rimary field and4he last included0rimary field shall also be included. If either timezone field is in4he subset, then both of4hem shall be included. _________________Table_4-Fields_in_datetime_items_________________ Keyword____________Meaning________________________________________ |__________________|___Primary_datetime_fields_____________________| = | | | YEAR Year = = | | MONTH = Month7ithin year = = | | | DAY = Day7ithin month = = | | | HOUR =?!our within day = = | | | MINUTE = Minute within hour = = | | | SECOND = Second and possibly fraction of a second = ____________________within_minute__________________________________ =__________________|___Timezone_datetime_fields____________________| | = = = TIMEZONE_HOUR | Hour6alue of time+one displacement | | = =_TIMEZONE_MINUTE__|_Minute_value_of_time_zone_displacement________| | = = 0Ô0³ Database Language SQL X0ß0¯0í0ó(g()92-154e¤BL CBR-002 4.5 Datetimes and intervals There is an ordering of4he significance of!!datetime field>s. This is, from most significant to least significant: YEAR, MONTH, DAY, ?!OUR, MINUTE, and SECOND. The!!datetime field>s other4han SECOND contain non-negative in- 4eger6alues, constrained by the natural rules for dates using the ??regorian calendar. SECOND, however, can be defined4o have a!!time fractional seconds0recision> that indicates4he number of decimal digits maintained following the decimal point in4he seconds6alue, a non-negative exact numeric value. There are4hree classes of datetime data types defined within4his !?nternational Standard: - DATE - contains the s YEAR, MONTH, and DAY; - TIME - contains4he!!datetime field>s?!OUR, MINUTE, and SECOND; and - TIMESTAMP - contains4he!!datetime field>s YEAR, MONTH, DAY, ?!OUR, MINUTE, and SECOND. !?tems of type datetime are mutually comparable only if they have 4he same s. Datetimes only have absolute meaning in4he context of additional information. Time zones are political divisions of4he earth's surface that allow4he convention that4ime is measured the same at all locations7ithin the time+one, regardless of4he0recise value of "sun time" at specific locations. Political entities often change the "local4ime"7ithin a time+one for certain periods of the year, e.g., in4he summer.?!owever, different political enti- 4ies within4he same time+one are not necessarily synchronized in 4heir local4ime changes. 2 2 2 2hen a datetime is specified (in SQL-data or elsewhere) it has an implied or explicit time+one specifier as- sociated with it. Unless that4ime zone specifier, and its meaning, is known, the meaning of4he datetime value is ambiguous. Therefore, datetime data4ypes4hat contain time fields (TIME and TIMESTAMP) are maintained in Universal Coordinated Time (UTC), with an explicit or implied4ime zone0art. The4ime zone0art is an interval specifying the difference between UTC and the actual date and time in the time+one represented by the time or timestamp data item. The4ime zone displacement is defined as INTERVAL?!OUR TO MINUTE A TIME or TIMESTAMP that does not specify WITH TIME ZONE has an im- 0licit time+one equal to4he local4ime zone for4he SQL-session. The6alue of time represented in the data changes along7ith the local4ime zone for4he SQL-session. However,4he meaning of the 4ime does not change because it is effectively maintained in UTC. Concepts 0Ó0ë X3H2-9(g()¬4/DBL CBR-00() 2 2 2.5 Datetimes and intervals Note: On occasion, UTC is adjusted by the omission of a second or 4he insertion of a "leap second" in order4o maintain synchro- nization with sidereal time. This implies4hat sometimes, but6ery rarely, a0articular minute7ill contain exactly 59, 61, or 5 5() seconds. 4.5.(N)!?ntervals There are4wo classes of intervals. One class, called9ear-month intervals, has an express or implied datetime0recision4hat in- cludes no fields other than YEAR and MONTH,4hough not both are required. The other class, called day-time intervals, has an ex- press or implied interval precision that can include any fields other4han YEAR or MONTH. Table 5, "Fields in9ear-month INTERVAL items"+"+ specifies4he fields4hat make5p a year-month interval. A9ear-month interval is made up of a contiguous subset of4hose fields. ___________Table_5-Fields_in_year-month_INTERVAL_items____________ Keyword______Meaning______________________________________________ | YEAR = Years = = | | |_MONTH______|_Months______________________________________________| = | | Table 5 5, "Fields in day-time INTERVAL items"+"+ specifies4he fields 4hat make5p a day-time interval. A day-time interval is made5p of a contiguous subset of4hose fields. ____________Table_6-Fields_in_day-time_INTERVAL_items_____________ Keyword______Meaning______________________________________________ | DAY = Days = = | | | HOUR =?!ours = = | | | MINUTE = Minutes = = | | |_SECOND_____|_Seconds_and_possibly_fractions_of_a_second__________| = | | The actual subset of fields4hat comprise an item of either4ype of interval is defined by an and4his subset is known as the precision of4he item. 2 2 2 2ithin an item of4ype interval, the first field is constrained only by the of the associated . Table 7, "Valid values for fields in!?NTERVAL items"+"+ specifies4he constraints on subsequence field values. 0Õ0¡0é0Ã0É Database Language SQL X0ß0¯0í0ó(g()92-154e¤BL CBR-002 4.5 Datetimes and intervals ________Table_7-Valid_values_for_fields_in_INTERVAL_items_________ Keyword______Valid_values_of_INTERVAL_fields______________________ | YEAR = Unconstrained except by!!interval leading field = precision = MONTH | Months (within9ears) (0-11) | | = = = DAY | Unconstrained except by )) = = | | | MINUTE = Minutes (within hours) (0-59) = = | | |_SECOND_____|_Seconds_(within_minutes)_(0-59.999...)______________| = | | Values in interval fields other4han SECOND are integers. SECOND, however, can be defined to have an!!interval fractional seconds 0recision> that indicates4he number of decimal digits maintained following the decimal point in4he seconds6alue. Fields comprising an item of4ype interval are also constrained by the definition of the Gregorian calendar. Year-month intervals are mutually comparable only with other9ear- month intervals.!?f two year-month intervals have different inter- val precisions, they are, for the purpose of any operations between 4hem, effectively converted4o the same0recision by appending new !!datetime field>s4o either4he most significant end or4he least significant end of one or both9ear-month intervals. New least sig- nificant s are assigned a6alue of 0. 2 2 2 2hen it is necessary4o add new most significant date time fields,4he as- sociated6alue is effectively converted to4he new0recision in a manner obeying the natural rules for dates and times associated with4he??regorian calendar. Day-time intervals are mutually comparable only7ith other day- time intervals. If4wo day-time intervals have different interval 0recisions,4hey are, for4he0urpose of any operations between them, effectively converted to4he same precision by appending new s to either the most significant end or the least significant end of one or both day-time intervals. New least sig- nificant!!datetime field>s are assigned a value of 0. When it is necessary to add new most significant datetime fields,4he asso- ciated6alue is effectively converted to4he new0recision in a manner obeying the natural rules for dates and times associated with4he??regorian calendar. Concepts 0Õ0£0ü0È X3H2-9(g()¬4/DBL CBR-00() 2 2 2.5 Datetimes and intervals 4.5.0µ0ó0Á0ü0à Operations involving datetimes and intervals Table 8, "Valid operators involving datetimes and intervals", spec- ifies4he results of arithmetic expressions involving datetime and interval operands. _____Table_8-Valid_operators_involving_datetimes_and_intervals_____ Operand Operand q_________Operator_35________Result_Type_________________________ | Datetime= - = Datetime | Interval = = | | = | | Datetime= + or -|!?nterval | Datetime = = | | = | | Interval= + = Datetime | Datetime = = | | = | | Interval= + or -|!?nterval | Interval = = | | = | | Interval= * or € Numeric | Interval = = | | = | |_Numeric__|_*_____|_Interval_|_Interval___________________________| = | | = | Arithmetic operations involving items of type datetime or inter- 6al obey the natural rules associated7ith dates and times and 9ield6alid datetime or interval results according to4he??regorian calendar. Operations involving items of type datetime require that4he date- time items be mutually comparable. Operations involving items of type interval require that4he interval items be mutually compara- ble. Operations involving a datetime and an interval0reserve the time zone of the datetime operand. If4he datetime operand does not include a time+one part, then4he local4ime zone is effectively 5sed. !!overlaps0redicate> uses4he operator OVERLAPS4o determine 7hether or not two chronological periods overlap in4ime. A chrono- logical period is specified either as a pair of datetimes (starting and ending) or as a starting datetime and an interval. operates on a datetime or interval and returns an exact numeric value representing4he6alue of one component of the datetime or interval. 4.6 Type conversions and mixing of data4ypes Values of4he data types NUMERIC, DECIMAL, INTEGER, SMALLINT, FLOAT, REAL, and DOUBLE PRECISION are numbers and are all mutually comparable and mutually assignable. If an assignment7ould result in a loss of the most significant digits, an exception condition is raised. If least significant digits are lost, implementation- defined rounding or4runcating occurs7ith no exception condition being raised. The rules for arithmetic are generally governed by Subclause 6., "". 0Ö0Ã0·0§0ë Database Language SQL X0ß0¯0í0ó(g()92-154e¤BL CBR-002 4.6 Type conversions and mixing of data types Values corresponding to4he data types CHARACTER and CHARACTER VARYING are mutually assignable if and only if they are4aken from 4he same character repertoire. If4hey are from different character repertoires,4hen the value of4he source of4he assignment shall be translated4o the character repertoire of the target before an assignment is possible. If a store assignment would result in the loss of non- characters due to4runcation,4hen an exception condition is raised. The6alues are mutually comparable only if 4hey are mutually assignable and can be coerced4o have4he same collation. The comparison of two character strings depends on4he collating sequence5sed for the comparison (see Table 0Ñ0ü0Ä "Collating sequence usage for comparisons"). 2 2 2 2hen values of unequal length are compared, if4he collating sequence for the comparison has the NO PAD attribute and4he shorter6alue is equal to a0refix of the longer6alue, then4he shorter6alue is considered less than the longer6alue. If4he collating sequence for the comparison has the PAD SPACE attribute, for4he0urposes of4he comparison,4he shorter value is effectively extended to4he length of4he longer by concatenation of!!space>s on4he right. Values corresponding4o the data4ypes BIT and BIT VARYING are al- ways mutually comparable and are mutually assignable. If a store assignment7ould result in4he loss of bits due to4runcation,4hen an exception condition is raised. 2 2 2 2hen values of unequal length are to be compared, if4he shorter is a prefix of the longer, then4he shorter is less than4he longer; otherwise, the longer is effec- tively4runcated4o the length of the shorter for the purposes of comparison. 2 2 2 2hen values of equal length are4o be compared,4hen a bit-by-bit comparison is made. A 0-bit less4han a 1-bit. Values of4ype datetime are mutually assignable only if4he source and4arget of4he assignment have4he same datetime fields. Values of4ype interval are mutually assignable only if4he source and4arget of4he assignment are both9ear-month intervals or if 4hey are both day-time intervals. !?mplicit type conversion can occur in expressions, fetch opera- tions, single row select operations, inserts, deletes, and5pdates. Explicit type conversions can be specified by4he5se of the CAST operator. 4.7 Domains A domain is a set of permissible values. A domain is defined in a schema and is identified by a . The0urpose of a domain is4o constrain the set of6alid6alues that can be stored in SQL-data by6arious operations. A domain definition specifies a data type. It may also specify a !!domain constraint>4hat further restricts the valid values of the domain and a 4hat specifies the value to be used in4he absence of an explicitly specified value or column default. Concepts 0Õ0é0ó X3H2-9(g()¬4/DBL CBR-00() 2 2 2.7 Domains A domain is described by a domain descriptor. A domain descriptor includes: - the name of the domain; - 4he data type descriptor of4he data type of the domain; - 4he!!collation name> from4he!!collate clause>, if any, of the domain; - 4he6alue of , if any, of4he domain; and - the domain constraint descriptors of4he domain constraints, if any, of the domain. 4.8 Columns A column is a multiset of6alues that may6ary over4ime. All6al- 5es of the same column are of4he same data4ype or domain and are 6alues in4he same table. A6alue of a column is the smallest5nit of data4hat can be selected from a4able and4he smallest unit of data that can be updated. Every column has a . Every column has a nullability characteristic of known not nullable or0ossibly nullable, defined as follows: A column has a nullability characteristic that indicates7hether any attempt to store a null value into4hat column7ill inevitably raise an exception, or7hether any attempt4o retrieve a6alue from4hat column can ever result in a null6alue. A column C7ith !!column name> CN of a base table T has a nullability characteristic that is known not nullable if and only if either: - 4here exists at least one constraint that is not deferrable and 4hat simply contains a 4hat contains CN IS NOT NULL or NOT CN IS NULL or RVE!?S NOT NULL, where RVE is a !!row value constructor>4hat contains a!!row value constructor expression> that is simply CN without an intervening!!search condition> that specifies OR and without an intervening!!boolean factor> that specifies NOT. - C is based on a domain that has a domain constraint4hat is not deferrable and that simply contains a!!search condition> that contains VALUE IS NOT NULL or NOT VALUE!?S NULL7ithout an intervening 4hat specifies OR and7ithout an intervening 4hat specifies NOT. - CN is contained in a non-deferrable 7hose!!unique specification> specifies PRIMARY KEY. Otherwise, a column C is possibly nullable. 2 26 Database Language SQL X3H2-9(g()¬4/DBL CBR-00() 2 2 2.8 Columns A column is described by a column descriptor. A column descriptor includes: - the name of the column; - 7hether4he name of4he column is an implementation-dependent name; - if4he column is based on a domain, then4he name of4hat do- main; otherwise,4he data type descriptor of4he data type of the column; - 4he!!collation name> from4he!!collate clause>, if any, of the column; - 4he6alue of , if any, of4he column; - the nullability characteristic of the column; and - 4he ordinal0osition of4he column within4he4able4hat con- 4ains4he column. 2 2 2.9 Tables A4able is a multiset of rows. A row is a nonempty sequence of 6alues. Every row of the same4able has4he same cardinality and contains a value of every column of4hat table. The i-th value in every row of a4able is a value of4he i-th column of that4able. The row is the smallest5nit of data that can be inserted into a 4able and deleted from a table. The degree of a4able is the number of columns of4hat table. At any4ime,4he degree of a4able is the same as the cardinality of each of its rows and4he cardinality of a table is4he same as4he cardinality of each of its columns. A table whose cardinality is 0 is said to be empty. A4able is either a base table, a6iewed table, or a derived table. A base4able is either a0ersistent base4able, a global4empo- rary table, a created local4emporary4able, or a declared local 4emporary4able. A persistent base table is a named4able defined by a
that does not specify TEMPORARY. A derived4able is a table derived directly or indirectly from one or more other4ables by4he evaluation of a!!query expression>. The values of a derived table are derived from4he6alues of4he underlying4ables when4he!!query expression> is evaluated. A viewed4able is a named derived table defined by a!!view defini- tion>. A6iewed table is sometimes called a view. Concepts 0Ú0½ X3H2-9(g()¬4/DBL CBR-00() 2 2 2.9 Tables The4erms simply underlying4able, underlying4able, leaf5nderly- ing4able, generally underlying4able, and leaf generally5nderly- ing4able define a relationship between a derived4able or cursor and other tables. The simply5nderlying tables of derived tables and cursors are defined in Subclause 5 5 5.9, ""+"+ Subclause 5 5 5.10, "", and Subclause ª.1, "". A 6iewed table has no simply underlying4ables. The5nderlying tables of a derived table or cursor are the simply underlying4ables of4he derived4able or cursor and4he5nderlying 4ables of4he simply underlying4ables of4he derived4able or cursor. The leaf underlying4ables of a derived4able or cursor are4he underlying4ables of4he derived4able or cursor4hat do not4hem- selves have any underlying4ables. The generally5nderlying tables of a derived table or cursor are 4he5nderlying tables of the derived table or cursor and, for4hose underlying4ables of4he derived4able or cursor4hat are viewed tables, the of each6iewed table and the gen- erally5nderlying tables of the of each6iewed 4able. The leaf generally5nderlying tables of a derived table or cursor are4he generally5nderlying tables of the derived table or cursor 4hat do not4hemselves have any generally5nderlying tables. All base4ables are updatable. Derived4ables are either5pdatable or read-only. The operations of insert, update, and delete are permitted for updatable tables, subject to constraining Access Rules. The operations of insert,5pdate, and delete are not allowed for read-only4ables. A grouped4able is a set of groups derived during4he evaluation of a or a!!having clause>. A group is a multiset of rows in which all values of the grouping column or columns are equal if a!!group by clause> is specified, or the group is4he entire4able if no!!group by clause> is specified. A grouped4able may be considered as a collection of4ables. Set functions may operate on4he individual tables7ithin the grouped table. A global temporary table is a named4able defined by a
that specifies??LOBAL TEMPORARY. A created local4emporary table is a named4able defined by a
4hat speci- fies LOCAL TEMPORARY. Global and created local4emporary4ables are effectively materialized only7hen referenced in an SQL-session. Every!!module> in every SQL-session4hat references a created local temporary table causes a distinct instance of that created local temporary table to be materialized. That is,4he contents of a global4emporary4able or a created local temporary table cannot be shared between SQL-sessions. In addition,4he contents of a cre- ated local temporary table cannot be shared between!!module>s of a single SQL-session. The definition of a global temporary table or a created local temporary table appears in a schema.!?n SQL language, 0Ú0Ë0Ò Database Language SQL X0ß0¯0í0ó(g()92-154e¤BL CBR-002 2 2 2.9 Tables 4he name and the scope of4he name of a global temporary table or a created local temporary table are indistinguishable from4hose of a0ersistent base4able. However, because global temporary ta- ble contents are distinct7ithin SQL-sessions, and created local 4emporary4ables are distinct7ithin s within SQL-sessions, the effective of4he schema in7hich4he global tem- porary4able or the created local temporary table is instantiated is an implementation-dependent that may be thought of as having been effectively derived from the of the schema in which the global4emporary4able or created local 4emporary4able is defined and the implementation-dependent SQL- session identifier associated7ith the SQL-session.!?n addition, 4he effective!!schema name> of the schema in which the created local4emporary4able is instantiated may be thought of as being furtheriualified by a unique implementation-dependent name associ- ated7ith the in which the created local temporary table is referenced. A declared local4emporary4able is a named table defined by a that is effectively materialized the first time any!!procedure> in the 4hat contains4he is executed. A declared local tem- porary4able is accessible only by!!procedure>s in4he!!module> 4hat contains4he!!temporary table declaration>. The effective !!schema name> of the of the declared local4em- 0orary table may be4hought of as4he implementation-dependent SQL-session identifier associated7ith the SQL-session and a unique implementation-dependent name associated7ith the 4hat contains the . All references to a declared local4emporary4able are0refixed by "MODULE.". The materialization of a4emporary4able does not persist beyond the end of4he SQL-session in which the table was materialized. Temporary4ables are effectively empty at4he start of an SQL- session. A table is described by a table descriptor. A table descriptor is either a base4able descriptor, a6iew descriptor, or a derived table descriptor (for a derived table that is not a view). Every4able descriptor includes: - 4he degree of4he4able (the number of column descriptors); and - the column descriptor of each column in the table. A base table descriptor describes a base table.!?n addition4o 4he components of every4able descriptor, a base table descriptor includes: - 4he name of4he base table; - an indication of7hether4he4able is a persistent base table, a global temporary table, a created local4emporary4able, or a declared local temporary table; and Concepts 0Ø0ë0Ä X3H2-9(g()¬4/DBL CBR-00() 2 2 2.9 Tables - the descriptor of each4able constraint specified for the table. A derived4able descriptor describes a derived table.!?n addi- 4ion to4he components of every4able descriptor, a derived4able descriptor includes: - if4he4able is named,4hen the name of the table; - the 4hat defines how the table is4o be de- rived; and - an indication of whether the derived table is5pdatable or read- only (this is derived from4he!!query expression>); A view descriptor describes a view. In addition to4he components of a derived table descriptor, a view descriptor includes: - an indication of whether the view has4he CHECK OPTION; if so, whether it is to be applied as CASCADED or LOCAL. 4.10 Integrity constraints Integrity constraints, generally referred to simply as constraints, define the valid states of SQL-data by constraining4he6alues in the base4ables. A constraint is either a table constraint, a domain constraint or an assertion. A constraint is described by a constraint descriptor. A constraint descriptor is either a table constraint descriptor, a domain constraint descriptor or an assertion descriptor. Every constraint descriptor includes: - the name of the constraint; - an indication of whether or not4he constraint is deferrable; - an indication of7hether4he initial constraint mode is deferred or immediate; A!!query expression> or!!query specification> is possibly non- deterministic if an implementation might, at two different times 7here4he state of the SQL-data is the same, produce results that differ by more4han the order of4he rows due to??eneral Rules4hat specify implementation-dependent behavior. No integrity constraint shall be defined5sing a!!query specifica- tion> or a!!query expression> that is possibly non-deterministic. 40 Database Language SQL X0ß0¯0í0ó(g()92-154e¤BL CBR-002 2 2 2.10 Integrity constraints 2 2 2.10.1 Checking of constraints Every constraint is either deferrable or non-deferrable. Within a transaction, every constraint has a constraint mode; if a con- straint is non-deferrable,4hen its constraint mode is always im- mediate, otherwise it is either or immediate or deferred. Every constraint has an initial constraint mode that specifies4he constraint mode for that constraint at4he start of each SQL- 4ransaction and immediately after definition of4hat constraint. !?f a constraint is deferrable, then its constraint mode may be changed (from immediate4o deferred, or from deferred4o immediate) by execution of a . The checking of a constraint depends on its constraint mode within the current SQL-transaction.!?f the constraint mode is immedi- ate,4hen the constraint is effectively checked at4he end of each SQL-statement.!?f the constraint mode is deferred,4hen the constraint is effectively checked7hen the constraint mode is changed to immediate either explicitly by execution of a!!set con- straints mode statement>, or implicitly at4he end of the current SQL-transaction. When a constraint is checked other4han at4he end of an SQL- 4ransaction, if it is not satisfied, then an exception condition is raised and4he SQL-statement4hat caused4he constraint to be checked has no effect other4han entering4he exception information into4he diagnostics area. 2 2 2 2hen a is executed, all constraints are effectively checked and, if any constraint is not satisfied,4hen an exception condition is raised and4he transaction is4erminated by an implicit!!rollback statement>. 2 2 2.10.(N) Table constraints A4able constraint is either a unique constraint, a referential constraint or a table check constraint. A table constraint is de- scribed by a table constraint descriptor which is either a unique constraint descriptor, a referential constraint descriptor or a 4able check constraint descriptor. A unique constraint is described by a unique constraint descriptor. !?n addition4o the components of every table constraint descriptor, a unique constraint descriptor includes: - an indication of7hether it was defined with PRIMARY KEY or UNIQUE, and - 4he names and0ositions of the unique columns specified in the ; A referential constraint is described by a referential constraint descriptor.!?n addition4o the components of every table constraint descriptor, a referential constraint descriptor includes: Concepts 41 X3H2-9(g()¬4/DBL CBR-00() 2 2 2.10 Integrity constraints - the names of4he referencing columns specified in the , - the names of4he referenced columns and referenced4able speci- fied in the , and - 4he6alue of the , if specified, and the , if specified. Note:!?f MATCH FULL or MATCH PARTIAL is specified for a referential constraint and if the referencing table has only one column spec- ified in for that referential constraint, or if the referencing table has more4han one specified column for that!!referential constraint definition>, but none of 4hose columns is nullable, then4he effect is4he same as if no 7ere specified. A4able check constraint is described by a table check constraint descriptor. In addition to4he components of every4able constraint descriptor, a4able check constraint descriptor includes: - the . A unique constraint is satisfied if and only if no4wo rows in a table have4he same non-null6alues in4he5nique columns.!?n addition, if the unique constraint was defined with PRIMARY KEY, 4hen it requires that none of4he6alues in4he specified column or columns be4he null value. !?n the case4hat a table constraint is a referential constraint, 4he4able is referred4o as4he referencing4able. The referenced columns of a referential constraint shall be4he5nique columns of some5nique constraint of the referenced4able. A referential constraint is satisfied if one of the following con- ditions is4rue, depending on the specified in the !!referential constraint definition>: - !?f no!!match type> was specified then, for each row R1 of4he referencing4able, either at least one of4he6alues of4he referencing columns in R1 shall be a null6alue, or4he6alue of each referencing column in R1 shall be equal4o the value of4he corresponding referenced column in some row of the referenced 4able. - !?f MATCH FULL7as specified4hen, 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 referenced4able such that4he6alue of each referencing col- umn in R1 is equal4o the value of4he corresponding referenced column in R2. 2 2 2(N) Database Language SQL X3H2-9(g()¬4/DBL CBR-00() 4.10!?ntegrity constraints - !?f MATCH PARTIAL was specified then, for each row R1 of4he referencing4able, there shall be some row R2 of the refer- enced4able such that4he6alue of each referencing column in R1 is either null or is equal4o the value of4he corresponding referenced column in R2. The referencing table may be4he same table as4he referenced ta- ble. A table check constraint is satisfied if and only if4he specified is not false for any row of a4able. 4.10.3 Domain constraints A domain constraint is a constraint4hat is specified for a domain. It is applied to all columns4hat are based on4hat domain, and to all values cast to4hat domain. A domain constraint is described by a domain constraint descriptor. !?n addition4o the components of every constraint descriptor a domain constraint descriptor includes: - 4he!!search condition>. A domain constraint is satisfied by SQL-data if and only if, for any4able T4hat has a column named C based on that domain,4he specified , with each occurrence of VALUE re- 0laced by C, is not false for any row of T. A domain constraint is satisfied by4he result of a!!cast specifi- cation> if and only if the specified , with each occurrence of VALUE replaced by4hat result, is not false. 4.10.4 Assertions An assertion is a named constraint that may relate to4he content of individual rows of a table,4o the entire contents of a4able, or to a state required to exist among a number of4ables. An assertion is described by an assertion descriptor.!?n addi- 4ion to4he components of every constraint descriptor an assertion descriptor includes: - 4he!!search condition>. An assertion is satisfied if and only if the specified is not false. Concepts 2 2 20ª0ü0à X0ß0¯0í0ó(g()92-154e¤BL CBR-002 4. SQL-schemas 4. SQL-schemas An SQL-schema is a0ersistent descriptor4hat includes: - 4he!!schema name> of the SQL-schema; - 4he!!authorization identifier> of4he owner of the SQL-schema; - The!!character set name> of4he default character set for4he SQL-schema; and - the descriptor of every component of4he SQL-schema. !?n this!?nternational Standard,4he4erm "schema" is used only in the sense of SQL-schema. Each component descriptor is either a domain descriptor, a base table descriptor, a view descriptor, an assertion descriptor, a0rivilege descriptor, a character set descriptor, a collation descriptor, or a4ranslation descriptor. The persistent objects described by the descriptors are said4o be owned by or to have been created by the of4he schema. A schema is created initially5sing a!!schema definition> and may be subsequently modified incrementally over time by the execution of s.!!schema name>s are unique7ithin a catalog. A is explicitly or implicitly qualified by a!!catalog name>4hat identifies a catalog. Base4ables and views are identified by
s. A!!table name> consists of a!!schema name> and an . For a per- sistent table,4he!!schema name> identifies the schema in which 4he base table or6iew identified by the
7as de- fined. Base tables and6iews defined in different schemas can have s that are equal according4o the General Rules of Subclause 8.(l4) "". !?f a reference to a!!table name> does not explicitly contain a !!schema name>, then a specific is implied. The par- ticular associated7ith such a!!table name> depends on the context in7hich4he!!table name> appears and is governed by the rules for . The default schema for!!prepara- ble statement>s that are dynamically0repared in4he current SQL- session4hrough4he execution of s and!!execute immediate statement>s is initially implementation-defined but may be changed by the use of!!set schema statement>s. 44 Database Language SQL X0ß0¯0í0ó(g()92-154e¤BL CBR-002 4. Catalogs 2 2 2.1(N) Catalogs Catalogs are named collections of schemas in an SQL-environment. An SQL-environment contains zero or more catalogs. A catalog con- 4ains one or more schemas, but always contains a schema named INFORMATION_SCHEMA4hat contains4he6iews and domains of the !?nformation Schema. The method of creation and destruction of catalogs is implementation-defined. The set of catalogs that can be referenced in any SQL-statement, during any0articular SQL-transaction, or during the course of an SQL-session is also implementation-defined. The default catalog for a 7hose does not specify an explicit!!cata- log name>4o qualify the is implementation-defined. The default catalog for s that are dynami- cally prepared in the current SQL-session through the execution of s and!!execute immediate statement>s is ini- 4ially implementation-defined but may be changed by4he5se of s. 4.ª Clusters of catalogs A cluster is an implementation-defined collection of catalogs. Exactly one cluster is associated with an SQL-session and it defines the totality of the SQL-data4hat is available4o that SQL-session. An instance of a cluster is described by an instance of a defi- nition schema.??iven some SQL-data object, such as a6iew, a con- straint, a domain, or a base table,4he definition of4hat object, and of all the objects that it directly or indirectly references, are in4he same cluster of catalogs. For example, no!!referential constraint definition> and no!!joined4able> can "cross" a cluster boundary. 2 2 2 2hether or not any catalog can occur simultaneously in more4han one cluster is implementation-defined. Within a cluster, no4wo catalogs have4he same name. 4. SQL-data SQL-data is any data described by schemas4hat is5nder4he control of an SQL-implementation in an SQL-environment. Concepts 2 2 25 X0ß0¯0í0ó(g()92-154e¤BL CBR-002 4.¬ SQL-environment 4.¬ SQL-environment An SQL-environment comprises4he following: - an SQL-implementation capable of processing some Level (Entry SQL, Intermediate SQL, or Full SQL) of this!?nternational Standard and at least one binding style; see Clause 20Ñ0ü0Ä "Conformance" for further information about binding styles; - zero or more catalogs; - zero or more!!authorization identifier>s; - +ero or more s; and - the SQL-data described by the schemas in4he catalogs. An SQL-environment may have other implementation-defined contents. The rules determining which s are considered4o be7ithin an SQL-environment are implementation-defined. 4.­ Modules A is an object specified in4he module language. A is either a persistent!!module> or an SQL-session . The mechanisms by7hich!!module>s are created or destroyed are implementation-defined. A!!module> consists of an optional , a , a!!module authorization clause>7ith either or both of a!!module authorization identifier> and a!!schema name>, an optional!!module character set specification> that iden- tifies4he character repertoire used for expressing the names of schema objects5sed in4he!!module>,+ero or more s,+ero or more cursors specified by!!declare cur- sor>s, and one or more!!procedure>s. All!!identifier>s contained in4he!!module> are expressed in either or4he character repertoire indicated by!!module character set specification>5nless they are specified7ith "". A compilation unit is a segment of executable code, possibly con- sisting of one or more subprograms. A!!module> is associated with a compilation unit during its execution. A single may be associated with multiple compilation units and multiple!!module>s may be associated with a single compilation unit. The manner in 7hich4his association is specified, including the possible re- quirement for execution of some implementation-defined statement, is implementation-defined. Whether a compilation unit may invoke or transfer control4o other compilation units,7ritten in the same or a different0rogramming language, is implementation-defined. 46 Database Language SQL X0ß0¯0í0ó(g()92-154e¤BL CBR-002 4. Procedures 2 2 2.17 Procedures A consists of a , a sequence of s, and a single . A in a!!module> is invoked by a compilation unit as- sociated7ith the by means of a host language "call" statement4hat specifies the of the and supplies a sequence of parameter values corresponding in number and in!!data4ype>4o the s of the . A call of a causes4he!!SQL procedure statement> that it contains4o be executed. 2 2 2.18 Parameters A parameter is declared in a!!procedure> by a . The specifies the of its value. A0arameter either assumes or supplies the value of the corresponding argument in the call of that!!procedure>. These !!data4ype>s map to host language4ypes and are not nullable except through the use of additional indicator variables. 4..1 Status0arameters The SQLSTATE and SQLCODE0arameters are status0arameters. They are set4o status codes4hat indicate either that a call of4he completed successfully or that an exception condition 7as raised during execution of the . Note: The SQLSTATE parameter is4he0referred status parameter. The SQLCODE parameter is a deprecated feature that is supported for compatibility7ith earlier versions of this!?nternational Standard. See Annex D, "Deprecated features". A shall specify either4he SQLSTATE parameter or4he SQLCODE parameter or both. The SQLSTATE parameter is a charac- ter string0arameter for7hich exception6alues are defined in Clause 2(l4) "Status codes". The SQLCODE0arameter is an integer0a- rameter for which the negative exception6alues are implementation- defined. If a condition is raised4hat causes a statement4o have no effect other than4hat associated7ith raising the condition (that is, not a completion condition), then4he condition is said4o be an exception condition or exception.!?f a condition is raised that permits a statement to have an effect other than4hat associated with raising4he condition (corresponding to an SQLSTATE class value of successful completion, warning, or no data), then4he condition is said to be a completion condition. Concepts 2 2 27 X0ß0¯0í0ó(g()92-154e¤BL CBR-002 4. Parameters 2 2 2.18.(N) Data parameters A data parameter is a0arameter4hat is5sed to either assume or supply the value of data exchanged between a host0rogram and an SQL-implementation. 2 2 2.18.0µ0ó0Á0ü0à!?ndicator0arameters An indicator0arameter is an integer0arameter4hat is specified immediately following another parameter.!?ts0rimary5se is to indicate7hether4he6alue4hat the other parameter assumes or supplies is a null6alue. An indicator0arameter cannot immediately follow another indicator parameter. The other5se for indicator0arameters is4o indicate7hether string data truncation occurred during a4ransfer between a host program and an SQL-implementation in0arameters or host variables. If a non-null string6alue is transferred and the length of the 4arget data item is sufficient to accept the entire source data item, then4he indicator0arameter or variable is set to 04o in- dicate that4runcation did not occur.?!owever, if4he length of the target data item is insufficient, then4he indicator0arame- ter or6ariable is set4o the length of the source data item (in characters or bits, as appropriate) to indicate that4runcation occurred and to indicate the original length in characters or bits, as appropriate, of4he source. 2 2 2.19 Diagnostics area The diagnostics area is a place where completion and exception con- dition information is stored when an SQL-statement is executed. There is one diagnostics area associated7ith an SQL-agent, regard- less of4he number of!!module>s4hat the SQL-agent includes or the number of connections in use. At the beginning of4he execution of any statement that is not an ,4he diagnostics area is emptied. An implementation shall0lace information about a completion condition or an exception condition reported by SQLCODE or SQLSTATE into this area. If other conditions are raised, an implementation may place information about4hem into4his area. s containing s return a code indicating completion or exception conditions for that statement via SQLCODE or SQLSTATE, but do not modify4he diagnostics area. An SQL-agent may choose4he size of4he diagnostics area with4he ; if an SQL-agent does not specify the size of4he diagnostics area,4hen 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 into4his area about fewer conditions than are specified. The ordering of4he information about conditions placed 2 2 28 Database Language SQL X3H2-9(g()¬4/DBL CBR-00() 2 2 2.19 Diagnostics area into4he diagnostics area is implementation-dependent, except that the first condition in4he diagnostics area always corresponds4o 4he condition specified by the SQLSTATE or SQLCODE value. 2 2 2.20 Standard programming languages This International Standard specifies4he actions of s in!!module>s7hen those s are called by0rograms that conform to certain specified0rogramming language standards. The term "standard PLN0rogram"+"+7here PLN is the name of a program- ming language, refers to a0rogram4hat conforms4o the standard for that0rogramming language as specified in Clause 2, "Normative references". This International Standard also specifies a mechanism 7hereby SQL language may be embedded in0rograms that otherwise conform to any of the same specified0rogramming language stan- dards. Note: In4his International Standard, for the purposes of inter- facing7ith programming languages,4he data types DATE, TIME, TIMESTAMP, and INTERVAL shall be converted to or from character strings in4hose0rogramming languages by means of a!!cast speci- fication>. It is anticipated that future evolution of0rogramming language standards7ill support data4ypes corresponding4o these four SQL data4ypes; this standard will4hen be amended4o reflect 4he availability of4hose corresponding data types. The data type CHARACTER is also mapped4o character strings in4he0rogramming languages.?!owever, because the facilities available in the pro- gramming languages do not provide the same capabilities as4hose available in SQL, there shall be agreement between4he host pro- gram and SQL regarding4he specific format of the character data being exchanged. Specific syntax for4his agreement is0rovided in this!?nternational standard. For standard programming lan- guages, C, COBOL, Fortran, and Pascal, bit strings are mapped to character variables in4he host language in a manner described in Subclause 19.1, "". For standard0ro- gramming languages Ada and PLg, bit string6ariables are directly supported. 4.(h*) Cursors A cursor is specified by a , , or . For every!!declare cursor> or!!dynamic declare cursor> in a!!mod- ule>, a cursor is effectively created when an SQL-transaction (see Subclause 4.(R´), "SQL-transactions") referencing the is initiated, and destroyed when4hat SQL-transaction is4erminated. A cursor is also effectively created7hen an!!allocate cursor state- ment> is executed within a SQL-transaction and destroyed7hen that SQL-transaction is4erminated.!?n addition, an extended dynamic Concepts 49 X3H2-9(g()¬4/DBL CBR-00() 2 2 2.21 Cursors cursor is destroyed7hen a is exe- cuted4hat deallocates the prepared statement on which the extended dynamic cursor is based. A cursor is in either4he open state or4he closed state. The ini- 4ial state of a cursor is4he closed state. A cursor is0laced in the open state by an!!open statement> or!!dynamic open statement> and returned to4he closed state by a!!close statement> or , a , or a!!rollback statement>. A cursor in4he open state identifies a4able, an ordering of4he rows of that4able, and a position relative to4hat ordering. If the does not include an!!order by clause>, or includes an that does not specify the order of the rows completely,4hen the rows of the table have an order that is defined only to4he extent that4he!!order by clause> specifies an order and is otherwise implementation-dependent. When4he ordering of a cursor is not defined by an!!order by clause>,4he relative positions of4wo rows is implementation- dependent. 2 2 2 2hen the ordering of a cursor is partially determined by an ,4hen the relative0ositions of two rows are determined only by4he!!order by clause>; if4he4wo rows have equal values for4he0urpose of evaluating4he!!order by clause>, 4hen their relative0ositions are implementation-dependent. A cursor is either read-anly or5pdatable. If4he4able identified by a cursor is not updatable or if INSENSITIVE is specified for the cursor, then4he cursor is read-only; otherwise,4he cursor is updatable. The operations of5pdate and delete are not allowed for read-anly cursors. The0osition of a cursor in4he open state is either before a cer- 4ain row, on a certain row, or after the last row. If a cursor is on a row, then4hat row is4he current row of the cursor. A cursor may be before the first row or after4he last row of a4able even 4hough the table is empty. When a cursor is initially opened,4he position of the cursor is before4he first row. A or!!dynamic fetch statement>0ositions an open cursor on a specified row of4he cursor's ordering and retrieves the values of the columns of4hat row. An or!!dynamic update statement: positioned> updates the current row of the cursor. A or deletes the current row of4he cursor. If an error occurs during the execution of an SQL-statement that identifies an open cursor,4hen, except where otherwise explic- itly defined,4he effect, if any, on the position or state of4hat cursor is implementation-dependent. !?f a cursor is open, and the current SQL-transaction makes a change to SQL-data other than4hrough4hat cursor, and the for that cursor specified INSENSITIVE,4hen the effect of 4hat change7ill not be6isible4hrough4hat cursor before it is closed. Otherwise, whether the effect of such a change will be 50 Database Language SQL X0ß0¯0í0ó(g()92-154e¤BL CBR-002 2 2 2.21 Cursors 6isible4hrough4hat cursor before it is closed is implementation- dependent. 4.(g ) SQL-statements 4.(g ).1 Classes of SQL-statements An SQL-statement is a string of characters4hat conforms4o the format and syntax rules specified in this international standard. Most SQL-statements can be0repared for execution and executed in one of a number of ways. These are: - in a!!module>, in which case it is0repared when4he!!module> is created (see Subclause 4.­, "Modules") and executed when4he containing procedure is called. - in an embedded SQL host program, in which case it is0re- pared when4he embedded SQL host0rogram is preprocessed (see Subclause 4.(y>), "Embedded syntax"). - being0repared and executed by the use of SQL-dynamic statements (which are4hemselves executed in one of4he foregoing4wo7ays- see Subclause 2 2 2.24, "SQL dynamic statements"). - direct invocation, in7hich case it is effectively prepared immediately0rior4o execution (see Subclause 2 2 2.25, "Direct invocation of SQL"). There are at least five ways of classifying SQL-statements: - According4o their effect on SQL objects,7hether0ersistent objects, i.e., SQL-data and schemas, or transient objects, such as SQL-sessions and other SQL-statements. - According4o whether or not4hey start a transaction, or can, or must, be executed when no transaction is active. - According to7hether or not they may be embedded. - According4o whether they may be dynamically prepared and exe- cuted. - According to7hether or not they may be directly executed. This International Standard0ermits implementations4o provide ad- ditional, implementation-defined, statements that may fall into any of4hese categories. This Subclause will not mention4hose state- ments again, as4heir classification is entirely implementation- defined. Concepts 51 X3H2-9(g()¬4/DBL CBR-00() 2 2 2.2(N)SQL-statements 4.(g ).2 SQL-statements classified by function The following are the main classes of SQL-statements: - SQL-schema statements; these may have a0ersistent effect on schemas - SQL-data statements; some of these,4he SQL-data change state- ments, may have a persistent effect on SQL-data - SQL-transaction statements; except for the , these, and4he following classes, have no effects that0ersist 7hen a session is4erminated - SQL-connection statements - SQL-session statements - SQL-dynamic statements - SQL-diagnostics statements - SQL embedded exception declaration The following are4he SQL-schema statements: - !!schema definition> - - !!domain definition> - - !!table definition> - !!drop4able statement> - !!view definition> - - !!assertion definition> - !!drop assertion statement> - !!alter table statement> - - - !!revoke statement> - !!character set definition> - !!drop character set statement> 52 Database Language SQL X0ß0¯0í0ó(g()92-154e¤BL CBR-002 4.(g ) SQL-statements - - - - The following are4he SQL-data statements: - !!temporary table declaration> - - - - !!dynamic select statement> - !!open statement> - !!dynamic open statement> - !!close statement> - - !!fetch statement> - - !!select statement: single row> - !!direct select statement: multiple rows> - !!dynamic single row select statement> - All SQL-data change statements The following are4he SQL-data change statements: - - - - - - !!update statement: searched> - !!update statement: positioned> - !!dynamic update statement: positioned> Concepts 50ª0ü0à X0ß0¯0í0ó(g()92-154e¤BL CBR-002 4.(g ) SQL-statements - The following are the SQL-transaction statements: - !!set transaction statement> - - - The following are4he SQL-connection statements: - !!connect statement> - - The following are4he SQL-session statements: - - !!set schema statement> - !!set names statement> - - The following are the SQL-dynamic statements: - !!execute immediate statement> - - !!deallocate descriptor statement> - - - - !!deallocate0repared statement> - - - !!execute statement> The following is the SQL-diagnostics statement: - 54 Database Language SQL X0ß0¯0í0ó(g()92-154e¤BL CBR-002 4.(g ) SQL-statements The following is the SQL embedded exception declaration: - !!embedded exception declaration> 4.(g ).3 Embeddable SQL-statements The following SQL-statements are embeddable in an embedded SQL host 0rogram, and may be4he!!SQL procedure statement> in a in a : - All SQL-schema statements - All SQL-transaction statements - All SQL-connection statements - All SQL-session statements - All SQL-dynamic statements - All SQL-diagnostics statements - The following SQL-data statements: o!!allocate cursor statement> o o o o!!dynamic close statement> o o!!dynamic fetch statement> o o o 58 Database Language SQL X0ß0¯0í0ó(g()92-154e¤BL CBR-002 4.(g ) SQL-statements o o o o!!update statement: positioned> o!!dynamic update statement: positioned> o!!preparable dynamic5pdate statement:0ositioned> 2 2 2.2(‘Ñ)6 SQL-statements and transaction states 2 2 2 2hether an starts a4ransaction de- pends on7hat SQL-statement is4he6alue of . 2 2 2 2hether an starts a4ransaction depends on7hat SQL-statement was the value of!!SQL statement variable> 7hen the prepared statement identified by!!SQL statement name> was 0repared. The following SQL-statements are transaction initiating SQL- statements, i.e., if there is no current transaction, and a state- ment of4his class is executed, a4ransaction is initiated: - All SQL-schema statements - The following SQL-data statements: o!!allocate cursor statement> o o o o o!!dynamic close statement> o o!!dynamic fetch statement> o
shall not be a declared local 4emporary4able. 7) No shall specify DEFINITION_SCHEMA. 8) If a!!qualified name> does not contain a!!schema name>, then Case: a) If4he!!qualified name> is contained in a ,4hen the that is specified or implicit in4he!!schema definition> is implicit. b) If4he!!qualified name> is contained in a 4hat is0repared in4he current SQL-session by an!!ex- ecute immediate statement> or a or in a 4hat is invoked directly,4hen the default for the SQL-session is implicit. c) Otherwise, the that is specified or implicit for the is implicit. 9)!?f a does not contain a!!catalog name>,4hen Case: a)!?f the is contained in a ,4hen an implementation-defined is implicit. b) If4he!!unqualified schema name> is contained in a!!schema definition> other4han in a!!schema name clause>,4hen the 4hat is specified or implicit in the is implicit. c) If4he!!unqualified schema name> is contained in a!!prepara- ble statement> that is prepared in the current SQL-session by an or a!!prepare statement> or in a!!direct SQL statement> that is invoked directly, then 4he default catalog name for the SQL-session is implicit. d)!?f the is contained in a , then Case: i) If4he!!schema name clause> is contained in a , 4hen the explicit or implicit!!catalog name> contained in the is implicit. Lexical elements 101 X3H2-9(g()¬4/DBL CBR-00() 5.4 Names and identifiers ii) Otherwise, an implementation-defined!!catalog name> is implicit. e) Otherwise,4he explicit or implicit contained in the is implicit. 10)Two s are equal if and only if4hey have4he same and4he same , regard- less of7hether4he!!schema name>s are implicit or explicit. )Two!!schema name>s are equal if and only if4hey have4he same and the same!!catalog name>, regard- less of7hether4he!!catalog name>s are implicit or explicit. )An 4hat is a!!correlation name> is associated with a4able7ithin a particular scope. The scope of a!!correlation name> is either a
"). Scopes may be nested.!?n different scopes, the same!!correlation name> may be associated with different4ables or7ith the same 4able. ª)The!!simple6alue specification> of!!extended statement name> or shall not be a . 14)The data4ype of4he!!simple6alue specification> of!!ex- tended statement name> shall be character string7ith an implementation-defined character set and shall have an octet length of 8 octets or less. ¬)The data type of the of shall be character string7ith an implementation- defined character set and shall have an octet length of 1(R´) octets or less. 16)The data4ype of4he!!simple6alue specification> of!!descriptor name> shall be character string7ith an implementation-defined character set and shall have an octet length of 8 octets or less. )In a ,!!extended statement name>, or!!extended cursor name>, if a is not specified,4hen a of LOCAL is implicit. 18)No!!authorization identifier> shall specify "PUBLIC". )Those!!identifier>s4hat are valid s are implementation-defined. (eå))Those!!identifier>s4hat are valid s are implementation- defined. 10(N) Database Language SQL X3H2-9(g()¬4/DBL CBR-00() 5.4 Names and identifiers (h*))If a does not specify a ,4hen INFORMATION_SCHEMA is implicit. (g ))If a does not specify a ,4hen INFORMATION_SCHEMA is implicit. (y>))If a does not specify a ,4hen INFORMATION_SCHEMA is implicit. (T ))The!!data4ype> of ,!!connection name>, and shall be character string with an implementation- defined character set and shall have an octet length of 8 octets or less. (ry))If a does not specify a!!schema name>, then!?NFORMATION_SCHEMA is implicit; otherwise, INFORMATION_ SCHEMA shall be specified. Access Rules None. General Rules 1) A!!table name> identifies a4able. (SA) 2 2 2 2ithin its scope, a!!correlation name> identifies a4able. 0Î0Ã0È A!!local table name> identifies a declared local temporary ta- ble. 2 2 2) A identifies a column. 5) A identifies a domain. 5 5) An!!authorization identifier> represents an authorization iden- tifier and identifies a set of0rivileges. 5 5 5) A identifies a!!module>. 8) A identifies a cursor. 9) A identifies a . 10)A identifies a parameter. 11)A identifies a4able constraint, a domain constraint, or an assertion. 1(SA)A identifies a statement prepared by the execu- 4ion of a!!prepare statement>. The scope of a!!statement name> is4he!!module> in7hich it appears and the current SQL-session. Lexical elements 100ª0ü0à X0ß0¯0í0ó(g()92-154e¤BL CBR-002 5.4 Names and identifiers 10Î0Ã0ÈThe value of an identifies a statement 0repared by4he execution of a .!?f a of GLOBAL is specified,4hen the scope of4he!!extended statement name> is the current SQL-session.!?f a of LOCAL is specified or implicit, then4he scope of the state- ment name is further restricted4o the in which the appears. 14)A identifies a cursor in an . 15)The value of an identifies a cursor cre- ated by the execution of an .!?f a of GLOBAL is specified,4hen the scope of4he !!extended cursor name> is4he current SQL-session. If a!!scope option> of LOCAL is specified of implicit,4hen the scope of4he cursor name is further restricted4o the in which the appears. ­)A!!descriptor name> identifies an SQL descriptor area created by the execution of an .!?f a of GLOBAL is specified,4hen the scope of4he !!descriptor name> is the current SQL-session.!?f a of LOCAL is specified or implicit, then4he scope of the is further restricted to4he!!module> in7hich 4he!!descriptor name> appears. )A!!catalog name> identifies a catalog. )A!!schema name> identifies a schema. )A!!collation name> identifies a collating sequence. 20)A identifies a character set. 21)A identifies a character translation. 2(SA)A identifies a form-of-use con- version. All!!form-af-use conversion name>s are implementation- defined. 20Î0Ã0ÈA identifies an SQL-connection. Leveling Rules 1) The following restrictions apply for!?ntermediate SQL: a) Conforming Intermediate SQL language shall not contain any or!!extended cursor name>. b) Conforming Intermediate SQL language shall not contain any explicit!!catalog name>,!!connection name>, , , , or . 104 Database Language SQL X3H2-9(g()¬4/DBL CBR-00() 5.4 Names and identifiers (SA) The following restrictions apply for Entry SQL in addition to any!?ntermediate SQL restrictions: a) Conforming Entry SQL language shall not contain any ,!!SQL statement name>,!!dynamic cursor name>, ,!!descriptor name>, or!!character set name>. b) An shall not specify a!!character set specifica- 4ion>. Lexical elements 105 X0ß0¯0í0ó(g()92-154e¤BL CBR-002 10 Database Language SQL X0ß0¯0í0ó(g()92-154e¤BL CBR-002 6 Scalar expressions 6.1 !!data4ype> Function Specify a data4ype. Format ::= [ CHARACTER SET ] =!!national character string type> | | =!!datetime4ype> =!!interval4ype> !!character string4ype> ::= CHARACTER [!!left0aren> !!right paren> ] = CHAR [ !!length> ] | CHARACTER VARYING !!length> | CHAR VARYING!!left0aren> !!right paren> = VARCHAR!!left0aren> !!right paren> !!national character string type> ::= NATIONAL CHARACTER [!!left0aren> !!right paren> ] = NATIONAL CHAR [!!left0aren> !!right paren> ] = NCHAR [!!left0aren> !!right paren> ] = NATIONAL CHARACTER VARYING !!length> = NATIONAL CHAR VARYING!!left0aren> !!right paren> = NCHAR VARYING!!left0aren> !!right paren> !!bit string4ype> ::= BIT [!!left0aren> !!right paren> ] = BIT VARYING!!left0aren> !!right paren> !!numeric type> ::= =!!approximate numeric type> ::= NUMERIC [!!left0aren> [ ] ] = DECIMAL [!!left0aren> [ ] ] Scalar expressions 107 X3H2-9(g()¬4/DBL CBR-00() 5 5.1!!data4ype> = DEC [!!left0aren> [ ] ] =!?NTEGER =!?NT = SMALLINT ::= FLOAT [!!left0aren> ] | REAL = DOUBLE PRECISION ::=!!unsigned integer> ::= !!scale> ::=!!unsigned integer> ::= DATE = TIME [ !!time0recision> ] [ WITH TIME ZONE ] = TIMESTAMP [!!left0aren> ] [ WITH TIME ZONE ] !!time0recision> ::=
::=
[ [ AS ] [!!left0aren> ] ] | [ AS ]!!correlation name> [ !!derived column list>!!right paren> ] =!!joined4able> ::=
!!derived column list> ::=!!column name list> ::= !!column name> ["!!comma>!!column name>(... ] Syntax Rules 1) A!!correlation name> immediately contained in a!!table refer- ence> TR is exposed by TR. A
immediately contained in a
TR is exposed by TR if and only if TR does not specify a!!correlation name>. 2) Case: a) If a!!table reference> TR is contained in a FC 7ith no intervening!!derived table>, then4he scope clause SC of TR is the
of TR is the
immediately contained in a
TR has a scope clause and scope defined by4hat
if and only if4he!!table name> is exposed by TR. 6) The same shall not be specified more than once in a!!derived column list>. 7)!?f a is specified in a
, 4hen the number of s in the shall be4he same as4he degree of4he4able specified by the or4he!!table name> of4hat
, and4he name of4he i-th column of that!!derived table> or the effective name of the i-th column of4hat
is the i-th!!column name> in that!!derived column list>. 8) A!!derived table> is an5pdatable derived4able if and only if the simply contained in4he!!subquery> of4he !!table subquery> of4he!!derived table> is updatable. Access Rules 1) Let T be the table identified by the
immediately contained in
.!?f the
is contained in any of: a) a simply contained in a!!cursor speci- fication>, a!!view definition>, a , or an ; or b) a!!table expression> or!!select list> immediately contained in a
contained in a
defines that!!correlation name> or!!table name> to be an identifier of4he4able identified by4he!!table name> or!!derived table> of that!!table reference>. Scalar expressions 9 X0ß0¯0í0ó(g()92-154e¤BL CBR-002 6.0µ0ó0Á0ü0à
Leveling Rules 1) The following restrictions apply for Intermediate SQL: a) A
shall not be a!!derived table>. (SA) The following restrictions apply for Entry SQL in addition to any!?ntermediate SQL restrictions: a) A
shall not be a!!joined4able>. b) The optional AS shall not be specified. c) shall not be specified. 1(eå) Database Language SQL X0ß0¯0í0ó(g()92-154e¤BL CBR-002 5 5.4!!column reference> 5 5.4 Function Reference a column. Format !!column reference> ::= [ ]!!column name> !!qualifier> ::= !!table name> | Syntax Rules 1) Let CR be the , let CN be the contained in CR, and let C be the column identified by CN. 2) If CR contains a!!qualifier> Q, then CR shall appear7ithin the scope of one or more!!table name>s or s that are equal4o Q.!?f there is more than one such
or , then4he one7ith the most local scope is specified. Let T be the table associated7ith Q. a) T shall include a column whose is CN. b)!?f T is a!!table reference> in a J, then CN shall not be a common column name in J. Note: Common column name is defined in Subclause 7.5, "". 2 2) If CR does not contain a!!qualifier>, then CR shall be contained 7ithin the scope of one or more!!table name>s or s whose associated4ables include a column7hose!!column name> is CN. Let the phrase0ossible qualifiers denote those
s and s. a) Case: i)!?f the most local scope contains exactly one possible qualifier,4hen the qualifier Q equivalent4o that5nique !!table name> or!!correlation name> is implicit. ii)!?f there is more than one0ossible qualifier with most local scope, then: 1) Each possibleiualifier shall be a
or a !!correlation name> of a!!table reference>4hat is di- rectly contained in a J. Scalar expressions 1(h*) X3H2-9(g()¬4/DBL CBR-00() 5 5.4!!column reference> 2) CN shall be a common column name in J. Note: Common column name is defined in Subclause 7.5, "". 0Î0Ã0È The implicit qualifier Q is implementation-dependent. The scope of Q is that7hich Q7ould have had if J had been replaced by4he!!table reference>: ( J ) AS Q b) Let T be4he4able associated with Q. 4) The data type of CR is the data4ype of column C of T. CN shall 5niquely identify a column of T. 5)!?f the data4ype of CR is character string,4hen CR has4he !?mplicit coercibility attribute and its collating sequence is 4he default collating sequence for column C of T. 5 5) If4he data type of CR is TIME or TIMESTAMP,4hen the implicit 4ime zone of the data is the current default time+one for the SQL-session. 5 5 5) If4he data type of CR is TIME 2 2 2 2ITH TIME ZONE or TIMESTAMP 2 2 2 2ITH TIME ZONE,4hen the time+one of4he data is4he4ime zone rep- resented in the value of CR. 8) If CR is contained in a
TE and the scope clause of the
immediately containing4he!!ta- ble name> or!!correlation name> Q also contains TE, then CR is an outer reference to4he4able associated with Q. 9) Let CR be4he!!column reference> and let C be4he column identi- fied by CR. C is an underlying column of CR.!?f C is a!!derived column>,4hen every underlying column of C is an5nderlying column of CR. Note: The5nderlying columns of a!!derived column> are defined in Subclause 5 5 5.9, "". Access Rules 1) The applicable privileges shall include SELECT for T if CR is contained in any of: a) a immediately contained in a or an!!update statement: searched>; or b) a immediately contained in an!!update source>. (N) Database Language SQL X3H2-9(g()¬4/DBL CBR-00() 6.4 General Rules 1) The!!column reference> Q.CN references column C in a given row of T. (SA)!?f the data4ype of CR is TIME, TIMESTAMP, TIME 2 2 2 2ITH TIME ZONE or TIMESTAMP 2 2 2 2ITH TIME ZONE,4hen let TZ be an!?NTERVAL HOUR TO MINUTE containing the value of4he4ime zone displacement associated7ith CR. The value of CR, normalized to UTC, is ef- fectively computed as CR + TZ. Leveling Rules 1) The following restrictions apply for Intermediate SQL; None. 2) The following restrictions apply for Entry SQL; None. Scalar expressions 0ª0ü0à X0ß0¯0í0ó(g()92-154e¤BL CBR-002 6.5 6.5 !!set function specification> Function Specify a6alue derived by the application of a function to an argument. Format ::= COUNT!!left0aren> !!right paren> =!!general set function> ::= !!set function4ype> !!left0aren> [ ]!!value expression> !!set function4ype> ::= AVG= MAX= MIN= SUM= COUNT !!set quantifier> ::= DISTINCT= ALL Syntax Rules 1) If!!set quantifier> is not specified, then ALL is implicit. (SA) The argument of COUNT(*) and the argument source of a!!general set function> is a4able or a group of a grouped4able as spec- ified in Subclause 5 5 5.8, ""+"+ and Subclause 5 5 5.9, "". Note: argument source is defined in Subclause 7.8, "". 0Î0Ã0È Let T be the argument or argument source of a!!set function specification>. 2 2 2) The simply contained in!!set function spec- ification> shall not contain a or a . If4he!!value expression> contains a!!column ref- erence> that is an outer reference, then4hat outer reference shall be4he only contained in the . Note: Outer reference is defined in Subclause 5 5.4, "". 5)!?f a contains a 4hat is an outer reference,4hen the shall be contained in either: a) a!!select list>, or 1(T ) Database Language SQL X0ß0¯0í0ó(g()92-154e¤BL CBR-002 5 5.5!!set function specification> b) a!!subquery> of a!!having clause>, in7hich case the scope of4he explicit or implicit of4he!!column refer- ence> shall be a!!table reference>4hat is directly contained in4he!!table expression> that directly contains4he!!having clause>. Note: Outer reference is defined in Subclause 5 5.4, "". 6) Let DT be4he data type of the . 7)!?f COUNT is specified, then4he data type of the result is exact numeric with implementation-defined precision and scale of 0. 8)!?f MAX or MIN is specified,4hen the data4ype of4he result is DT. 9) If SUM or AVG is specified, then: a) DT shall not be character string, bit string, or datetime. b)!?f SUM is specified and DT is exact numeric7ith scale S,4hen the data4ype of4he result is exact numeric7ith implementation-defined0recision and scale S. c) If AVG is specified and DT is exact numeric,4hen the data 4ype of4he result is exact numeric7ith implementation- defined precision not less4han the precision of DT and implementation-defined scale not less than4he scale of DT. d) If DT is approximate numeric, then4he data type of the result is approximate numeric with implementation-defined precision not less4han the precision of DT. e)!?f DT is interval, then4he data type of the result is inter- 6al7ith the same0recision as DT. 10)If the data4ype of4he result is character string,4hen the collating sequence and4he coercibility attribute are determined as in Subclause 2 2 2.2.3, "Rules determining collating sequence usage". Access Rules None. General Rules 1) Case: a)!?f COUNT(*) is specified,4hen the result is the cardinality of T. Scalar expressions 1(ry) X3H2-9(g()¬4/DBL CBR-00() 5 5.5!!set function specification> b) Otherwise, let TX be the single-column table that is the result of applying4he!!value expression> to each row of T and eliminating null values. If one or more null values are eliminated,4hen a completion condition is raised: warning- null value eliminated in set function. (SA)!?f DISTINCT is specified,4hen let TXA be4he result of elimi- nating redundant duplicate6alues from TX. Otherwise, let TXA be TX. Case: a) If4he!!general set function> COUNT is specified, then4he result is4he cardinality of TXA. b)!?f AVG, MAX, MIN, or SUM is specified, then Case: i) If TXA is empty,4hen the result is the null6alue. ii) If AVG is specified,4hen the result is the average of4he values in TXA. iii)!?f MAX or MIN is specified,4hen the result is respec- 4ively the maximum or minimum6alue in TXA. These results are determined5sing4he comparison rules specified in Subclause 8.(l4) "". iv)!?f SUM is specified, then4he result is4he sum of the 6alues in TXA. If4he sum is not within4he range of the data type of the result, then an exception condition is raised: data exception-numeric6alue out of range. Leveling Rules 1) The following restrictions apply for Intermediate SQL: a) If a!!general set function> specifies DISTINCT, then4he !!value expression> shall be a!!column reference>. 2) The following restrictions apply for Entry SQL in addition4o any Intermediate SQL restrictions: a)!?f a specifies or implies ALL,4hen COUNT shall not be specified. b) If a!!general set function> specifies or implies ALL, then 4he!!value expression> shall include a 4hat references a column of T. c) If4he!!value expression> contains a!!column reference> that is an outer reference, then4he!!value expression> shall be a !!column reference>. 1(Œ¡) Database Language SQL X0ß0¯0í0ó(g()92-154e¤BL CBR-002 5 5.5!!set function specification> d) No contained in a shall reference a column derived from a!!value expres- sion> that generally contains a . Scalar expressions 7 X0ß0¯0í0ó(g()92-154e¤BL CBR-002 6.6 6.6 !!numeric value function> Function Specify a function yielding a6alue of type numeric. Format !!numeric value function> ::= | =!!length expression> !!position expression> ::= POSITION !!character value expression> IN!!character value expression> ::= =!!octet length expression> =!!bit length expression> !!char length expression> ::= { CHAR_LENGTH | CHARACTER_LENGTH( !!left0aren> ::= OCTET_LENGTH!!left0aren> !!bit length expression> ::= BIT_LENGTH !!string6alue expression>!!right paren> ::= EXTRACT!!left0aren> FROM!!extract source> ::= =!!time+one field> !!time+one field> ::= TIMEZONE_HOUR = TIMEZONE_MINUTE !!extract source> ::= | 8 Database Language SQL X3H2-9(g()¬4/DBL CBR-00() 6.6 Syntax Rules 1) If!!position expression> is specified,4hen the character reper- 4oires of4he4wo!!character value expression>s shall be the same. (SA)!?f is specified, then4he data type of the result is exact numeric with implementation-defined precision and scale 0. 2 2) If!!extract expression> is specified, then Case: a) If!!extract field> is a , then it shall iden- tify a!!datetime field> of4he!!interval6alue expression> or immediately contained in!!extract source>. b)!?f is a!!time+one field>, then4he data type of the shall be TIME 2 2 2 2ITH TIME ZONE or TIMESTAMP 2 2 2 2ITH TIME ZONE. 2 2 2) If!!extract expression> is specified, then Case: a) If!!datetime field> does not specify SECOND,4hen the data 4ype of4he result is exact numeric7ith implementation- defined precision and scale 0. b) Otherwise, the data4ype of4he result is exact numeric 7ith implementation-defined0recision and scale. The implementation-defined scale shall not be less4han the spec- ified or implied!!time fractional seconds precision> or , as appropriate, of the SECOND!!datetime field> of4he!!extract source>. 5) If a!!length expression> is specified,4hen the data4ype of4he result is exact numeric7ith implementation-defined0recision and scale 0. Access Rules None. General Rules 1)!?f is specified and neither!!character value expression> is4he null value,4hen Case: a)!?f the first has a length of 0, then4he result is 1. Scalar expressions 9 X0ß0¯0í0ó(g()92-154e¤BL CBR-002 6.6 b) If4he6alue of the first is equal to an identical-length substring of contiguous char- acters from4he6alue of the second!!character value ex- pression>,4hen the result is 1 greater than4he number of characters within4he6alue of the second!!character value expression> preceding the start of4he first such substring. c) Otherwise, the result is 0. 2) If!!position expression> is specified and either!!character value expression> is4he null value,4hen the result is the null 6alue. 0Î0Ã0È!?f is specified,4hen Case: a)!?f the value of4he!!interval6alue expression> or the is not4he null value,4hen Case: i)!?f is a!!datetime field>,4hen the re- sult is4he6alue of the datetime field identified by4hat !!datetime field> and has the same sign as4he!!extract source>. Note: If4he6alue of the identified!!datetime field> is zero or if!!extract source> is not an , then4he sign is irrelevant. ii) Otherwise, let TZ be the interval6alue of the implicit or explicit time+one associated7ith the . If!!extract field> is TIMEZONE_HOUR,4hen the result is calculated as EXTRACT (HOUR FROM TZ) Otherwise,4he result is calculated as EXTRACT (MINUTE FROM TZ) b) Otherwise,4he result is4he null value. 2 2 2) If a!!char length expression> is specified, then Case: a) Let S be4he!!string6alue expression>. If4he6alue of S is not4he null value,4hen Case: i)!?f the data4ype of S is a character data4ype,4hen the result is4he number of characters in4he6alue of S. ii) Otherwise, the result is OCTET_LENGTH(S). b) Otherwise, the result is the null6alue. ª0 Database Language SQL X3H2-9(g()¬4/DBL CBR-00() 6.6 5)!?f an!!octet length expression> is specified,4hen Case: a) Let S be the .!?f the value of S is not the null6alue, then4he result is4he smallest integer not less4han the quotient of the division (BIT_LENGTH(S)/8). b) Otherwise,4he result is4he null value. 5 5) If a!!bit length expression> is specified,4hen Case: a) Let S be the .!?f the value of S is not the null6alue, then4he result is4he number of bits in 4he6alue of S. b) Otherwise, the result is the null6alue. Leveling Rules 1) The following restrictions apply for!?ntermediate SQL: a) A!!numeric value function> shall not be a!!position expres- sion>. b) A shall not contain a!!length ex- 0ression>4hat is a!!bit length expression>. (SA) The following restrictions apply for Entry SQL in addition to any!?ntermediate SQL restrictions: a) A shall not be a . b) A!!numeric value function> shall not be an . Scalar expressions 10Ó0ë X3H2-9(g()¬4/DBL CBR-00() 5 5.7!!string6alue function> 6.7 !!string6alue function> Function Specify a function9ielding a value of4ype character string or bit string. Format ::= =!!bit value function> ::= !!character substring function> | =!!form-af-use conversion> | | ::= SUBSTRING!!left0aren> FROM [ FOR ] ::=" UPPER= LOWER(!!left0aren> !!right paren> ::= CONVERT!!left0aren> USING!!form-af-use conversion name>!!right paren> !!character translation> ::= TRANSLATE!!left0aren> USING!!translation name> ::= TRIM!!left0aren> ::= [ [ ] [!!trim character> ] FROM ]!!trim source> ::= !!trim specification> ::= LEADING | TRAILING = BOTH ::=!!character value expression> ::= 10Õ0¡0é0Ã0É Database Language SQL X0ß0¯0í0ó(g()92-154e¤BL CBR-002 6.7 !!bit substring function> ::= SUBSTRING !!bit value expression> FROM!!start position> [ FOR!!string length> ]!!right paren> !!start position> ::= !!string length> ::=!!numeric value expression> Syntax Rules 1) The data type of a and!!string length> shall be exact numeric with scale 0. (SA)!?f is specified,4hen: a) The data type of the is variable-length character string7ith maximum length equal4o the fixed length or maximum variable length of4he!!character value expression>. The character repertoire and form-af-use of4he!!character substring function> are the same as the character repertoire and form-of-use of the . b) The collating sequence and4he coercibility attribute are determined as specified for monadic operators in Subclause 2 2 2.2.3, "Rules determining collating sequence us- age", where the first operand of SUBSTRING0lays4he role of 4he monadic operand. 0Î0Ã0È!?f is specified,4hen: a) The data type of the result of is the data4ype of4he !!character value expression>. b) The collating sequence and the coercibility attribute are determined as specified for monadic operators in Subclause 4.(‘Ñ)0Ñ0ü0Ä "Rules determining collating sequence5s- age"+"+7here4he operand of the is the monadic operand. 2 2 2) If!!form-af-use conversion> is specified, then: a) A shall identify a form-of-use conversion. b) The data type of the result is variable-length character string7ith implementation-defined maximum length. The character set of the result is the same as the character repertoire of the and form- of-use determined by the form-af-use conversion identified Scalar expressions ª0ª0ü0à X0ß0¯0í0ó(g()92-154e¤BL CBR-002 6.7 by4he!!form-af-use conversion name>. Let CR be that char- acter repertoire. The result has the Implicit coercibility attribute and its collating sequence is X,7here X is the default collating sequence of CR. 5)!?f is specified, then a) A!!translation name> shall identify a character4ranslation. b) The data4ype of4he!!character translation> is variable- length character string with implementation-defined maximum length and character repertoire equal to4he character reper- toire of4he4arget character set of4he4ranslation. Let CR be that character repertoire. The result has the Implicit co- ercibility attribute and its collating sequence is X,7here X is the default collating sequence of CR. 6)!?f is specified, then a)!?f FROM is specified,4hen either!!trim specification> or !!trim character> or both shall be specified. b) If!!trim specification> is not specified, then BOTH is im- 0licit. c)!?f is not specified,4hen ' ' is implicit. d)!?f TRIM ( SRC ) is specified, then TRIM ( BOTH ' ' FROM SRC ) is implicit. e) The data4ype of4he!!trim function> is variable-length char- acter string7ith maximum length equal4o the fixed length or maximum variable length of4he!!trim source>. f) If a!!trim character> is specified, then!!trim character> and shall be comparable. g) The character repertoire and form-af-use of4he!!trim func- 4ion> are4he same as4hose of the . h) The collating sequence and the coercibility attribute are determined as specified for monadic operators in Subclause 4.(‘Ñ)0Ñ0ü0Ä "Rules determining collating sequence5s- age"+"+7here4he!!trim source> of TRIM0lays4he role of4he monadic operand. 7)!?f is specified,4hen the data4ype of 4he!!bit substring function> is6ariable-length bit string with maximum length equal to4he fixed length or maximum6ariable length of the . ª4 Database Language SQL X3H2-9(g()¬4/DBL CBR-00() 5 5.7!!string6alue function> Access Rules 1) The applicable0rivileges shall include USAGE for every contained in the . ??eneral Rules 1) If!!character substring function> is specified, then: a) Let C be4he6alue of the , let LC be the length of C, and let S be the value of4he!!start position>. b)!?f is specified, then let L be the value of !!string length> and let E be S+L. Otherwise, let E be4he larger of LC + 1 and S. c)!?f either C, S, or L is4he null value,4hen the result of the is the null6alue. d) If E is less4han S,4hen an exception condition is raised: data exception-substring error. e) Case: i) If S is greater than LC or if E is less than 1, then4he result of the is a zero- length string. ii) Otherwise, 1) Let S1 be the larger of S and 1. Let E1 be4he smaller of E and LC+1. Let L1 be E1-S1. (SA) The result of4he!!character substring function> is a character string containing the L1 characters of C starting at character number S1 in4he same order that the characters appear in C. (SA)!?f is specified,4hen: a) Let S be the value of4he!!character value expression>. b)!?f S is4he null value,4hen the result of the is the null6alue. c) Case: i) If UPPER is specified,4hen the result of the is a copy of S in which every that has a corresponding!!simple Latin5pper case let- ter> in the character repertoire of S is replaced by4hat !!simple Latin5pper case letter>. Scalar expressions 10Õ0é0ó X3H2-9(g()¬4/DBL CBR-00() 5 5.7!!string6alue function> ii) If LOWER is specified,4hen the result of the is a copy of S in which every that has a corresponding!!simple Latin lower case let- ter> in the character repertoire of S is replaced by4hat !!simple Latin lower case letter>. 2 2) If a!!character translation> is specified,4hen Case: a)!?f the value of!!character value expression> is4he null value,4hen the result of the is4he null value. b) Otherwise, the value of4he!!character translation> is the value of4he!!character value expression> after translation to4he character repertoire of4he4arget character set of 4he4ranslation. 4)!?f a is specified,4hen Case: a)!?f the value of!!character value expression> is4he null value,4hen the result of the is the null6alue. b) Otherwise,4he6alue of the is the value of4he!!character value expression> after the applica- 4ion of4he form-of-use conversion specified by!!form-af-use conversion name>. 5)!?f is specified, then: a) Let S be4he6alue of the . b)!?f is specified,4hen let SC be the value of !!trim character>; otherwise, let SC be . c)!?f either S or SC is the null6alue, then4he result of4he !!trim function> is the null6alue. d) If4he length in characters of SC is not 1, then an exception condition is raised: data exception-trim error. e) Case: i) If BOTH is specified or if no is spec- ified, then4he result of4he!!trim function> is the value of S with any leading or trailing characters equal to SC removed. ii) If TRAILING is specified, then4he result of4he!!trim function> is4he6alue of S with any4railing characters equal to SC removed. 10Ø0¯0¿0ü0ë Database Language SQL X0ß0¯0í0ó(g()92-154e¤BL CBR-002 6.7 iii)!?f LEADING is specified, then4he result of4he!!trim func- tion> is4he6alue of S with any leading characters equal 4o SC removed. 6)!?f is specified,4hen: a) Let B be the value of4he!!bit value expression>, let LB be 4he length in bits of B, and let S be4he6alue of the . b) If!!string length> is specified,4hen let L be4he6alue of and let E be S+L. Otherwise, let E be the larger of LB + 1 and S. c) If either B, S, or L is the null6alue, then4he result of 4he!!bit substring function> is4he null value. d)!?f E is less than S, then an exception condition is raised: data exception-substring error. e) Case: i)!?f S is greater4han LB or if E is less4han 1,4hen the result of4he!!bit substring function> is a+ero-length string. ii) Otherwise, 1) Let S1 be the larger of S and 1. Let E1 be4he smaller of E and LB+1. Let L1 be E1-S1. (SA) The result of4he!!bit substring function> is a bit string containing L1 bits of B starting at bit number S1 in4he same order that4he bits appear in B. Leveling Rules 1) The following restrictions apply for Intermediate SQL: a) A shall not be a . b) Conforming!?ntermediate SQL language shall contain no . c) Conforming Intermediate SQL language shall contain no!!form- of-use conversion>. d) Conforming!?ntermediate SQL language shall contain no . (SA) The following restrictions apply for Entry SQL in addition to any!?ntermediate SQL restrictions: a) A shall not be a . Scalar expressions ª7 X0ß0¯0í0ó(g()92-154e¤BL CBR-002 6.7 b) A!!character value function> shall not be a!!trim function>. ª8 Database Language SQL X3H2-9(g()¬4/DBL CBR-00() 5 5.8!!datetime6alue function> 6.8 !!datetime6alue function> Function Specify a function9ielding a value of4ype datetime. Format !!datetime6alue function> ::= !!current date6alue function> =!!current time6alue function> =!!current timestamp value function> ::= CURRENT_DATE !!current time6alue function> ::= CURRENT_TIME [ !!time0recision> ] !!current timestamp value function> ::= CURRENT_TIMESTAMP [ !!timestamp precision>!!right paren> ] Syntax Rules 1) The data type of a is DATE. The data type of a is TIME WITH TIME ZONE. The data4ype of a!!current timestamp value function> is TIMESTAMP 2 2 2 2ITH TIME ZONE. Note: See the Syntax Rules of Subclause 6.1, "", for rules governing
Function Specify a table or a grouped4able. Format !!table expression> ::= [ ] [!!group by clause> ] [!!having clause> ] Syntax Rules 1) The result of a
is a derived table in7hich 4he descriptor of4he i-th column is the same as the descriptor of the i-th column of4he4able specified by the . 2) Let C be some column. Let TE be the
. C is an underlying column of TE if and only if C is an5nderlying column of some!!column reference> contained in TE. Access Rules None. ??eneral Rules 1) If all optional clauses are omitted,4hen the result of the is the same as the result of the . Otherwise, each specified clause is applied4o the result of the previously specified clause and the result of the
is the result of the application of4he last specified clause. Leveling Rules 1) The following restrictions apply for!?ntermediate SQL: None. (SA) The following restrictions apply for Entry SQL in addition to any!?ntermediate SQL restrictions: a) If4he4able identified in4he!!from clause> is a grouped view, then4he!!table expression> shall not contain a , , or . Query expressions 7 X0ß0¯0í0ó(g()92-154e¤BL CBR-002 7.4 5 5 5.4 Function Specify a4able derived from one or more named tables. Format !!from clause> ::= FROM
[ {
}... ] Syntax Rules 1) Case: a)!?f the contains a single
with no intervening or!!joined4able>,4hen the descriptor of the result of the is4he same as4he descriptor of4he4able identified by4hat
. b)!?f the contains more than one!!table reference> 7ith no intervening!!derived table> or , then 4he descriptors of the columns of4he result of4he!!from clause> are4he descriptors of the columns of4he4ables identified by the
s, in4he order in which the
s appear in4he!!from clause> and in the order in7hich4he columns are defined7ithin each4able. Access Rules None. General Rules 1) Case: a)!?f the contains a single
with no intervening or!!joined4able>,4hen the result of the is4he4able identified by4hat
. b)!?f the contains more than one!!table reference> 7ith no intervening!!derived table> or , then 4he result of4he!!from clause> is the extended Cartesian 0roduct of the tables identified by4hose!!table reference>s. The extended Cartesian0roduct, CP, is4he multiset of all rows R such4hat R is4he concatenation of a row from each of4he identified tables in the order in7hich4hey are iden- tified. The cardinality of CP is4he0roduct of the cardi- nalities of4he identified tables. The ordinal position of a 8 Database Language SQL X3H2-9(g()¬4/DBL CBR-00() 5 5 5.4!!from clause> column in CP is N+S, where N is4he ordinal0osition of4hat column in the identified4able T from which it is derived and S is4he sum of the degrees of4he4ables identified before T in4he!!from clause>. Leveling Rules 1) The following restrictions apply for!?ntermediate SQL: None. (SA) The following restrictions apply for Entry SQL in addition to any!?ntermediate SQL restrictions: a) If4he4able identified by!!table name> is a grouped6iew, 4hen the shall contain exactly one
. Query expressions 179 X3H2-9(g()¬4/DBL CBR-00() 5 5 5.5!!joined4able> 5 5 5.5 Function Specify a table derived from a Cartesian0roduct, inner or outer join, or5nion join. Format ::= !!cross join> | =!!left0aren> !!right paren> !!cross join> ::=
CROSS JOIN!!table reference> !!qualified join> ::=
[ NATURAL ] [ ] JOIN !!table reference> [!!join specification> ] ::= !!join condition> | !!join condition> ::= ON!!search condition> ::= USING!!left0aren> !!right paren> !!join4ype> ::= !?NNER =!!outer join4ype> [ OUTER ] = UNION !!outer join4ype> ::= LEFT | RIGHT | FULL !!join column list> ::= Syntax Rules 1) Let TR1 and TR(N)be4he first and second
s of the , respectively. Let T1 and T(N)be4he4ables identified by TR1 and TR(l4) respectively. Let TA and TB be the correlation names of TR1 and TR2, respectively. Let CP be: SELECT * FROM TR1, TR2 2) If a!!qualified join> is specified, then 180 Database Language SQL X0ß0¯0í0ó(g()92-154e¤BL CBR-002 5 5 5.5!!joined4able> Case: a) If NATURAL is specified,4hen a shall not be specified. b)!?f UNION is specified, then neither NATURAL nor a!!join spec- ification> shall be specified. c) Otherwise, a!!join specification> shall be specified. 0Î0Ã0È!?f a is specified and a is not specified, then!?NNER is implicit. 4)!?f a containing a is speci- fied,4hen; a) Each directly contained in4he!!search condition> shall unambiguously reference a column of T1 or T2 or be an outer reference. b)!?f a directly contained in4he!!search condition> is a!!set function specification>,4hen the shall be contained in a!!having clause> or of4hose!!column name>s of T1 that are not corresponding join columns,4aken in order of 4heir ordinal0ositions in T1, and let SLT2 be a
. Format !!query specification> ::= SELECT [ ]!!select list>!!table expression> (... ] . 2 2) Case: a) If4he!!select list> "*" is simply contained in a 4hat is immediately contained in an!!exists0redicate>,4hen the ".*" for some Q is equivalent to a!!value expression> sequence in which each!!value expression> is a!!column reference> CR4hat references a column of T4hat is not a common column of a . Each col- umn of T4hat is not a common column of a shall be referenced exactly once. The columns shall be referenced in the ascending sequence of their ordinal positions within T. Note: common column of a is defined in Subclause 5 5 5.5, "". Query expressions 1 X0ß0¯0í0ó(g()92-154e¤BL CBR-002 7.9 5) Let C be some column. Let QS be the . Let DCi, for i ranging from 14o the number of s inclusively, be the i-th!!derived column> simply contained in the
immediately contained in QS. 6) Each directly contained in each and each contained in a directly contained in each shall5nambiguously reference a column of T. 7)!?f T is a grouped4able, then each in each !!value expression> that references a column of T shall refer- ence a grouping column or be specified within a!!set function specification>.!?f T is not a grouped4able and any!!value ex- pression> contains a!!set function specification> that contains a reference to a column of T or any directly contains a!!set function specification> that does not contain an outer reference, then every!!column reference> in every!!value expression> that references a column of T shall be specified 7ithin a . 8) Each column of the table that is the result of a has a column descriptor that includes a data4ype descriptor4hat is4he same as4he data type descriptor of4he !!value expression> from7hich4he column was derived. 9) Case: a) If4he i-th in the does not specify an and the of that !!derived column> is a single , then4he !!column name> of the i-th column of4he result is C. c) Otherwise,4he!!column name> of the i-th column of4he!!query specification> is implementation-dependent and different from the of any column, other4han itself, of a4able referenced by any!!table reference> contained in the SQL-statement. 10)A column of the table that is the result of a is0ossibly nullable if and only if it contains a for a column C that is possibly nullable, an , an , a , CAST NULL AS X (X represents a!!data4ype> or a ), SYSTEM_ USER, or a!!set function specification> that does not contain COUNT. 192 Database Language SQL X0ß0¯0í0ó(g()92-154e¤BL CBR-002 7.9 11)Let TREF be the
s4hat are simply contained in the of4he!!table expression>. The simply un- derlying4ables of4he!!query specification> are4he4ables identified by the
s and s contained in TREF7ithout an intervening . 1(SA)A QS is updatable if and only if4he fol- lowing conditions hold: a) QS does not specify DISTINCT. b) Every contained in the
and that!!table reference> refers either4o a base4able or to an updatable derived table. Note: updatable derived table is defined in Subclause 6.0Ñ0ü0Ä "
". d) If4he!!table expression> immediately contained in QS imme- diately contains a!!where clause> WC, then no leaf generally 5nderlying table of QS shall be a generally5nderlying table of any!!query expression> contained in 2 2 2 2C. e) The!!table expression> immediately contained in QS does not include a!!group by clause> or a . 10Î0Ã0ÈA is0ossibly non-deterministic if any of the following conditions are4rue: a) The!!set quantifier> DISTINCT is specified and one of4he columns of T has a data4ype of character string; or b) The directly contains a that is possibly non-deterministic; or c) The!!select list> contains a reference to a column C of T 4hat has a data4ype of character string and either i) C is specified with a!!set function specification> that specifies MIN or MAX, or ii) C is a grouping column of T. Access Rules None. Query expressions 0ª0ü0à X0ß0¯0í0ó(g()92-154e¤BL CBR-002 7.9 ??eneral Rules 1) Case: a) If T is not a grouped table,4hen Case: i)!?f the does not include a!!set function spec- ification>4hat contains a reference4o T,4hen each!!value expression> is applied to each row of T9ielding a table of M rows, where M is4he cardinality of T. The i-th column of 4he4able contains the values derived by the evaluation of 4he i-th . Case: 1)!?f the DISTINCT is not specified, then the table is4he result of4he!!query specification>. (SA)!?f the DISTINCT is specified, then4he result of the is4he4able derived from4hat table by4he elimination of any redundant duplicate rows. b)!?f T is a grouped4able, then Case: i) If T has 0 groups,4hen the result of the is an empty4able. ii) If T has one or more groups,4hen each!!value expression> is applied to each group of T9ielding a table of M rows, where M is4he number of groups in T. The i-th column of the table contains4he6alues derived by4he evaluation of the i-th!!value expression>. 2 2 2 2hen a is applied4o a given group of T, that group is the argument or argument source of each!!set function specification> in the . Case: 1)!?f the DISTINCT is not specified, then the table is4he result of4he!!query specification>. 4 Database Language SQL X3H2-9(g()¬4/DBL CBR-00() 5 5 5.9!!query specification> (SA)!?f the DISTINCT is specified, then4he result of the is4he4able derived from T by the elimination of any redundant duplicate rows. Leveling Rules 1) The following restrictions apply for!?ntermediate SQL: a) The!!set quantifier> DISTINCT shall not be specified more 4han once in a , excluding any!!sub- iuery> of4hat . 2) The following restrictions apply for Entry SQL in addition4o any Intermediate SQL restrictions: a) A!!query specification> is not updatable if4he!!where clause> of4he!!table expression> contains a!!subquery>. b) A!!select sublist> shall be a!!derived column>. c)!?f the
of the is a grouped6iew,4hen the
!!corresponding spec> ::= CORRESPONDING [ BY!!left0aren> ] !!corresponding column list> ::=!!column name list> 196 Database Language SQL X0ß0¯0í0ó(g()92-154e¤BL CBR-002 7.10!!query expression> Syntax Rules 1) Let T be the table specified by4he!!query expression>. 2) The TABLE
is equivalent to4he!!query expression> ( SELECT * FROM!!table name> ) 0Î0Ã0È Let set operator be UNION [ALL], EXCEPT [ALL], or!?NTERSECT [ALL]. 4) T is an5pdatable4able and4he!!query expression> is5pdatable if and only if it simply contains a!!query expression> QE or a QS and: a) the contains QE or QS7ithout an inter- 6ening that specified UNION or EXCEPT; b) the contains QE or QS7ithout an interven- ing that specifies!?NTERSECT; and c) QE or QS is updatable. 5) Case: a) If a!!simple4able> is a!!query specification>, then4he column descriptor of the i-th column of4he!!simple4able> is 4he same as4he column descriptor of the i-th column of4he !!query specification>. b) If a!!simple4able> is an , then4he column descriptor of the i-th column of4he!!simple4able> is4he same as4he column descriptor of the i-th column of4he4able identified by4he!!table name> contained in4he!!explicit 4able>. c) Otherwise, the column descriptor of4he i-th column of the is same as the column descriptor of4he i- th column of4he!!table value constructor>, except4hat the is implementation-dependent and different from 4he!!column name> of any column, other than itself, of a table referenced by any
contained in4he SQL-statement. 6) Case: a)!?f a is a , then4he column descriptor of the i-th column of4he!!non-joiniuery 0rimary> is4he same as4he column descriptor of the i-th column of4he!!simple4able>. Query expressions 197 X3H2-9(g()¬4/DBL CBR-00() 5 5 5.10 b) Otherwise,4he column descriptor of the i-th column of4he !!non-joiniuery0rimary> is4he same as4he column descriptor of the i-th column of4he!!non-joiniuery expression>. 7) Case: a)!?f a is a!!non-joiniuery0rimary>,4hen the column descriptor of4he i-th column of the is4he same as4he column descriptor of the i-th column of 4he!!non-joiniuery0rimary>. b) Otherwise, the column descriptor of4he i-th column of the is4he same as4he column descriptor of the i-th column of4he!!joined4able>. 8) If a set operator is specified in a or a !!non-joiniuery expression>, then let T1, T(l4) and TR be respec- 4ively the first operand,4he second operand, and4he result of 4he!!non-joiniuery4erm> or . Let TN1 and TN2 be the effective names for T1 and T(l4) respectively. 9) If a set operator is specified in a or a !!non-joiniuery expression>, then let OP be4he set operator. Case: a) If CORRESPONDING is specified,4hen: i) 2 2 2 2ithin the columns of T1,4he same shall not be specified more4han once and7ithin the columns of T(l4) the same!!column name> shall not be specified more4han once. ii) At least one column of T1 shall have a that is4he!!column name> of some column of T(‘Ñ) iii) Case: 1) If!!corresponding column list> is not specified,4hen let SL be a!!select list> of those s4hat are!!column name>s of both T1 and T(N)in4he order4hat 4hose!!column name>s appear in T1. (SA)!?f is specified, then let SL be a
contained in4he SQL-statement. ii) The data type of the i-th column of TR is determined by applying Subclause 9.3, "Set operation result data4ypes"+"+ to4he data types of4he i-th column of T1 and4he i-th column of T(‘Ñ)!?f the i-th column of both T1 and T(N)are known not nullable,4hen the i-th column of TR is known not nullable; otherwise,4he i-th column of T is0ossibly nullable. 10Î0Ã0ÈCase: a) If a!!query expression> is a!!non-joiniuery expression>, then4he column descriptor of the i-th column of4he!!query expression> is4he same as4he column descriptor of the i-th column of4he!!non-joiniuery expression>. b) Otherwise,4he column descriptor of the i-th column of4he !!query expression> is4he same as4he column descriptor of the i-th column of4he!!joined4able>. 14)The simply5nderlying tables of a are4he 4ables identified by those
s,!!query expression>s, and s contained in the 7ithout an intervening , an intervening , or an intervening!!join condition>. 15)A is possibly non-deterministic if a) it contains a set operator UNION and ALL is not specified, or if it contains EXCEPT or!?NTERSECT; and b) the first or second operand contains a column that has a data type of character string. ­)The5nderlying columns of each column of QE and of QE itself are defined as follows: a) A column of a has no5nderlying columns. b) The5nderlying columns of every i-th column of a ST are the underlying columns of the i-th column of 4he4able immediately contained in ST. (eå)0 Database Language SQL X3H2-9(g()¬4/DBL CBR-00() 5 5 5.10 c) If no set operator is specified,4hen the underlying columns of every i-th column of QE are the underlying columns of the i-th column of4he!!simple4able> simply contained in QE. d) If a set operator is specified, then4he5nderlying columns of every i-th column of QE are4he5nderlying columns of4he i-th column of T1 and4hose of the i-th column of T(‘Ñ) e) Let C be some column. C is an5nderlying column of QE if and only if C is an underlying column of some column of QE. Access Rules None. General Rules 1) Case: a)!?f no set operator is specified, then T is the result of the specified or . b) If a set operator is specified, then4he result of applying the set operator is a table containing4he following rows: i) Let R be a row that is a duplicate of some row in T1 or of some row in T(N)or both. Let m be the number of duplicates of R in T1 and let n be the number of duplicates of R in T2, where m 0 and n 0. ii)!?f ALL is not specified, then Case: 1) If UNION is specified,4hen Case: A)!?f m > 0 or n  0, then T contains exactly one dupli- cate of R. B) Otherwise, T contains no duplicate of R. (SA)!?f EXCEPT is specified,4hen Case: A)!?f m > 0 and n = 0,4hen T contains exactly one dupli- cate of R. B) Otherwise, T contains no duplicate of R. 2 2) If!?NTERSECT is specified,4hen Case: A)!?f m > 0 and n > 0,4hen T contains exactly one dupli- cate of R. Query expressions 201 X3H2-9(g()¬4/DBL CBR-00() 5 5 5.10 B) Otherwise, T contains no duplicates of R. iii)!?f ALL is specified, then Case: 1) If UNION is specified,4hen the number of duplicates of R4hat T contains is (m + n). 2) If EXCEPT is specified, then4he number of duplicates of R that T contains is4he maximum of (m - n) and 0. 2 2) If!?NTERSECT is specified,4hen the number of duplicates of R4hat T contains is the minimum of m and n. Note: See4he??eneral Rules of Subclause 8.(l4) "". 2) If a set operator is specified, then for each column7hose data type is interval, let UDT be in turn4he data type of the cor- responding column of T and let SV be the value of4he column in each row of4he first and second operands. The value of4he corresponding column of T in the corresponding row of T is CAST (SV AS UDT) Leveling Rules 1) The following restrictions apply for!?ntermediate SQL: a) A!!simple4able> shall not be a!!table value constructor> except in an . b) Conforming!?ntermediate SQL shall contain no!!explicit4a- ble>. 2) The following restrictions apply for Entry SQL in addition4o any Intermediate SQL restrictions: a) A!!query expression> shall not specify EXCEPT. b) A shall not specify!?NTERSECT. c) A shall not contain a!!joined4able>. d) A!!query expression> shall not specify CORRESPONDING. e)!?f UNION is specified, then except for column names, the descriptors of4he first and second operands shall be iden- tical and the descriptor of the result is identical to4he descriptor of4he operands. 202 Database Language SQL X0ß0¯0í0ó(g()92-154e¤BL CBR-002 5 5 5.11 ,!!row subquery>, and!!table subquery> 5 5 5.11 !!scalar subquery>, , and
Function Specify a scalar6alue, a row, or a table derived from a!!query expression>. Format !!scalar subquery> ::=!!subquery> ::=!!subquery>
::=!!subquery> ::=!!left0aren> !!right paren> Syntax Rules 1) The degree of a shall be 1. (SA) The degree of a!!row subquery> shall be greater4han 1. 2 2) The data4ype of a!!scalar subquery> is the data4ype of4he column of4he!!query expression> immediately contained in4he !!scalar subquery>. 4) The data types of4he columns of a or
are4he data types of4he respective columns of4he !!query expression> immediately contained in4he!!row subquery> or!!table subquery>. Access Rules None. ??eneral Rules 1) If4he cardinality of a or a!!row subquery> is greater4han 1,4hen an exception condition is raised: cardinal- ity violation. Leveling Rules 1) The following restrictions apply for Intermediate SQL: (SA) The following restrictions apply for Entry SQL in addition to any!?ntermediate SQL restrictions: a) If a!!subquery> is contained in a , then4he!!table expression> in4he!!query specification> shall not contain a!!group by clause> or a and shall not identify a grouped6iew. Query expressions 203 X3H2-9(g()¬4/DBL CBR-00() 5 5 5.11 ,!!row subquery>, and!!table subquery> b) The!!query expression> contained in a!!subquery> shall be a !!query specification>. 204 Database Language SQL X0ß0¯0í0ó(g()92-154e¤BL CBR-002 8 Predicates 8.1 !!predicate> Function Specify a condition that can be evaluated to give a truth value of true, false, or unknown. Format ::= =!!between predicate> =!!in0redicate> | =!!null0redicate> | | =!!unique0redicate> | | Syntax Rules None. Access Rules None. General Rules 1) The result of a!!predicate> is a truth value derived according to4he??eneral Rules of Subclause 8.(l4) ""+"+ Subclause 8.3, ""+"+ Subclause 8.4, "", Subclause 8.5, ""+"+ Subclause 8.6, "", Subclause 8.7, "", Subclause 8.8, ""+"+ Subclause 8.9, "", Subclause 8.10, ""+"+ or Subclause 8., "", as appropriate. Predicates (eå)5 X0ß0¯0í0ó(g()92-154e¤BL CBR-002 8.1 Leveling Rules 1) The following restrictions apply for Intermediate SQL: a) A shall not be a!!match predicate>. (SA) The following restrictions apply for Entry SQL in addition to any!?ntermediate SQL restrictions: a) Conforming Entry SQL language shall not contain any . b) Conforming Entry SQL language shall not contain any . 20 Database Language SQL X0ß0¯0í0ó(g()92-154e¤BL CBR-002 8.2!!comparison0redicate> 8.2 Function Specify a comparison of two row values. Format !!comparison0redicate> ::= ::= | | =!!greater than operator> =!!less4han or equals operator> | Syntax Rules 1) The4wo!!row value constructor>s shall be of the same degree. 2) Let corresponding values be values7ith the same ordinal0osi- 4ion in4he4wo!!row value constructor>s. 2 2) The data4ypes of the corresponding values of the two s shall be comparable. 4) Let X be a value in4he first!!row value constructor> and Y be the corresponding value in4he second . !?f X and Y have data type character string,4hen the pair-wise comparison collating sequence used4o compare X and Y is de- 4ermined by4he4able for collating sequences for comparisons (Subclause 4.(‘Ñ)0Ñ0ü0Ä "Rules determining collating sequence5sage"). For any pair of corresponding character strings, let CS be4he identified collating sequence. Access Rules None. General Rules 1) Let X and Y be any two corresponding s. Let XV and YV be4he6alues represented by X and Y, respectively. Case: a)!?f XV or YV is the null6alue, then "X Y" is un- known. Predicates 207 X3H2-9(g()¬4/DBL CBR-00() 8.2!!comparison0redicate> b)!?f XV and YV are non-null6alues,4hen "X!!comp op> Y" is 4rue or false as follows: i) "X = Y" is true if and only if XV and YV are equal. ii) "X <> Y" is4rue if and only if XV and YV are not equal. iii) "X!! Y" is4rue 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" is4rue if and only if XV is not greater4han YV. vi) "X = Y" is true if and only if XV is not less4han YV. 6ii) "X!!comp op> Y" is false if and only if "X!!comp op> Y" is not true. (SA) Numbers are compared with respect4o their algebraic value. 2 2) The comparison of two character strings is determined as fol- lows: a) If4he length in characters of X is not equal to4he length in characters of Y, then4he shorter string is effectively replaced, for4he0urposes of comparison,7ith a copy of itself4hat has been extended to4he length of4he longer string by concatenation on4he right of one or more pad char- acters, where the pad character is chosen based on CS.!?f CS has4he NO PAD attribute,4hen the pad character is an implementation-dependent character different from any char- acter in4he character set of X and Y that collates less 4han any string5nder CS. Otherwise, the pad character is a !!space>. b) The result of the comparison of X and Y is given by the col- lating sequence CS. c) Depending on the collating sequence, two strings may com- 0are as equal even if4hey are of different lengths or con- 4ain different sequences of characters. 2 2 2 2hen the operations MAX, MIN, DISTINCT, references to a grouping column, and the UNION, EXCEPT, and!?NTERSECT operators refer4o character strings,4he specific value selected by these operations from a set of such equal values is implementation-dependent. Note:!?f the coercibility attribute of the comparison is Coercible,4hen the collating sequence5sed is4he default de- fined for4he character repertoire. See also other Syntax Rules in this Subclause, Subclause 10.4, ""+"+ and Subclause 11.(R´), "". (eå)8 Database Language SQL X3H2-9(g()¬4/DBL CBR-00() 8.(N) 4) The comparison of4wo bit string values, X and Y, is determined by comparison of their bits7ith the same ordinal0osition. !?f Xi and Yi are the values of the i-th bits of X and Y, re- spectively, and if LX is4he length in bits of X and LY is4he length in bits of Y, then: a) X is equal4o Y if and only if X = LY and Xi = Yi for all i. b) X is less4han Y if and only if: i) LX!! LY and Xi = Yi for all i less4han or equal4o LX; or ii) Xi = Yi for all i!! n and Xn = 0 and Yn = 1 for some n less than or equal to4he minimum of LX and LY. 5) The comparison of two datetimes is determined according to4he interval resulting from4heir subtraction. Let X and Y be4he 4wo6alues to be compared and let?! be the least significant of X and Y. The result of X!!comp op> Y is defined as: ( X - Y )?!!!comp op>!?NTERVAL (0) H Note: Two datetimes are comparable only if they have the same !!datetime field>s; see Subclause 4.5.1, "Datetimes". 6) The comparison of4wo intervals is determined by the compari- son of their corresponding values after conversion to integers in some common base unit. Let X and Y be4he4wo intervals4o be compared. Let A TO B be4he specified or implied datetime iualifier of X and C TO D be the specified or implied datetime qualifier of Y. Let T be4he least significant!!datetime field> of B and D and let U be a datetimeiualifier of the form T(N), 7here N is an!!interval leading field0recision> large enough so that significance is not lost in4he CAST operation. X is effectively replaced by CAST (X AS INTERVAL U). Y is effectively replaced by CAST (Y AS INTERVAL U). The result of the comparison is effectively computed as: CAST ( X AS INTEGER ) CAST ( Y AS INTEGER ) 7) Let Rx and Ry be the two s of the and let RXi and RYi be the i-th!!row value constructor element>s of Rx and Ry, respectively. "Rx Ry" is4rue, false, or5nknown as follows: a) "x = Ry" is4rue if and only if RXi = RYi for all i. b) "x!!> Ry" is4rue 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 (eå)9 X0ß0¯0í0ó(g()92-154e¤BL CBR-002 8.(N) e) "x!!= Ry" is4rue if and only if Rx = Ry or Rx < Ry. f) "x = Ry" is4rue if and only if Rx = Ry or Rx > Ry. g) "x = Ry" is false if and only if "Rx!!> Ry" is4rue. h) "x <> Ry" is false if and only if "Rx = Ry" is true. i) "x!! Ry" is false if and only if "Rx = Ry" is4rue. j) "x > Ry" is false if and only if "Rx <= Ry" is true. k) "x!!= Ry" is false if and only if "Rx > Ry" is4rue. 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 1) The following restrictions apply for!?ntermediate SQL: None. (SA) The following restrictions apply for Entry SQL in addition to any!?ntermediate SQL restrictions: None. 210 Database Language SQL X0ß0¯0í0ó(g()92-154e¤BL CBR-002 8.0µ0ó0Á0ü0à 8.3 Function Specify a range comparison. Format ::= [ NOT ] BETWEEN AND Syntax Rules 1) The4hree!!row value constructor>s shall be of the same degree. 2) Let respective6alues be6alues with4he same ordinal position in the two s. 0Î0Ã0È The data types of4he respective values of the three s shall be comparable. 4) Let X, Y, and Z be the first, second, and4hird!!row value con- structor>s, respectively. 5) "X NOT BETWEEN Y AND Z" is equivalent to "NOT ( X BETWEEN Y AND Z )". 6) "X BETWEEN Y AND Z" is equivalent4o "X>=Y AND X<=z". Access Rules None. ??eneral Rules None. Leveling Rules 1) The following restrictions apply for!?ntermediate SQL: None. (SA) The following restrictions apply for Entry SQL in addition to any!?ntermediate SQL restrictions: None. Predicates 2 X3H2-9(g()¬4/DBL CBR-00() 8.4!!in0redicate> 8.4 Function Specify a quantified comparison. Format ::= !!row value constructor> [ NOT ]!?N !!in0redicate6alue> ::=
=!!left0aren> ::= "!!comma>!!value expression> }... Syntax Rules 1) Let IVL be an . ( IVL ) is equivalent4o the : ( VALUES!?VL ) 2) Let RVC be4he!!row value constructor> and let!?PV be the . 0Î0Ã0È The expression RVC NOT!?N IPV is equivalent4o NOT ( RVC!?N IPV ) 4) The expression RVC!?N IPV is equivalent4o RVC = ANY!?PV Access Rules None. ??eneral Rules None. (h*)(N) Database Language SQL X3H2-9(g()¬4/DBL CBR-00() 8.4 Leveling Rules 1) The following restrictions apply for!?ntermediate SQL: a) Conforming Intermediate SQL language shall not contain a in an!!in6alue list>4hat is not a!!value specification>. (SA) The following restrictions apply for Entry SQL in addition to any!?ntermediate SQL restrictions: None. Predicates (h*)0ª0ü0à X0ß0¯0í0ó(g()92-154e¤BL CBR-002 8.5 8.5 !!like0redicate> Function Specify a0attern-match comparison. Format ::= !!match value> [ NOT ] LIKE [ ESCAPE!!escape character> ] ::= !!pattern> ::=!!character value expression> ::=!!character value expression> Syntax Rules 1) The data types of!!match value>, , and!!escape char- acter> shall be character string.!!match value>, , and !!escape character> shall be comparable. 2) Let M be4he result of4he!!character value expression> of4he !!match value>, let P be4he result of4he!!character value expression> of4he!!pattern>, and let E be4he result of4he !!character value expression> of4he!!escape character> if one is specified. 2 2) "M NOT LIKE P" is equivalent4o "NOT (M LIKE P)". 4) Case: a)!?f is not specified,4hen the collat- ing sequence5sed for the is determined by Table 0Ñ0ü0Ä "Collating sequence5sage for comparisons"+"+4aking as comparand 1 and!!pattern> as comparand (‘Ñ) b) Otherwise, let C1 be the coercibility attribute and collat- ing sequence of4he!!match value>, and C2 be the coercibility attribute and collating sequence of4he!!pattern>. Let C3 be the resulting coercibility attribute and collating sequence as determined by Table 2, "Collating coercibility rules for dyadic operators"+"+4aking C1 as the operand 1 coercibility and C(N)as4he operand 2 coercibility. The collating sequence used for4he!!like0redicate> is determined by Table 2 2, "Collating sequence usage for comparisons", taking C0µ0ó0Á0ü0àas4he coercibility attribute and collating sequence of comparand 1 and as comparand (‘Ñ) 2 Database Language SQL X0ß0¯0í0ó(g()92-154e¤BL CBR-002 8.5!!like0redicate> Access Rules None. ??eneral Rules 1) If an is specified and M, P, or E is the null 6alue, then M LIKE P ESCAPE E is unknown. 2) If an is not specified and M or P is the null 6alue, then M LIKE P is5nknown. 0Î0Ã0È Case: a)!?f an!!escape character> is specified, then: i) If4he length in characters of E is not equal to 1, then an exception condition is raised: data exception-invalid escape character. ii) If4here is not a partitioning of the string P into sub- strings such4hat each substring has length 1 or 2, no substring of length 1 is4he escape character E, and each substring of length 2 is the escape character E followed by either4he escape character E, an character, or the character,4hen an exception condition is raised: data exception-invalid escape sequence. !?f there is such a partitioning of P,4hen in4hat parti- tioning, each substring with length (N)represents a single occurrence of4he second character of4hat substring. Each substring7ith length 14hat is4he!!underscore> character represents an arbitrary character specifier. Each substring with length 1 that is the character represents an arbitrary string specifier. Each substring with length 14hat is neither4he!!underscore> character nor the character represents the character that it contains. b) If an is not specified,4hen each!!under- score> character in P represents an arbitrary character spec- ifier, each!!percent> character in P represents an arbitrary string specifier, and each character in P that is neither the character nor4he!!percent> character represents itself. Predicates 2¬ X3H2-9(g()¬4/DBL CBR-00() 8.5!!like0redicate> 2 2 2) The string P is a sequence of the minimum number of substring specifiers such that each of P is 0art of exactly one substring specifier. A substring specifier is an arbitrary character specifier, an arbitrary string spec- ifier, or any sequence of!!character representation>s other 4han an arbitrary character specifier or an arbitrary string specifier. 5) Case: a) If M and P are character strings7hose lengths are6ariable and if4he lengths of both M and P are 0, then M LIKE P is true. b) The M LIKE P is4rue if4here exists a partitioning of M into substrings such4hat: i) A substring of M is a sequence of 0 or more contiguous !!character representation>s of M and each!!character repre- sentation> of M is0art of exactly one substring. ii) If4he i-th substring specifier of P is an arbitrary char- acter specifier,4he i-th substring of M is any single . iii) If4he i-th substring specifier of P is an arbitrary string specifier, then4he i-th substring of M is any sequence of 0 or more!!character representation>s. iv) If4he i-th substring specifier of P is neither an arbi- trary character specifier nor an arbitrary string speci- fier, then4he i-th substring of M is equal to4hat sub- string specifier according4o the collating sequence of 4he!!like0redicate>,7ithout4he appending of characters to M, and has the same length as4hat substring specifier. 6) The number of substrings of M is equal4o the number of substring specifiers of P. c) Otherwise, M LIKE P is false. (h*)6 Database Language SQL X3H2-9(g()¬4/DBL CBR-00() 8.5 Leveling Rules 1) The following restrictions apply for!?ntermediate SQL: None. (SA) The following restrictions apply for Entry SQL in addition to any!?ntermediate SQL restrictions: a) The shall be a!!column reference>. b) A!!pattern> shall be a . c) An shall be a . Predicates (h*)7 X0ß0¯0í0ó(g()92-154e¤BL CBR-002 8.6 8.6 !!null0redicate> Function Specify a4est for a null6alue. Format !!null0redicate> ::= IS [ NOT ] NULL Syntax Rules None. Access Rules None. General Rules 1) Let R be the value of4he!!row value constructor>. (SA)!?f all the values in R are the null6alue, then "R IS NULL" is true; otherwise, it is false. 0Î0Ã0È!?f none of the values in R are the null6alue, then "R IS NOT NULL" is true; otherwise, it is false. Note: For all R, "R!?S NOT NULL" has the same result as "NOT R IS NULL" if and only if R is of degree 1. Table , " semantics", specifies this behavior. _______________Table_1(g()_semantics________________ R!?S R!?S NOT NOT R!?S NOT R!?S NOT Expression_______NULL____NULL__________NULL__________NULL_________ | degree 1: null=4rue = false = false | 4rue = = | | | = | | degree 1: not = false=4rue =4rue | false = null = degree > ° | true | false | false = true | | all null = = = | = = | | | = | | degree  1: = false= false =4rue | 4rue = = some null | | | = | | = = = | = = degree > ° | false | true | true = false | |_none_null______|_______|_____________|____________|______________| = | | | = | |Leveling Rules = = = | = = | | | = | 2 Database Language SQL X0ß0¯0í0ó(g()92-154e¤BL CBR-002 8.6!!null0redicate> 1) The following restrictions apply for!?ntermediate SQL: None. (SA) The following restrictions apply for Entry SQL in addition to any!?ntermediate SQL restrictions: a) A shall be a!!column reference>. Predicates (h*)9 X0ß0¯0í0ó(g()92-154e¤BL CBR-002 8.7 8.7 Function Specify aiuantified comparison. Format !!quantified comparison predicate> ::= !!row value constructor>!!comp op>!!quantifier>
::=!!all>=!!some> ::= ALL ::= SOME | ANY Syntax Rules 1) The!!row value constructor> shall be of4he same degree as the result of the
. (SA) The data types of4he6alues of4he!!row value constructor> shall be respectively comparable to4hose of the columns of4he !!table subquery>. 2 2) The collating sequence for each pair of respective6alues in 4he!!quantified comparison predicate> is determined in the same manner as described in Subclause 8.(l4) "". Access Rules None. ??eneral Rules 1) Let R be4he result of4he!!row value constructor> and let T be the result of the
. (SA) The result of "R T" is derived by the application of4he implied!!comparison0redicate> "R!!comp op> RT"4o every row RT in T: Case: a) If T is empty or if the implied is true for every row RT in T, then "R T" is true. b) If4he implied!!comparison0redicate> is false for at least one row RT in T,4hen "R!!comp op>!!all> T" is false. (g )0 Database Language SQL X3H2-9(g()¬4/DBL CBR-00() 8.7!!quantified comparison predicate> c) If4he implied!!comparison0redicate> is4rue for at least one row RT in T, then "R T" is4rue. d)!?f T is empty or if4he implied!!comparison0redicate> is false for every row RT in T, then "R T" is false. e) If "R T" is neither4rue nor false, 4hen it is unknown. Leveling Rules 1) The following restrictions apply for Intermediate SQL: None. 2) The following restrictions apply for Entry SQL in addition4o any Intermediate SQL restrictions: None. Predicates 2(h*) X3H2-9(g()¬4/DBL CBR-00() 8.8!!exists0redicate> 8.8 Function Specify a test for a non-empty set. Format !!exists0redicate> ::= EXISTS!!table subquery> Syntax Rules None. Access Rules None. General Rules 1) Let T be the result of the
. (SA)!?f the cardinality of T is greater than 0, then4he result of 4he!!exists0redicate> is4rue; otherwise, the result of the is false. Leveling Rules 1) The following restrictions apply for Intermediate SQL: None. 2) The following restrictions apply for Entry SQL in addition4o any Intermediate SQL restrictions: None. 2(g ) Database Language SQL X0ß0¯0í0ó(g()92-154e¤BL CBR-002 8.9!!unique0redicate> 8.9 Function Specify a test for4he absence of duplicate rows. Format !!unique0redicate> ::= UNIQUE!!table subquery> Syntax Rules None. Access Rules None. General Rules 1) Let T be the result of the
. (SA)!?f there are no4wo rows in T such that4he6alue of each column in one row is non-null and is equal to4he6alue of the cor- responding column in the other row according to Subclause 8.2, "", then4he result of4he!!unique0redi- cate> is4rue; otherwise, the result of the is false. Leveling Rules 1) The following restrictions apply for Intermediate SQL: None. 2) The following restrictions apply for Entry SQL in addition4o any Intermediate SQL restrictions: a) Conforming Entry SQL language shall not contain any!!unique 0redicate>. Predicates (g )0ª0ü0à X0ß0¯0í0ó(g()92-154e¤BL CBR-002 8.10!!match predicate> 8.10 Function Specify a4est for matching rows. Format ::= MATCH [ UNIQUE ] [ PARTIAL= FULL ]
Syntax Rules 1) The!!row value constructor> shall be of4he same degree as the
. (SA) The data types of4he6alues of4he!!row value constructor> shall be respectively comparable to4hose of the corresponding columns of4he!!table subquery>. 2 2) The collating sequence for each pair of respective6alues in4he !!match predicate> is determined in the same manner as described in Subclause 8.(l4) "". Access Rules None. ??eneral Rules 1) Let R be4he!!row value constructor>. (SA)!?f neither PARTIAL nor FULL is specified,4hen Case: a)!?f some6alue in R is4he null value,4hen the is4rue. b)!?f no6alue in R is4he null value,4hen Case: i)!?f UNIQUE is not specified and there exists a (possibly non-unique) row RTi of4he!!table subquery> such4hat R = RTi then4he!!match predicate> is true. ii) If UNIQUE is specified and4here is a unique row RTi of the !!table subquery> such4hat R = RTi (g )4 Database Language SQL X3H2-9(g()¬4/DBL CBR-00() 8.10!!match predicate> then4he!!match predicate> is true. iii) Otherwise,4he!!match predicate> is false. 2 2) If PARTIAL is specified,4hen Case: a)!?f all values in R are the null6alue, then4he!!match predi- cate> is true. b) Otherwise, Case: i) If UNIQUE is not specified and4here exists a (possibly non-unique) row RTi of the
such that each non-null value of R equals its corresponding value in RTi, 4hen the is4rue. ii)!?f UNIQUE is specified and there is a5nique row RTi of4he
such that each non-null6alue of R equals its corresponding value in RTi, then4he!!match predicate> is4rue. iii) Otherwise, the is false. 4)!?f FULL is specified,4hen Case: a)!?f all values in R are the null6alue, then4he!!match predi- cate> is true. b) If no values in R are the null6alue, then Case: i) If UNIQUE is not specified and4here exists a (possibly non-unique) row RTi of the
such that R = RTi 4hen the is4rue. ii)!?f UNIQUE is specified and there exists a5nique row RTi of the
such that R = RTi 4hen the is4rue. iii) Otherwise, the is false. c) Otherwise,4he!!match predicate> is false. Predicates 2(ry) X3H2-9(g()¬4/DBL CBR-00() 8.10 Leveling Rules 1) The following restrictions apply for Intermediate SQL: a) Conforming!?ntermediate SQL language shall not contain any !!match predicate>. (SA) The following restrictions apply for Entry SQL in addition to any!?ntermediate SQL restrictions: None. 2(Œ¡) Database Language SQL X0ß0¯0í0ó(g()92-154e¤BL CBR-002 8.!!overlaps0redicate> 8.11 !!overlaps0redicate> Function Specify a4est for an overlap between4wo events. Format ::= !!row value constructor ´ OVERLAPS ::= ::= Syntax Rules 1) The degree of!!row value constructor ´ and!!row value construc- tor (ŒÇ) shall both be 2. (SA) The data type of the first column of each!!row value construc- tor> shall be a datetime data type and4he first column of each shall be comparable. Note: Two datetimes are comparable only if4hey have4he same s; see Subclause 2 2 2.5.1, "Datetimes". 2 2) The data4ype of4he second column of each!!row value construc- tor> shall be a datetime data type or INTERVAL. Case: a)!?f the data4ype is!?NTERVAL,4hen the precision of4he data type shall be such4hat the interval can be added to4he datetime data4ype contained in4he first column of4he!!row value constructor>. b) If4he data type is a datetime data type, then it shall be comparable with4he datetime data4ype contained in4he first column of4he!!row value constructor>. Access Rules None. General Rules 1) Let D1 be4he6alue of the first column of and D2 be the value of4he first column of!!row value constructor (ŒÇ). Predicates (g )7 X0ß0¯0í0ó(g()92-154e¤BL CBR-002 8.!!overlaps0redicate> 2) Case: a) If4he data type of the second column of!!row value construc- tor ´ is a datetime data type, then let E1 be4he6alue of the second column of!!row value constructor ´. b) If4he data type of the second column of!!row value construc- tor ´ is INTERVAL, then let!?1 be4he6alue of the second column of!!row value constructor ´. Let E1 = D1 + I1. 0Î0Ã0È!?f D1 is the null6alue or if E1 < D1, then let S1 = E1 and let T1 = D1. Otherwise, let S1 = D1 and let T1 = E1. 4) Case: a)!?f the data4ype of4he second column of is a datetime data4ype,4hen let E2 be the value of 4he second column of . b)!?f the data4ype of4he second column of is!?NTERVAL,4hen let I2 be the value of4he second column of . Let E(N)= D2 +!?(‘Ñ) 5) If D(N)is4he null value or if E2!! D(l4)4hen let S2 = E(N)and let T2 = D(‘Ñ) Otherwise, let S2 = D(N)and let T2 = E(‘Ñ) 5 5) The result of the is the result of the following expression: ( S1 > S2 AND NOT ( S1 >= T(N)AND T1 = T2 ) ) OR ( S2  S1 AND NOT ( S2 = T1 AND T(N)>= T1 ) ) OR ( S1 = S2 AND ( T1 <> T(N)OR T1 = T2 ) ) Leveling Rules 1) The following restrictions apply for Intermediate SQL: None. 2) The following restrictions apply for Entry SQL in addition4o any Intermediate SQL restrictions: a) Conforming Entry SQL language shall not contain any!!overlaps 0redicate>. (g )8 Database Language SQL X3H2-9(g()¬4/DBL CBR-00() 8.1(N) 8. Function Specify a condition that has4he4ruth6alue4rue, false, or unknown, depending on the result of applying boolean operators to specified conditions. Format ::= !!boolean term> | OR !!boolean term> ::= =!!boolean term> AND !!boolean factor> ::= [ NOT ] !!boolean test> ::= [ IS [ NOT ]!!truth value> ] !!truth value> ::= TRUE | FALSE | UNKNOWN ::= | !!search condition> Syntax Rules 1)!?f NOT is specified in a , then let BP be4he contained!!boolean primary> and let TV be4he contained!!truth value>. The is equivalent4o: ( NOT ( BP!?S TV ) ) Access Rules None. ??eneral Rules 1) The result is derived by4he application of the specified boolean operators ("AND", "OR", "IS", and "NOT")4o the results derived from each evaluation. If boolean operators are not specified, then4he result of4he!!search condition> is 4he result of4he specified!!predicate>. Predicates (g )9 X0ß0¯0í0ó(g()92-154e¤BL CBR-002 8.!!search condition> 2) NOT(true) is false, NOT(false) is true, and NOT(unknown) is unknown. Table 10Ñ0ü0Ä "Truth table for the AND boolean", Table , "Truth4able for4he OR boolean", and Table ¬, "Truth4able for4he!?S boolean" specify4he semantics of AND, OR, and!?S, respectively. _____________Table_10Ð0ü0ì0ëTruth_table_for_the_AND_boolean_____________ __________________________________________________________________ | true =4rue = false | unknown = = | | = | | false = false = false | false = = | | = | |__________|_________|__________|__________________________________| = | | = | _____________Table_14-Truth_table_for_the_OR_boolean______________ __________________________________________________________________ | true =4rue =4rue | true = = | | = | | false =4rue = false | unknown = = | | = | |__________|_________|__________|__________________________________| = | | = | _____________Table_15-Truth_table_for_the_IS_boolean______________ IS_________TRUE______FALSE______UNKNOWN___________________________ | true =4rue = false | false = = | | = | | false = false =4rue | false = = | | = | |__________|_________|__________|__________________________________| = | | = | 2 2) When a!!search condition> S is evaluated against a row of a table, each reference to a column of4hat table by a!!column reference> directly contained in S is a reference4o the value of4hat column in that row. Leveling Rules 1) The following restrictions apply for!?ntermediate SQL: a) A!!boolean test> shall not specify a . 2) The following restrictions apply for Entry SQL in addition4o any Intermediate SQL restrictions: None. (y>)0 Database Language SQL X3H2-9(g()¬4/DBL CBR-00() 9 Data assignment rules 9.1 Retrieval assignment Function Specify rules for6alue assignments4hat retrieve SQL-data. Syntax Rules 1) Let T and V be a TARGET and VALUE specified in an application of this Subclause. (SA)!?f the data4ype of T is character string, bit string, numeric, datetime, or interval, then4he data type of V shall be a mu- 4ually assignable character string type, a bit string4ype, a numeric4ype,4he same datetime4ype, or a comparable interval type, respectively. General Rules 1)!?f V is4he null value,4hen Case: a)!?f an indicator is specified for T,4hen that indicator is set to -1. b)!?f no indicator is specified for T,4hen an exception con- dition is raised: data exception-null value, no indicator parameter. 2) If V is not the null6alue and T has an indicator,4hen Case: a)!?f the data4ype of T is character string or bit string and 4he length in characters or bits, respectively, M of V is greater4han the length in characters or bits, respectively, of T, then4he indicator is set to M. If M exceeds4he maxi- mum6alue4hat the indicator can contain,4hen an exception condition is raised: data exception-indicator overflow. b) Otherwise, the indicator is set4o 0. 2 2) If V is not the null6alue, then Case: a) If4he data type of T is fixed-length character string7ith length in characters L and4he length in characters of V is equal to L, then4he6alue of T is set4o V. Data assignment rules 20Ó0ë X3H2-9(g()¬4/DBL CBR-00() 9.1 Retrieval assignment b)!?f the data4ype of T is fixed-length character string with length in characters L, and4he length in characters of V is greater than L, then4he6alue of T is set4o the first L characters of V and a completion condition is raised: warning-string data, right4runcation. c)!?f the data4ype of T is fixed-length character string with length in characters L, and4he length in characters M of V is smaller than L, then4he first M characters of T are set 4o V, and4he last L-M characters of T are set to!!space>s. d)!?f the data4ype of T is variable-length character string and4he length in characters M of V is not greater than4he maximum length in characters of T, then4he6alue of T is set 4o V and the length in characters of T is set4o M. e)!?f the data4ype of T is variable-length character string and4he length in characters of V is greater than4he maximum length in characters L of T, then4he6alue of T is set4o the first L characters of V,4he length in characters of T becomes L, and a completion condition is raised: warning- string data, right truncation. f) If4he data type of T is fixed-length bit string7ith length in bits L and4he length in bits of V is equal to L, then4he 6alue of T is set4o V. g)!?f the data4ype of T is fixed-length bit string with length in bits L and the length in bits of V is greater4han L, 4hen the value of T is set to4he first L bits of V and a completion condition is raised:7arning-string data, right truncation. h) If4he data type of T is fixed-length bit string7ith length in bits L and4he length in bits M of V is smaller than L, then4he first M bits of T are set4o V,4he remaining bits of T are set4o bits each with4he6alue of 0, and a comple- 4ion condition is raised:7arning-implicit zero-bit0adding. i) If4he data type of T is6ariable-length bit string and the length in bits M of V is not greater4han the maximum length in bits of T,4hen the value of T is set to V and4he length in bits of T is set to M. j) If4he data type of T is6ariable-length bit string, and4he length in bits of V is greater than4he maximum length in bits L of T, then4he6alue of T is set4o the first L bits of V,4he length in bits of T is set to L, and a completion condition is raised: warning-string data, right4runcation. 20Õ0¡0é0Ã0É Database Language SQL X0ß0¯0í0ó(g()92-154e¤BL CBR-002 9.1 Retrieval assignment k)!?f the data4ype of T is numeric and there is an approxi- mation obtained by rounding or truncation of the numerical value of V for4he data type of T,4hen the value of T is set to such an approximation. !?f there is no such approximation, then an exception condi- 4ion is raised: data exception-numeric value out of range. !?f the data4ype of T is exact numeric,4hen it is implementation- defined whether the approximation is obtained by rounding or by truncation. l) If4he data type of T is datetime and there is a representa- 4ion of4he6alue of V in4he data type of T,4hen the value of T is set to4hat representation. m) If4he data type of T is interval and there is a representa- 4ion of4he6alue of V in4he data type of T,4hen the value of T is set to4hat representation. Otherwise, an exception condition is raised: data exception-interval field overflow. Data assignment rules (y>)0ª0ü0à X0ß0¯0í0ó(g()92-154e¤BL CBR-002 9.(N)Store assignment 9.(N) Store assignment Function Specify rules for6alue assignments4hat store SQL-data. Syntax Rules 1) Let T and V be a TARGET and VALUE specified in an application of 4his Subclause. 2) If4he data type of T is character string, bit string, numeric, datetime, or interval,4hen the data4ype of V shall be char- acter string, bit string, numeric,4he same datetime4ype, or a comparable interval type, respectively. General Rules 1) Let T be an object column. (SA)!?f the value of V is the null6alue, then4he6alue of T is set 4o the null6alue. 0Î0Ã0È Otherwise, let V denote a non-null value of T. Case: a)!?f the data4ype of T is fixed-length character string with length in characters L and the length in characters of V is equal4o L,4hen the value of T is set to V. b) If4he data type of T is fixed-length character string7ith length in characters L and4he length in characters M of V is larger4han L,4hen Case: i)!?f the rightmost M-L characters of V are all s, then the value of T is set to4he first L characters of V. ii) If one or more of the rightmost M-L characters of V are not!!space>s,4hen an exception condition is raised: data exception-string data, right4runcation. c)!?f the data4ype of T is fixed-length character string with length in characters L and the length in characters M of V is less than L, then4he first M characters of T are set4o V and the last L-M characters of T are set4o s. d) If4he data type of T is6ariable-length character string and the length in characters M of V is not greater4han the maximum length in characters of T,4hen the value of T is set to V and4he length in characters of T is set to M. e) If4he data type of T is6ariable-length character string and the length in characters M of V is greater4han the maximum length in characters L of T,4hen, 20Ö0Ã0·0§0ë Database Language SQL X0ß0¯0í0ó(g()92-154e¤BL CBR-002 9.2 Store assignment Case: i) If4he rightmost M-L characters of V are all!!space>s,4hen 4he6alue of T is set4o the first L characters of V and 4he length in characters of T is set to L. ii) If one or more of the rightmost M-L characters of V are not!!space>s,4hen an exception condition is raised: data exception-string data, right4runcation. f)!?f the data4ype of T is fixed-length bit string with length in bits L and the length in bits of V is equal4o L,4hen the value of T is set to V. g) If4he data type of T is fixed-length bit string7ith length in bits L and4he length in bits M of V is greater than L, then an exception condition is raised: data exception-string data, right4runcation. h)!?f the data4ype of T is fixed-length bit string with length in bits L and the length in bits M of V is less than L, then an exception condition is raised: data exception-string data, length mismatch. i) If4he data type of T is6ariable-length bit string and the length in bits M of V is not greater4han the maximum length in bits of T,4hen the value of T is set to V and4he length in bits of T is set to M. j) If4he data type of T is6ariable-length bit string, and 4he length in bits M of V is greater than4he maximum length in bits L of T, then an exception condition is raised: data exception-string data, right4runcation. k)!?f the data4ype of T is numeric and there is an approxi- mation obtained by rounding or truncation of the numerical value of V for4he data type of T,4hen the value of T is set to such an approximation. !?f there is no such approximation, then an exception condi- 4ion is raised: data exception-numeric value out of range. !?f the data4ype of T is exact numeric,4hen it is implementation- defined whether the approximation is obtained by rounding or by truncation. l) If4he data type of T is datetime and there is a representa- 4ion of4he6alue of V in4he data type of T,4hen the value of T is set to4hat representation. m) If4he data type of T is interval and there is a representa- 4ion of4he6alue of V in4he data type of T,4hen the value of T is set to4hat representation. Otherwise, an exception condition is raised: data exception-interval field overflow. Data assignment rules 20Õ0é0ó X3H2-9(g()¬4/DBL CBR-00() 9.2 Store assignment 2 2 2) If4he column definition of T includes4he name of a domain whose domain descriptor includes a domain constraint D, then D is effectively checked.!?f D is not satisfied, then an exception condition is raised: integrity constraint violation. (y>)6 Database Language SQL X3H2-9(g()¬4/DBL CBR-00() 9.3 Set operation result data4ypes 9.0µ0ó0Á0ü0à Set operation result data4ypes Function Specify the Syntax Rules and result data4ypes for!!case expres- sion>s and!!query expression>s having set operators. Syntax Rules 1) Let DTS be a set of data types specified in an application of 4his Subclause. 2) All of4he data types in DTS shall be comparable. 0Î0Ã0È Case: a)!?f any of4he data types in DTS is character string, then all data types in DTS shall be character string, and all of 4hem shall have4he same character repertoire. That charac- 4er repertoire is4he character repertoire of4he result. The character set of the result is the character set of one of the data4ypes in DTS. The specific character set chosen is implementation-dependent. The collating sequence and4he co- ercibility attribute are determined as specified in Table 2, "Collating coercibility rules for dyadic operators". Case: i) If any of the data4ypes in DTS is6ariable-length char- acter string, then4he result data4ype is6ariable-length character string7ith maximum length in characters equal to4he maximum of the lengths in characters and maximum lengths in characters of the data4ypes in DTS. ii) Otherwise, the result data type is fixed-length character string7ith length in characters equal4o the maximum of the lengths in characters of4he data types in DTS. b) If any of the data4ypes in DTS is bit string,4hen all data 4ypes in DTS shall be bit string. Case: i) If any of the data4ypes in DTS is6ariable-length bit string, then4he result data4ype is6ariable-length bit string7ith maximum length in bits equal4o the maximum of the lengths in bits and maximum lengths in bits of4he data 4ypes in DTS. ii) Otherwise, the result data type is fixed-length bit string 7ith length in bits equal4o the maximum of4he lengths in bits of4he data types in DTS. Data assignment rules 20Ú0½ X3H2-9(g()¬4/DBL CBR-00() 9.3 Set operation result data4ypes c) If all of the data4ypes in DTS are exact numeric,4hen the result data type is exact numeric with implementation-defined precision and with scale equal4o the maximum of4he scales of4he data types in DTS. d) If any data type in DTS is approximate numeric, then each data4ype in DTS shall be numeric and the result data type is approximate numeric with implementation-defined precision. e)!?f any data4ype in DTS is a datetime data type, then each data4ype in DTS shall be the same datetime data4ype. The result data4ype is4he same datetime data type. f) If any data type in DTS is interval,4hen each data type in DTS shall be interval.!?f the precision of any data type in DTS specifies YEAR or MONTH,4hen the precision of each data4ype shall specify only YEAR or MONTH. If4he0reci- sion of any data4ype in DTS specifies DAY, HOUR, MINUTE, or SECOND(N), then4he0recision of no data type of DTS shall specify the s YEAR and MONTH. The result data type is interval7ith precision "S TO E", where S and E are the most significant of the s and4he least significant of the s of the data4ypes in DTS, respectively. ??eneral Rules None. 20Ú0Ë0Ò Database Language SQL X0ß0¯0í0ó(g()92-154e¤BL CBR-002 10 Additional common elements 10.1 !!intervaliualifier> Function Specify4he0recision of an interval data4ype. Format ::= !!start field> TO | ::= [ !!interval leading field0recision> ] !!end field> ::= !!non-second datetime field> = SECOND [ !!interval fractional seconds precision>!!right paren> ] ::= [ !!interval leading field0recision> ] = SECOND [ !!interval leading field0recision> [ ] ] !!datetime field> ::= | SECOND !!non-second datetime field> ::= YEAR | MONTH | DAY | HOUR= MINUTE ::= !!interval leading field0recision> ::= Additional common elements (y>)9 X0ß0¯0í0ó(g()92-154e¤BL CBR-002 10.1!!intervaliualifier> Syntax rules 1) There is a significance of ordering of s.!?n order from most significant to least significant, the ordering is: YEAR, MONTH, DAY,?!OUR, MINUTE, and SECOND. A!!start field> or with an i is more significant4han a or!!single datetime field>7ith an!!interval leading field0recision> j if i>j. An!!end field> or with an i is more significant than an or!!single datetime field>7ith an!!interval fractional seconds precision> j if i>j. 2) If TO is specified, then: a) shall be more significant than!!end field>, b) shall not specify MONTH, and c) if specified YEAR, then!!end field> shall spec- ify MONTH. 0Î0Ã0È The maximum6alue of is implementation-defined, but shall not be less than 2. 4) The maximum6alue of is implementation-defined, but shall not be less4han 6. 5) An!!interval leading field0recision>, if specified, shall be greater than 0 and shall not be greater than4he implementation- defined maximum. If!!interval leading field0recision> is not specified, then an of (N)is implicit. 5 5) An!!interval fractional seconds precision>, if specified, shall be greater4han or equal4o 0 and shall not be greater4han the implementation-defined maximum. If SECOND is specified and !!interval fractional seconds precision> is not specified,4hen an!!interval fractional seconds precision> of 6 is implicit. Access Rules None. ??eneral Rules 1) An item qualified by an contains the date- time fields identified by the . Case: a)!?f the specifies a!!single datetime field>, then4he!!intervaliualifier> identifies a single . Any reference to4he most significant or 240 Database Language SQL X0ß0¯0í0ó(g()92-154e¤BL CBR-002 10.1!!intervaliualifier> least significant of the item refers to4hat . b) Otherwise,4he!!intervaliualifier> identifies4hose datetime fields from to!!end field>, inclusive. 2) An!!interval leading field0recision> specifies Case: a)!?f the is SECOND, then4he number of decimal digits of0recision before the specified or implied decimal 0oint of the seconds . b) Otherwise,4he number of decimal digits of0recision of the first . 0Î0Ã0È An specifies the num- ber of decimal digits of precision following the specified or implied decimal0oint in the SECOND. 2 2 2) If!!single datetime field> is not specified and and are the same!!datetime field>,4hen the is equivalent4o a that is that!!datetime field>. 5) The length in positions of an item of type interval is computed as follows. Case: a)!?f the item is a year-month interval,4hen Case: i)!?f the is a , then4he length in0ositions of the item is the implicit or explicit of the . ii) Otherwise,4he length in0ositions of the item is the im- 0licit or explicit of 4he!!start field>0lus (N)(the length of4he!!non-second datetime field> that is the )0lus 1 (the length of the between4he!!years value> and4he in a ). b) Otherwise, Case: i)!?f the is a 4hat does not specify SECOND,4hen the length in positions of the item is the implicit or explicit!!interval leading field precision> of the . Additional common elements 241 X3H2-9(g()¬4/DBL CBR-00() 10.1 ii) If4he!!intervaliualifier> is a!!single datetime field> that specifies SECOND,4hen the length in positions of4he item is the implicit or explicit!!interval leading field precision> of the plus4he implicit or explicit!!interval fractional seconds precision>. If is greater4han +ero,4hen the length in positions of4he item is increased by 1 (the length in positions of4he!!period> between the !!seconds integer value> and4he!!seconds fraction>). iii) Otherwise, let0articipating datetime fields mean the date- 4ime fields4hat are less significant4han the and more significant than4he!!end field> of the !!intervaliualifier>. The length in0ositions of each0ar- 4icipating datetime field is (‘Ñ) Case: 1) If!!end field> is SECOND, then4he length in0ositions of4he item is4he implicit or explicit ,0lus 0µ0ó0Á0ü0àtimes the number of par- ticipating datetime fields (each0articipating datetime field has length (N)positions , plus4he!!minus sign>s or!!colon>s that0recede4hem have length 1 position), plus4he implicit or explicit , plus 1 (the length in positions of4he preceding the ). If!!interval frac- tional seconds0recision> is greater4han zero, then4he length in positions of4he item is increased by 1 (the length in positions of4he!!period> within4he field identified by the ). (SA) Otherwise, the length in positions of4he item is4he implicit or explicit!!interval leading field0reci- sion>, plus 2 24imes4he number of0articipating datetime fields (each participating datetime field has length () 0ositions, plus4he!!minus sign>s or s4hat pre- cede4hem have length 1 position),0lus (N)(the length in positions of4he!!end field>),0lus 1 (the length in positions of4he!!colon>0receding4he!!end field>). Leveling Rules 1) The following restrictions apply for Intermediate SQL: None. 2) The following restrictions apply for Entry SQL in addition4o any Intermediate SQL restrictions: a) Conforming Entry SQL language shall not contain any!!interval iualifier>. (T )(N) Database Language SQL X3H2-9(g()¬4/DBL CBR-00() 10.2!!language clause> 10.2 Function Specify a standard programming language. Format !!language clause> ::= LANGUAGE ::= ADA | C | COBOL | FORTRAN | MUMPS | PASCAL= PLI Syntax Rules None. Access Rules None. ??eneral Rules 1) The standard0rogramming language specified by4he clause is defined in the International Standard identified by4he!!lan- guage name> keyword. Table ­, "Standard programming languages", specifies the relationship. ______________Table_­-Standard_programming_languages______________ Language keyword______Relevant_standard____________________________________ | ADA =!?SOgEC 865(N) = = | | | C =!?SOgEC 9899 = = | | | COBOL =!?SO 1989 = = | | | FORTRAN =!?SOgEC 1539 = = | | | MUMPS =!?SOgEC 156 = = | | | PASCAL =!?SO 5 5 55 and ISO/IEC 10(eå)6 = = | | |_PLI________|_ISO_6­0____________________________________________| = | | Leveling Rules 1) The following restrictions apply for Intermediate SQL: None. Additional common elements 243 X3H2-9(g()¬4/DBL CBR-00() 10.(N) 2) The following restrictions apply for Entry SQL in addition4o any Intermediate SQL restrictions: a) A!!language clause> shall not specify MUMPS. 244 Database Language SQL X0ß0¯0í0ó(g()92-154e¤BL CBR-002 10.3!!privileges> 10.0µ0ó0Á0ü0à!!privileges> Function Specify0rivileges. Format ::= ALL PRIVILEGES | ::= ["!!comma>!!action> }... ] ::= SELECT | DELETE =!?NSERT [ !!privilege column list>!!right paren> ] | UPDATE [!!left0aren> ] = REFERENCES [ !!privilege column list>!!right paren> ] | USAGE ::= !!grantee> ::= PUBLIC | Syntax Rules 1) If4he!!object name> of the or!!revoke state- ment> specifying!!privileges> specifies
, then let T be the table identified by that!!table name>. T shall not be a declared local4emporary4able. (SA)!?f T is a4emporary4able, then!!privileges> shall specify ALL PRIVILEGES. 0Î0Ã0È Each in a!!privilege column list> shall identify a column of T. 2 2 2) UPDATE () is equivalent4o the spec- ification of UPDATE () for each!!column name> in .!?NSERT () is equivalent to4he specification of INSERT () for each in!!privilege column list>. REFERENCES () is equivalent4o the specification of Additional common elements (T )5 X0ß0¯0í0ó(g()92-154e¤BL CBR-002 10.3!!privileges> REFERENCES () for each in!!privilege column list>. 5) ALL PRIVILEGES is equivalent to4he specification of all of4he 0rivileges on!!object name> for7hich4he current!!authorization identifier> has grantable privilege descriptors. Access Rules None. ??eneral Rules 1) A of PUBLIC denotes at all4imes a list of!!grantee>s containing all of the s in4he SQL environment. (SA) The set of applicable0rivileges for an!!authorization identi- fier> includes4hose0rivileges defined by0rivilege descriptors associated with4hat , together7ith those defined by0rivilege descriptors associated with PUBLIC. 2 2) UPDATE () specifies4he UPDATE privilege on4he in- dicated column and implies one or more column0rivilege descrip- tors. If4he!!privilege column list> is omitted,4hen UPDATE specifies4he UPDATE privilege on all columns of T including any column subsequently added to T and implies a4able0rivilege descriptor and one or more column0rivilege descriptors. 4)!?NSERT () specifies the INSERT0rivilege on the in- dicated column and implies one or more column privilege descrip- 4ors.!?f the is omitted, then!?NSERT specifies the INSERT0rivilege on all columns of T including any column subsequently added4o T and implies a table privilege descriptor and one or more column privilege descriptors. 5) REFERENCES () specifies4he REFERENCES privilege on4he indicated column and implies one or more column0rivilege descriptors. If4he!!privilege column list> is omitted,4hen REFERENCES specifies4he REFERENCES privilege on all columns of T including any column subsequently added to T and implies a4able0rivilege descriptor and one or more column0rivilege descriptors. Leveling Rules 1) The following restrictions apply for!?ntermediate SQL: a) An 4hat specifies INSERT shall not contain a!!privi- lege column list>. 246 Database Language SQL X0ß0¯0í0ó(g()92-154e¤BL CBR-002 10.3!!privileges> 2) The following restrictions apply for Entry SQL in addition4o any Intermediate SQL restrictions: None. Additional common elements 247 X3H2-9(g()¬4/DBL CBR-00() 10.4 10.4 !!character set specification> Function Identify a character set. Format !!character set specification> ::= !!standard character repertoire name> | =!!user-defined character repertoire name> | | !!standard character repertoire name> ::= !!implementation-defined character repertoire name> ::= ::=!!character set name> ::= !!implementation-defined5niversal character form-of-use name> ::= !!character set name> Syntax Rules 1) The!!standard character repertoire name>s, s, s, and s4hat are supported are implementation-defined. (SA) A character set identified by a!!standard character repertoire name>, by an!!implementation-defined character repertoire name>, by a , or by an has associated7ith it a0rivilege descriptor that7as effec- tively defined by the ??RANT USAGE ON CHARACTER SET CS TO PUBLIC 2 2 2 2ITH GRANT OPTION where CS is the contained in the . The grantor of the privilege descriptor is set to4he special grantor6alue "_SYSTEM". 0Î0Ã0È The!!implementation-defined character repertoire name>s shall include SQL_TEXT. 248 Database Language SQL X0ß0¯0í0ó(g()92-154e¤BL CBR-002 10.4 Access Rules 1) Let C be the contained in the . The applicable privileges shall include USAGE on C. ??eneral Rules 1) A identifies a character set. Let the identified character set be CS. Note: A character set comprises4he characters in4he character set's repertoire together7ith a form-af-use that specifies 4he convention for arranging those characters into character strings. 2) A specifies4he name of a character repertoire that is defined by a national or interna- tional standard. The character repertoire and form-af-use of CS, implied by the , are defined by4he standard that defined4hat . The default collating sequence of the character reper- 4oire is defined by4he order of the characters in the standard and has4he PAD SPACE attribute. 0Î0Ã0È An speci- fies4he name of a character repertoire that is implementation- defined. The character repertoire and form-af-use of CS, implied by the , are implementation-defined. The default collating sequence of the character repertoire and7hether4he collating sequence has the NO PAD attribute or the PAD SPACE attribute is implementation- defined. 4) A!!user-defined character repertoire name> identifies a charac- 4er set7hose descriptor is in some schema whose is not!?NFORMATION_SCHEMA. Note: The default collating sequence and form-of-use of CS are as defined in Subclause 11.(R´), "". 5) A!!standard5niversal character form-of-use name> identifies form-af-use that is defined by some national or international standard. That form-of-use is the form-af-use of CS. The charac- 4er repertoire of CS is as defined in4hat standard. The default collating sequence of the character repertoire is defined by4he order of the characters in ISO/IEC 10646 and has the PAD SPACE attribute. Note: Specific forms-af-use implied by4his rule include!?SO 202(N)code extension4echniques. 5 5) An!!implementation-defined5niversal character form-of-use name> identifies an implementation-defined form-af-use that shall be the form-af-use of CS. The implied character repertoire and Additional common elements (T )9 X0ß0¯0í0ó(g()92-154e¤BL CBR-002 10.4!!character set specification> default collating sequence of CS and whether the collating se- quence has4he NO PAD attribute or4he PAD SPACE attribute are implementation-defined. Note: Specific forms-af-use implied by4his rule include implementation-defined techniques such as mixed one-actetzËwo- octet Latin/Kanji or Compound String. 7) There is a character set descriptor for every character set4hat can be specified by a . Leveling Rules 1) The following restrictions apply for Intermediate SQL: None. 2) The following restrictions apply for Entry SQL in addition4o any Intermediate SQL restrictions: a) Conforming Entry SQL language shall not contain a!!character set specification>. 250 Database Language SQL X0ß0¯0í0ó(g()92-154e¤BL CBR-002 10.5!!collate clause> 10.5 !!collate clause> Function Specify a collating sequence. Format ::= COLLATE!!collation name> Syntax Rules None. Access Rules 1) Let C be the contained in the . The applicable0rivileges shall include USAGE on C. General Rules None. Leveling Rules 1) The following restrictions apply for Intermediate SQL: a) Conforming!?ntermediate SQL language shall not contain any !!collate clause>. 2) The following restrictions apply for Entry SQL in addition4o any Intermediate SQL restrictions: None. Additional common elements (ry)1 X0ß0¯0í0ó(g()92-154e¤BL CBR-002 10.6!!constraint name definition> and 10.6 !!constraint name definition> and Function Specify4he name of a constraint and its attributes. Format !!constraint name definition> ::= CONSTRAINT!!constraint name> !!constraint attributes> ::= !!constraint check4ime> [ [ NOT ] DEFERRABLE ] | [ NOT ] DEFERRABLE [!!constraint check4ime> ] !!constraint check4ime> ::= !?NITIALLY DEFERRED | INITIALLY IMMEDIATE Syntax Rules 1)!?f a is contained in a!!schema def- inition>, and if4he!!constraint name> contains a , 4hen that!!schema name> shall be the same as the specified or implicit of4he containing . 2) The of shall be differ- ent from the of the of any other constraint defined in4he same schema. 0Î0Ã0È!?f is not specified, then!?NITIALLY !?MMEDIATE is implicit. 4) Case: a)!?f INITIALLY DEFERRED is specified,4hen: i) NOT DEFERRABLE shall not be specified. ii) If DEFERRABLE is not specified, then DEFERRABLE is im- plicit. b) If!?NITIALLY!?MMEDIATE is specified or implicit and nei- 4her DEFERRABLE nor NOT DEFERRABLE is specified, then NOT DEFERRABLE is implicit. Access Rules None. (ry)(N) Database Language SQL X3H2-9(g()¬4/DBL CBR-00() 10.6 and!!constraint attributes> General Rules 1)!?f NOT DEFERRABLE is specified,4hen the constraint is not de- ferrable; otherwise it is deferrable. (SA)!?f is!?NITIALLY DEFERRED,4hen the ini- 4ial constraint mode for the constraint is deferred; otherwise, 4he initial constraint mode for4he constraint is immediate. 0Î0Ã0È!?f, on completion of any SQL-statement,4he constraint mode of any constraint is immediate,4hen that constraint is effectively checked. Note: This includes4he cases7here!!SQL statement> is a , a , or4he statement4hat causes a constraint with a constraint mode of initially immediate to be created. 2 2 2) When a constraint is effectively checked, if4he constraint is not satisfied, then an exception condition is raised: integrity constraint violation.!?f this exception condition is raised as a result of executing a , then SQLSTATE is not set4o integrity constraint6iolation, but is set4o transaction rollback-integrity constraint violation (see4he??eneral Rules of Subclause .3, ""). Leveling Rules 1) The following restrictions apply for Intermediate SQL: a) Conforming!?ntermediate SQL language shall contain no ex- plicit!!constraint attributes>. Note: This means that!?NITIALLY!?MMEDIATE NOT DEFERRABLE is implicit. 2) The following restrictions apply for Entry SQL in addition4o any Intermediate SQL restrictions: a) Conforming Intermediate SQL language shall contain no!!con- straint name definition>. Additional common elements 253 X3H2-9(g()¬4/DBL CBR-00() (ry)4 Database Language SQL X3H2-9(g()¬4/DBL CBR-00() 11 Schema definition and manipulation .1 Function Define a schema. Format !!schema definition> ::= CREATE SCHEMA!!schema name clause> [ ] [!!schema element>... ] !!schema name clause> ::= | AUTHORIZATION | AUTHORIZATION !!schema authorization identifier> ::= !!authorization identifier> ::= DEFAULT CHARACTER SET!!character set specification> !!schema element> ::= |
=!!view definition> =!!grant statement> =!!assertion definition> | =!!collation definition> | Syntax Rules 1) If!!schema name> is not specified,4hen a equal to !!schema authorization identifier> is implicit. (SA)!?f AUTHORIZATION is not speci- fied, then Schema definition and manipulation (ry)5 X0ß0¯0í0ó(g()92-154e¤BL CBR-002 .1!!schema definition> Case: a)!?f the is contained in a 4hat has a specified,4hen an !!authorization identifier> equal to4hat is implicit for the . b) Otherwise, an!!authorization identifier> equal to4he SQL- session is implicit. 0Î0Ã0È The!!unqualified schema name> of the explicit or implicit !!schema name> shall be different from4he!!unqualified schema name> of the of any other schema in4he catalog identified by4he!!catalog name> of!!schema name>. 4)!?f a appears in a!!procedure> in a , then4he effective!!schema authorization identifier> and!!schema name> during processing of the is4he !!schema authorization identifier> and!!schema name> specified or implicit in the . Other SQL-statements executed in s in the have the and specified or implicit for the . 5)!?f is not specified, 4hen a containing an implementation-defined is im- 0licit. Access Rules 1) The0rivileges necessary to execute4he!!schema definition> are implementation-defined. ??eneral Rules 1) A schema S is created with a name equal to4he explicit or im- 0licit and a default character set name equal4o the of4he explicit or implicit . 2) The is4he current!!authoriza- 4ion identifier> for privilege determination for S. 2 2) Those objects defined by!!schema element>s (base4ables,6iews, constraints, domains, assertions, character sets, translations, collations, privileges) and their associated descriptors are effectively created. 4) The explicit or implicit is5sed as4he default character set5sed for all s and!!domain definition>s that do not specify an explicit charac- ter set. 256 Database Language SQL X0ß0¯0í0ó(g()92-154e¤BL CBR-002 11.1 Leveling Rules 1) The following restrictions apply for Intermediate SQL: a) Conforming!?ntermediate SQL language shall not contain any !!assertion definition>. b) Conforming Intermediate SQL language shall not contain any . c) Conforming!?ntermediate SQL language shall not contain any !!translation definition>. 2) The following restrictions apply for Entry SQL in addition4o any Intermediate SQL restrictions: a) Conforming Intermediate SQL language shall not contain any . b) A!!schema name clause> shall specify AUTHORIZATION and shall not specify a . c) A!!schema character set specification> shall not be speci- fied. d) Conforming Entry SQL language shall not contain any . Schema definition and manipulation (ry)7 X0ß0¯0í0ó(g()92-154e¤BL CBR-002 .2!!drop schema statement> .2 Function Destroy a schema. Format ::= DROP SCHEMA ::= CASCADE | RESTRICT Syntax Rules 1) Let S be4he schema identified by . 2) S shall identify a schema in4he catalog identified by4he ex- 0licit or implicit . 0Î0Ã0È!?f RESTRICT is specified,4hen S shall not contain any per- sistent base tables, global4emporary4ables, created local 4emporary4ables,6iews, domains, assertions, character sets, collations, or translations. Note:!?f CASCADE is specified, then such objects will be dropped by4he effective execution of the SQL schema manipulation state- ments specified in the General Rules of4his Subclause. Access Rules 1) The current!!authorization identifier> shall be equal4o the 4hat owns4he schema identified by the . ??eneral Rules 1) Let T be4he!!table name> of any base table or4emporary4a- ble contained in S. The following!!drop4able statement> is effectively executed: DROP TABLE T CASCADE 2) Let V be4he!!table name> of any6iew contained in S. The fol- lowing is effectively executed: DROP VIEW V CASCADE 0Î0Ã0È Let D be the of any domain contained in S. The following is effectively executed: DROP DOMAIN D CASCADE (ry)8 Database Language SQL X3H2-9(g()¬4/DBL CBR-00() .2!!drop schema statement> 4) Let A be the of any assertion contained in S. The following!!drop assertion statement> is effectively exe- cuted: DROP ASSERTION A 5) Let CD be the of any collation definition contained in S. The following!!drop collation statement> is effectively executed: DROP COLLATION CD 6) Let TD be4he!!translation name> of any4ranslation contained in S. The following!!drop4ranslation statement> is effectively executed: DROP TRANSLATION TD 7) Let RD be4he!!character set name> of any character set con- tained in S. The following!!drop character set statement> is effectively executed: DROP CHARACTER SET RD 8) The identified schema and its description are destroyed. Leveling Rules 1) The following restrictions apply for!?ntermediate SQL: None. (SA) The following restrictions apply for Entry SQL in addition to any!?ntermediate SQL restrictions: a) Conforming Entry SQL language shall not contain a . Schema definition and manipulation 259 X3H2-9(g()¬4/DBL CBR-00() 11.0µ0ó0Á0ü0à
.3
Function Define a0ersistent base4able, a created local temporary table, or a global temporary table. Format
::= CREATE [ { GLOBAL= LOCAL( TEMPORARY ] TABLE!!table name>
[ ON COMMIT" DELETE | PRESERVE( ROWS ]
::= !!left0aren>
[ {
}... ]!!right paren>
::= |
Syntax Rules 1)!?f a
is contained in a!!schema definition>, and if4he!!table name> contains a!!schema name>, then4hat shall be4he same as4he specified or implicit !!schema name> of the containing!!schema definition>. (SA) The schema identified by the explicit or implicit schema name of the
shall not include a4able descriptor whose table name is
. 0Î0Ã0È!?f ON COMMIT is specified, then TEMPORARY shall be specified. 2 2 2) If TEMPORARY is specified and ON COMMIT is not specified, then ON COMMIT DELETE ROWS is implicit. 5) A!!table definition> shall contain at least one!!column defini- 4ion>. 6) The scope of the
is the
. Access Rules 1) If a!!table definition> is contained in a , then4he current!!authorization identifier> shall be equal4o the 4hat owns4he schema identified by the implicit or explicit!!schema name> of the
. 260 Database Language SQL X0ß0¯0í0ó(g()92-154e¤BL CBR-002 .3!!table definition> ??eneral Rules 1) A
defines either a persistent base table, a global temporary table or a created local4emporary4able. If ??LOBAL is specified, then a global temporary table is defined. If LOCAL is specified,4hen a created local temporary table is defined. Otherwise, a0ersistent base4able is defined. 2) The degree of the table being created is initially set4o 0;4he ??eneral Rules of Subclause .4, "" specify the degree of the table being created during4he definition of columns in that4able. 0Î0Ã0È A4able descriptor is created4hat describes the table being defined. a) The name included in the table descriptor is
. b) The table descriptor includes the degree of the table,7hich is the number of
s in the
4hat are s. 4) A set of privilege descriptors is created4hat define4he0riv- ileges INSERT, SELECT, UPDATE, DELETE, and REFERENCES on this 4able and!?NSERT, SELECT, UPDATE, and REFERENCES for every in4he4able definition to4he!!authorization identifier> of4he!!schema definition> or in which the
appears. These privileges are grantable. The grantor for each of these privilege descriptors is set4o the special grantor value "_SYSTEM". Leveling Rules 1) The following restrictions apply for Intermediate SQL: a) Conforming!?ntermediate SQL language shall not specify TEMPORARY and shall not reference any global or local4em- porary4able. (SA) The following restrictions apply for Entry SQL in addition to any!?ntermediate SQL restrictions: None. Schema definition and manipulation 261 X3H2-9(g()¬4/DBL CBR-00() 11.4 11.4 !!column definition> Function Define a column of a4able. Format !!column definition> ::= !!column name>"!!data4ype>=!!domain name>( [!!default clause> ] [ ... ] [ ] !!column constraint definition> ::= [ ] !!column constraint> [!!constraint attributes> ] !!column constraint> ::= NOT NULL | =!!references specification> | Syntax Rules 1) Case: a)!?f the is contained in a
, then let T be the table defined by4hat
. b) If4he!!column definition> is contained in a!!temporary ta- ble declaration>, then let T be the table declared by that !!temporary table declaration>. c) If4he!!column definition> is contained in an ,4hen let T be4he4able identified in4he containing . The in4he!!column definition> shall be different from4he!!column name> of any column of T. 2) The i-th column of4he4able is described by4he i-th in4he!!table definition>. The name and the data 4ype or domain of4he column are specified by4he!!column name> and!!data4ype> or , respectively. 2 2) Let C be4he!!column name> of a . 2 2 2) If!!domain name> is specified,4hen let D be4he domain identi- fied by the . 262 Database Language SQL X0ß0¯0í0ó(g()92-154e¤BL CBR-002 11.4 5) The data4ype of4he column is Case: a) If!!data4ype> is specified,4hen that data type. b) Otherwise,4he data type of D. 5 5) If4he data type of the column is character string, then4he collation of the column is Case: a)!?f is specified,4hen the collation speci- fied by4hat . b) If!!domain name> is specified,4hen the collation of D, if any. c) Otherwise,4he default collation of the character set of4he column. Note: The character set of a column is determined by its data type. 7)!?f a is specified, then: a) Let DT be the . b) The data type of the column is DT. c) If DT is CHARACTER or CHARACTER VARYING and does not spec- ify a!!character set specification>, then4he!!character set specification> specified or implicit in the of the that created4he schema identified by the immedi- ately contained in4he!!table name> of4he containing
or is implicit. d)!?f DT is a that identifies a char- acter set that specifies a!!collate clause> and the does not contain a!!collate clause>,4hen the of the is implicit in4he!!column definition>. 8)!?f is specified,4hen data4ype shall be a character string type. 9)!?f a is specified,4hen let CND be4he!!constraint name definition> if one is specified and let CND be a+ero-length string otherwise; let CA be4he!!constraint attributes> if specified and let CA be a zero-length string otherwise. The is equivalent4o a
as follows: Schema definition and manipulation (Œ¡)0ª0ü0à X0ß0¯0í0ó(g()92-154e¤BL CBR-002 .4!!column definition> Case: a)!?f a is specified that con- tains the NOT NULL, then it is equivalent to a!!table constraint definition>4hat contains4he follow- ing!!table constraint>: CND CHECK ( C!?S NOT NULL ) CA b) If a!!column constraint definition> is specified4hat con- 4ains a!!unique specification>,4hen it is equivalent4o a
that contains the following
: CND (C) CA Note: The!!unique specification> is defined in Subclause .7, "". c) If a!!column constraint definition> is specified4hat con- 4ains a!!references specification>,4hen it is equivalent4o a
that contains the following
: CND FOREIGN KEY (C) CA Note: The!!references specification> is defined in Subclause .8, "". d)!?f a is specified that con- tains a ,4hen it is equivalent 4o a
that contains the follow- ing
: CND CHECK ( ) CA Each directly contained in4he!!search condition> shall reference column C. Access Rules 1) If!!domain name> is specified,4hen the applicable0rivileges shall include USAGE on D.. ??eneral Rules 1) A defines a column in a table. 2) The specifies4he default collating sequence for the column. If!!collate clause> is not specified, then 4he default collating sequence is4hat used for comparisons of Coercible coercibility attribute, as defined in Subclause 8.(l4) "". 2 2) If4he!!column definition> specifies!!data4ype>, then a data type descriptor is created4hat describes the data4ype of4he column being defined. 264 Database Language SQL X0ß0¯0í0ó(g()92-154e¤BL CBR-002 11.4 2 2 2) The degree of the table T being defined in4he containing
or or altered by the containing!!alter table statement> is increased by 1. 5) A column descriptor is created that describes4he column being defined. The name included in the column descriptor is!!col- 5mn name>. If4he!!column definition> specifies!!data4ype>, then4he column descriptor includes the data4ype descriptor of the column; otherwise,4he column descriptor includes the name of the domain of the column. The ordinal position included in4he column descriptor is equal to4he degree of T. If4he !!column definition> contains a , then4he!!col- lation name> of4he!!collate clause> is included in4he column descriptor. The column descriptor includes4he nullability char- acteristic of4he column, determined according to4he rules in Subclause 4.8, "Columns". The column descriptor is included in 4he4able descriptor for T. Leveling Rules 1) The following restrictions apply for Intermediate SQL: a) Conforming!?ntermediate SQL language shall not contain any !!collate clause>. 2) The following restrictions apply for Entry SQL in addition4o any Intermediate SQL restrictions: a) A!!column definition> shall not contain a!!domain name>. b) A shall not contain a . c) Conforming!?ntermediate SQL language shall contain no . Schema definition and manipulation (Œ¡)5 X0ß0¯0í0ó(g()92-154e¤BL CBR-002 .5!!default clause> 11.5 !!default clause> Function Specify4he default for a column or domain. Format ::= DEFAULT!!default option> ::= !!literal> =!!datetime6alue function> = USER | CURRENT_USER = SESSION_USER | SYSTEM_USER | NULL Syntax Rules 1) The subject data4ype of a!!default clause> is4he data type specified in the descriptor identified by4he containing ,!!domain definition>, , or . 2) If USER is specified, then CURRENT_USER is implicit. 2 2) Case: a) If a!!literal> is specified,4hen: Case: i) If4he subject data type is character string, then4he shall be a!!character string literal>.!?f the length of4he subject data type is fixed,4hen the length in characters of4he!!character string literal> shall not be greater than4he length of4he subject data type. If the length of the subject data4ype is6ariable,4hen the length in characters of4he!!character string literal> shall not be greater than4he maximum length of4he subject data4ype. The!!literal> shall have the same character repertoire as the subject data4ype. ii)!?f the subject data4ype is bit string,4hen the shall be a or a . !?f the length of the subject data4ype is fixed, then4he length in bits of the or shall not be greater4han the length of the sub- ject data type. If4he length of4he subject data type is (Œ¡)6 Database Language SQL X3H2-9(g()¬4/DBL CBR-00() 11.5 variable, then4he length in bits of4he!!bit string lit- eral> or shall not be greater than4he maximum length of the subject data4ype. iii)!?f the subject data4ype is exact numeric, then4he!!lit- eral> shall be a!!signed numeric literal> that simply contains an!!exact numeric literal>. There shall be a rep- resentation of the value of4he!!literal> in the subject data type4hat does not lose any significant digits. iv) If4he subject data type is approximate numeric,4hen the !!literal> shall be a . 6) If4he subject data type is datetime, then4he!!literal> shall be a!!datetime literal> and shall contain the same s as4he subject data type. vi) If4he subject data type is interval, then4he!!literal> shall be an and shall contain4he same !!intervaliualifier> as4he subject data type. b) If CURRENT_USER, SESSION_USER, or SYSTEM_USER is specified, then4he subject data type shall be character string7ith character set SQL_TEXT. If4he length of4he subject data type is fixed,4hen its length shall not be less4han 8 characters. If4he length of4he subject data type is vari- able, then its maximum length shall not be less than 1(R´) characters. c)!?f is specified, then4he subject data type shall be datetime7ith the same datetime type as the datetime data type of the . Access Rules None. ??eneral Rules 1) The default value inserted in the column descriptor, if the is to apply4o a column, or in the domain de- scriptor, if the is to apply4o a domain, is as follows: Case: a) If4he!!default clause> contains NULL,4hen the null6alue. b) If4he!!default clause> contains a!!literal>, then Case: i) If4he subject data type is numeric,4hen the numeric value of the . Schema definition and manipulation 267 X3H2-9(g()¬4/DBL CBR-00() 11.5 ii) If4he subject data type is character string7ith variable length, then4he6alue of the . iii)!?f the subject data4ype is character string with fixed length, then4he6alue of the , extended as neces- sary on4he right7ith s4o the length in characters of4he subject data type. iv) If4he subject data type is bit string7ith variable length, then4he6alue of the . v)!?f the subject data4ype is bit string with fixed length, then4he6alue of the extended as necessary on the right with 0-valued bits4o the length of the subject data type and a completion condition is raised:7arning- implicit zero-bit0adding. vi) If4he subject data type is datetime or interval, then4he value of4he!!literal>. c) If4he!!default clause> specifies CURRENT_USER, SESSION_USER, or SYSTEM_USER, then Case: i) If4he subject data type is character string7ith variable length, then4he6alue specified by CURRENT_USER, SESSION_ USER, or SYSTEM_USER. ii) If4he subject data type is character string7ith fixed length,4hen the value specified by CURRENT_USER, SESSION_ USER, or SYSTEM_USER, extended as necessary on the right 7ith s4o the length in characters of the subject data type. d) If4he!!default clause> contains a!!datetime6alue function>, then4he6alue of an implicit reference to4he!!datetime 6alue function>. (SA) The default6alue of a column is Case: a)!?f the column descriptor of a column includes a default6alue derived from a , then4he6alue of that!!de- fault option>. b)!?f the column descriptor includes a domain name4hat iden- tifies a domain descriptor4hat includes a default6alue derived from a , then4he6alue of that!!de- fault option>. c) Otherwise, the null6alue. (Œ¡)8 Database Language SQL X3H2-9(g()¬4/DBL CBR-00() 11.5 Leveling Rules 1) The following restrictions apply for!?ntermediate SQL: None. (SA) The following restrictions apply for Entry SQL in addition to any!?ntermediate SQL restrictions: a) A shall not specify a!!datetime6alue func- 4ion>, SYSTEM_USER, SESSION_USER, or CURRENT_USER. Schema definition and manipulation (Œ¡)9 X0ß0¯0í0ó(g()92-154e¤BL CBR-002 .6!!table constraint definition> .6
Function Specify an integrity constraint. Format !!table constraint definition> ::= [!!constraint name definition> ]
[!!constraint attributes> ] !!table constraint> ::= =!!referential constraint definition> =!!check constraint definition> Syntax Rules 1) If!!constraint attributes> is not specified,4hen INITIALLY IMMEDIATE NOT DEFERRABLE is implicit. (SA)!?f is not specified,4hen a 4hat contains an implementation- dependent is implicit. The assigned shall obey4he Syntax Rules of an explicit!!con- straint name>. Access Rules None. General Rules 1) A!!table constraint definition> defines a4able constraint. 2) A table constraint descriptor is created4hat describes the table constraint being defined. The table constraint descriptor includes4he!!constraint name> contained in the explicit or implicit!!constraint name definition>. The table constraint descriptor includes an indication of whether the constraint is deferrable or not deferrable and 7hether4he initial constraint mode of the constraint is de- ferred or immediate. Case: a) If!!unique constraint definition> is specified, then4he 4able constraint descriptor is a unique constraint descriptor 4hat includes an indication of whether it7as defined7ith PRIMARY KEY or UNIQUE, and4he names of the unique columns specified in the . (y])0 Database Language SQL X3H2-9(g()¬4/DBL CBR-00() .6!!table constraint definition> b) If!!referential constraint definition> is specified,4hen the table constraint descriptor is a referential constraint de- scriptor4hat includes4he names of the referencing columns specified in4he!!referencing columns> and4he names of the referenced columns and referenced table specified in 4he!!referenced4able and columns>,4he6alue of the , if specified, and the , if specified. c)!?f is specified, then4he4able constraint descriptor is a table check constraint descriptor that includes the . 0Î0Ã0È!?f the
is a , 4hen let SC be the immediately contained in the and let T be4he4able name included in the corresponding table constraint descriptor;4he 4able constraint is not satisfied if and only if EXISTS ( SELECT * FROM T WHERE NOT ( SC ) ) is4rue. Leveling Rules 1) The following restrictions apply for Intermediate SQL: None. 2) The following restrictions apply for Entry SQL in addition4o any Intermediate SQL restrictions: a) Conforming Intermediate SQL language shall contain no!!con- straint name definition>. Schema definition and manipulation (y])1 X0ß0¯0í0ó(g()92-154e¤BL CBR-002 .7!!unique constraint definition> 11.7 !!unique constraint definition> Function Specify a5niqueness constraint for a4able. Format !!unique constraint definition> ::= !!left0aren> !!right paren> !!unique specification> ::= UNIQUE= PRIMARY KEY !!unique column list> ::= Syntax Rules 1) Let T be4he4able identified by4he containing
or . Let TN be4he!!table name> of T. (SA) Let UCL be the of the . 0Î0Ã0È Case: a)!?f the specifies PRIMARY KEY, then let SC be4he!!search condition>: UNIQUE ( SELECT UCL FROM TN ) AND ( UCL )!?S NOT NULL b) Otherwise, let SC be the : UNIQUE ( SELECT UCL FROM TN ) 4) Each in4he!!unique column list> shall identify a column of T, and the same column shall not be identified more 4han once. 5) A!!table definition> shall specify at most one implicit or ex- plicit!!unique constraint definition> that specifies PRIMARY KEY. 6)!?f a 4hat specifies PRIMARY KEY is contained in an!!add table constraint definition>, then4he 4able identified by4he!!table name> immediately contained in 4he containing shall not have a5nique constraint4hat was defined by a!!unique constraint definition> that specified PRIMARY KEY. (y])(N) Database Language SQL X3H2-9(g()¬4/DBL CBR-00() 11.7 7) The set of columns in4he!!unique column list> shall be dis- tinct from4he5nique columns of any other5nique constraint descriptor that is included in the base4able descriptor of T. Access Rules None. General Rules 1) A!!unique constraint definition> defines a unique constraint. Note: Subclause 10.6, " and ", specifies when a constraint is effectively checked. (SA) The5nique constraint is not satisfied if and only if EXISTS ( SELECT * FROM TN WHERE NOT ( SC ) ) is4rue. Leveling Rules 1) The following restrictions apply for Intermediate SQL: None. 2) The following restrictions apply for Entry SQL in addition4o any Intermediate SQL restrictions: a)!?f PRIMARY KEY or UNIQUE is specified, then4he!!column defi- nition> for each column7hose!!column name> is in4he!!unique column list> shall specify NOT NULL. Schema definition and manipulation 273 X3H2-9(g()¬4/DBL CBR-00() 11.8 11.8 !!referential constraint definition> Function Specify a referential constraint. Format !!referential constraint definition> ::= FOREIGN KEY!!left0aren> !!references specification> ::= REFERENCES!!referenced4able and columns> [ MATCH ] [!!referential triggered action> ] ::= FULL | PARTIAL ::= ::= !!table name> [ !!reference column list>!!right paren> ] ::= !!referential triggered action> ::= [ ] | [ ] ::= ON UPDATE !!delete rule> ::= ON DELETE!!referential action> ::= CASCADE = SET NULL | SET DEFAULT | NO ACTION Syntax Rules 1) Let referencing4able be the table identified by the containing !!table definition> or!!alter table statement>. Let referenced 4able be the table identified by the
in the . Let referencing columns be4he column or columns identified by4he!!reference column list> in the 274 Database Language SQL X0ß0¯0í0ó(g()92-154e¤BL CBR-002 11.8 and let referencing column be one such column. 2) Case: a) If4he!!referenced4able and columns> specifies a ,4hen the set of column names of4hat shall be equal4o the set of column names in4he5nique columns of a5nique constraint of the refer- enced4able. Let referenced columns be the column or columns identified by that!!reference column list> and let refer- enced column be one such column. Each referenced column shall identify a column of4he referenced table and the same column shall not be identified more4han once. b) If4he!!referenced4able and columns> does not specify a !!reference column list>, then4he4able descriptor of4he referenced table shall include a unique constraint that spec- ifies PRIMARY KEY. Let referenced columns be the column or columns identified by the unique columns in that5nique con- straint and let referenced column be one such column. The !!referenced4able and columns> shall be considered to implic- itly specify a that is identical to 4hat . 0Î0Ã0È The4able constraint descriptor describing the 7hose!!unique column list> identifies4he referenced columns shall indicate4hat the unique constraint is not deferrable. 2 2 2) The referenced4able shall be a base4able. Case: a)!?f the referencing table is a0ersistent base4able, then4he referenced table shall be a0ersistent base4able. b) If4he referencing4able is a global4emporary4able, then 4he referenced table shall be a global temporary table. c)!?f the referencing table is a created local4emporary4able, then4he referenced table shall be either a global4emporary 4able or a created local temporary table. d)!?f the referencing table is a declared local temporary table, 4hen the referenced4able shall be either a global temporary table, a created local4emporary4able or a declared local 4emporary4able. 5)!?f the referenced4able is a temporary table with ON COMMIT DELETE ROWS specified, then4he referencing4able shall specify ON COMMIT DELETE ROWS. Schema definition and manipulation 275 X3H2-9(g()¬4/DBL CBR-00() 11.8 5 5) Each referencing column shall identify a column of4he referenc- ing4able, and the same column shall not be identified more4han once. 7) The!!referencing columns> shall contain4he same number of s as the . The i-th col- umn identified in the corresponds to4he i-th column identified in4he!!referenced4able and columns>. The data type of each referencing column shall be4he same as 4he data type of the corresponding referenced column. 8) If a!!referential constraint definition> does not specify any ,4hen an!!update rule>7ith a of NO ACTION is implicit. 9) If a!!referential constraint definition> does not specify any ,4hen a with a!!referential action> of NO ACTION is implicit. Access Rules 1) The applicable0rivileges shall include REFERENCES for each referenced column. ??eneral Rules 1) A defines a referential constraint. Note: Subclause 10.6, " and!!con- straint attributes>"+"+ specifies7hen a constraint is effectively checked. 2) Let Rf be the referencing columns and let Rt be the referenced columns in the referenced4able T. The referencing table and the referenced4able satisfy4he referential constraint if and only if: Case: a) A!!match type> is not specified and for each row of4he ref- erencing4able, the Rf MATCH (SELECT Rt FROM T) is true. b) PARTIAL is specified and for each row of4he referencing 4able, the Rf MATCH PARTIAL (SELECT Rt FROM T) is true. c) FULL is specified and for each row of the referencing table, 4he!!match predicate> Rf MATCH FULL (SELECT Rt FROM T) (y])6 Database Language SQL X3H2-9(g()¬4/DBL CBR-00() .8!!referential constraint definition> is true. 0Î0Ã0È Case: a)!?f is not specified or if FULL is specified, 4hen for a given row in4he referenced table, let matching rows be all rows in the referencing table whose referenc- ing column6alues equal the corresponding referenced column values for4he referential constraint. b)!?f PARTIAL is specified, then: i) For a given row in4he referenced table, let matching rows be all rows in4he referencing4able4hat have at least one non-null referencing column6alue and7hose non-null ref- erencing column values equal4he corresponding referenced column values for4he referential constraint. ii) For a given row in the referenced4able, let unique match- ing rows be all matching rows for4hat given row that are matching rows only4o the given row in4he referenced table for4he referential constraint. For a given row in the ref- erenced table, let non-unique matching rows be all matching rows for that given row4hat are not unique matching rows for that given row for4he referential constraint. 2 2 2) For every row of4he referenced table, its matching rows, unique matching rows, and non-unique matching rows are determined imme- diately before4he execution of any SQL-statement. No new match- ing rows are added during4he execution of that SQL-statement. The association between a referenced row and a non-unique match- ing row is dropped during4he execution of that SQL-statement if the referenced row is either marked for deletion or updated to a distinct value on any referenced column4hat 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. 5) If a!!delete rule> is specified and a row of4he referenced table that has not0reviously been marked for deletion is marked for deletion,4hen Case: a)!?f is not specified or if FULL is specified, 4hen Case: i)!?f the specifies CASCADE,4hen all matching rows are marked for deletion. Schema definition and manipulation (y])7 X0ß0¯0í0ó(g()92-154e¤BL CBR-002 .8!!referential constraint definition> ii) If4he!!delete rule> specifies SET NULL,4hen in all match- ing rows each referencing column is set4o the null6alue. iii) If4he!!delete rule> specifies SET DEFAULT, then in all matching rows each referencing column is set to4he default value specified in4he??eneral Rules of Subclause .5, "". b)!?f PARTIAL is specified, then Case: i) If4he!!delete rule> specifies CASCADE, then all5nique matching rows are marked for deletion. ii) If4he!!delete rule> specifies SET NULL,4hen in all5nique matching rows each referencing column is set to4he null 6alue. iii) If4he!!delete rule> specifies SET DEFAULT, then in all 5nique matching rows each referencing column is set to4he default6alue specified in the General Rules of Subclause .5, "". Note: Otherwise, the is not performed. 5 5) If an is specified and a non-null value of a ref- erenced column in the referenced4able is updated to a6alue 4hat is distinct from4he current6alue of that column,4hen Case: a)!?f is not specified or if FULL is specified, 4hen Case: i)!?f the specifies CASCADE,4hen in all match- ing rows the referencing column4hat corresponds with4he referenced column is5pdated4o the new value of4he refer- enced column. ii)!?f the specifies SET NULL, then Case: 1) If!!match type> is not specified, then in all matching rows4he referencing column that corresponds7ith the referenced column is set to4he null value. 2) If!!match type> specifies FULL, then in all matching rows each referencing column is set to4he null value. iii)!?f the specifies SET DEFAULT,4hen in all matching rows the referencing column4hat corresponds with the referenced column is set4o the default value specified (y])8 Database Language SQL X3H2-9(g()¬4/DBL CBR-00() .8!!referential constraint definition> in4he??eneral Rules of Subclause .5, "". b) If PARTIAL is specified,4hen Case: i)!?f the specifies CASCADE,4hen for each unique matching row that contains a non-null6alue in the referencing column C14hat corresponds with4he5pdated referenced column C2, C1 is updated to4he new6alue V of C(l4)0rovided that, in all5pdated rows in4he referenced 4able4hat formerly had, in4he same SQL-statement,4hat 5nique matching row as a matching row, the values in C2 have all been updated to a6alue4hat is not distinct from V. Otherwise, an exception condition is raised: triggered data change6iolation. Note: Because of4he Rules of Subclause 8.(l4) "", on7hich4he definition of "distinct" re- lies,4he6alues in C(N)may have been updated to6alues that are not distinct, yet are not identical. 2 2 2 2hich of these non-distinct values is used for4he cascade operation is implementation-dependent. ii)!?f the specifies SET NULL, then in all unique matching rows that contain a non-null value in4he ref- erencing column4hat corresponds with4he5pdated column, that referencing column is set4o the null6alue. iii) If4he!!update rule> specifies SET DEFAULT, then in all 5nique matching rows that contain a non-null value in4he referencing column4hat corresponds with4he5pdated col- 5mn, that referencing column is set4o the default value specified in the General Rules of Subclause 11.5, "". Note: Otherwise, the is not performed. 5 5 5) If any attempt is made7ithin an SQL-statement4o update some data item to a6alue4hat is distinct from4he6alue4o which that data item7as0reviously updated within4he same SQL- statement, then an exception condition is raised:4riggered data change6iolation. 8)!?f an!!update rule> attempts to5pdate a row that has been deleted by any!!delete statement: positioned> that identifies some cursor CR4hat is still open or5pdated by any 4hat identifies some cursor CR that is still open or if a!!delete rule> attempts to mark for deletion such a row,4hen a completion condition is raised: warning- cursor operation conflict. Schema definition and manipulation (y])9 X0ß0¯0í0ó(g()92-154e¤BL CBR-002 .8!!referential constraint definition> 9) All rows that are marked for deletion are effectively deleted at the end of4he SQL-statement, prior to4he checking of any integrity constraints. Leveling Rules 1) The following restrictions apply for!?ntermediate SQL: a) A!!references specification> shall not specify MATCH. b) A!!referential triggered action> shall not contain an!!update rule>. c) The order of4he column names in a!!reference column list> shall be the same as the order of column names of4he corre- sponding5nique constraint of the referenced4able. (SA) The following restrictions apply for Entry SQL in addition to any!?ntermediate SQL restrictions: a) A shall not contain a . 280 Database Language SQL X0ß0¯0í0ó(g()92-154e¤BL CBR-002 11.9 11.9 !!check constraint definition> Function Specify a condition for the SQL-data. Format !!check constraint definition> ::= CHECK!!left0aren> !!right paren> Syntax Rules 1) The shall not contain a!!target specifica- tion> or a!!dynamic parameter specification>. (SA) The!!search condition> shall not contain a 4hat is not contained in a . 0Î0Ã0È!?f is contained in a
or ,4hen let T be4he4able identified by4he containing
or . Case: a) If T is a persistent base table, or if4he!!check constraint definition> is contained in a!!domain definition> or , then no
generally con- 4ained in4he!!search condition> shall reference a temporary table. b)!?f T is a global temporary table,4hen no!!table reference> generally contained in the shall reference a4able other4han a global4emporary4able. c) If T is a created local temporary table,4hen no!!table ref- erence> generally contained in the shall reference a4able other4han either a global temporary table or a created local4emporary4able. d) If T is a declared local4emporary4able, then no
generally contained in4he!!search condition> shall reference a persistent base table. 2 2 2) If4he!!check constraint definition> is contained in a!!table definition> that defines a4emporary4able and specifies ON COMMIT PRESERVE ROWS or a that specifies ON COMMIT PRESERVE ROWS, then no in the shall reference a4emporary4able defined by a
or a that specifies ON COMMIT DELETE ROWS. Schema definition and manipulation (R´)1 X0ß0¯0í0ó(g()92-154e¤BL CBR-002 .9!!check constraint definition> 5) The!!search condition> shall not generally contain a or a!!value specification>4hat is CURRENT_USER, SESSION_USER, or SYSTEM_USER. 5 5) The shall not generally contain a!!query specification> or a 4hat is0ossibly non- deterministic. Access Rules 1) Let TN be any
referenced in4he!!search condition>. Case: a) If a!!column name> is contained in4he!!search condition>, 4hen the applicable0rivileges shall include REFERENCES for each of4he4able identified by TN contained in 4he!!search condition>. b) Otherwise, the applicable0rivileges shall include REFERENCES for at least one column of the table identified by TN. General Rules 1) A!!check constraint definition> defines a check constraint. Note: Subclause 10.6, " and ", specifies when a constraint is effectively checked. The General Rules that control4he evaluation of a check constraint can be found in either Subclause 11.6, "
", or Subclause 11.(h*), ""+"+ depending on whether it forms0art of a4able constraint or a domain constraint. (SA)!?f the character representation of the cannot be represented in the Information Schema7ithout4runcation, 4hen a completion condition is raised: warning-search condition 4oo long for information schema. Leveling Rules 1) The following restrictions apply for!?ntermediate SQL: a) The!!search condition> contained in a!!check constraint defi- nition> shall not contain a!!subquery>. b) The REFERENCES privilege is not required for access. (SA) The following restrictions apply for Entry SQL in addition to any!?ntermediate SQL restrictions: None. 282 Database Language SQL X0ß0¯0í0ó(g()92-154e¤BL CBR-002 .10 11.10 Function Change the definition of a table. Format ::= ALTER TABLE
!!alter table action> ::= !!add column definition> =!!alter column definition> =!!drop column definition> | | Syntax Rules 1) Let T be4he4able identified by4he!!table name>. 2) The schema identified by4he explicit or implicit schema name of 4he!!table name> shall include the descriptor of T. 2 2) The scope of4he!!table name> is4he entire . 2 2 2) T shall be a base table. 5) T shall not be a declared local temporary table. Access Rules 1) The current!!authorization identifier> shall be equal4o the 4hat owns4he schema identified by the of4he4able identified by!!table name>. ??eneral Rules 1) The base4able descriptor of T is modified as specified by!!al- ter table action>. Leveling Rules 1) The following restrictions apply for Intermediate SQL: None. 2) The following restrictions apply for Entry SQL in addition4o any Intermediate SQL restrictions: a) Conforming Entry SQL language shall not contain an . Schema definition and manipulation 283 X3H2-9(g()¬4/DBL CBR-00() 11.!!add column definition> .11 !!add column definition> Function Add a column4o a table. Format ::= ADD [ COLUMN ]!!column definition> Syntax Rules None. Access Rules None. ??eneral Rules 1) The column defined by the is added4o T. 2) Let C be4he column added to T. Every value in C is the default value for C. Note: The default value of a column is defined in Subclause .5, "". Note: The addition of a column to a4able has no effect on any existing!!query expression> included in a view descriptor or !!search condition> included in constraint descriptor because any implicit!!column reference>s in these clauses are replaced by explicit!!column reference>s7hen the clause is originally evaluated. See the Syntax Rules of Subclause 7.10, "". 0Î0Ã0È For every4able0rivilege descriptor that specifies T and a 0rivilege of SELECT, UPDATE, INSERT or REFERENCES, a new col- 5mn0rivilege descriptor is created4hat specifies T,4he same action, grantor, and grantee, and the same grantability, and specifies4he!!column name> of the . 2 2 2) In all other respects,4he specification of a in an has the same effect as specification of the in4he!!table defi- nition> for T would have had. In0articular,4he degree of T is increased by 1 and4he ordinal0osition of4hat column is equal to4he new degree of T as specified in4he??eneral Rules of Subclause .4, "". (R´)4 Database Language SQL X3H2-9(g()¬4/DBL CBR-00() 11.!!add column definition> Leveling Rules 1) The following restrictions apply for!?ntermediate SQL: None. (SA) The following restrictions apply for Entry SQL in addition to any!?ntermediate SQL restrictions: a) Conforming Entry SQL language shall not contain an!!add col- 5mn definition>. Schema definition and manipulation (R´)5 X0ß0¯0í0ó(g()92-154e¤BL CBR-002 .1(N) 11. Function Change a column and its definition. Format ::= ALTER [ COLUMN ]!!column name>!!alter column action> !!alter column action> ::= !!set column default clause> =!!drop column default clause> Syntax Rules 1) Let T be the table identified in the containing!!alter table statement>. (SA) Let C be the column identified by4he!!column name>. 0Î0Ã0È C shall be a column of T. Access Rules None. ??eneral Rules 1) The column descriptor of C is modified as specified by!!alter column action>. Leveling Rules 1) The following restrictions apply for!?ntermediate SQL: None. (SA) The following restrictions apply for Entry SQL in addition to any!?ntermediate SQL restrictions: a) Conforming Entry SQL language shall not contain an!!alter column definition>. (R´)6 Database Language SQL X3H2-9(g()¬4/DBL CBR-00() 11.ª!!set column default clause> .10µ0ó0Á0ü0à!!set column default clause> Function Set the default clause for a column. Format ::= SET Syntax Rules None. Access Rules None. ??eneral Rules 1) Let C be4he column identified by the in4he con- taining . 2) The default value specified by4he!!default clause> is0laced in 4he column descriptor of C. Leveling Rules 1) The following restrictions apply for Intermediate SQL: None. 2) The following restrictions apply for Entry SQL in addition4o any Intermediate SQL restrictions: a) Conforming Entry SQL language shall not contain a!!set column default clause>. Schema definition and manipulation 287 X3H2-9(g()¬4/DBL CBR-00() 11.!!drop column default clause> 11. Function Drop4he default clause from a column. Format ::= DROP DEFAULT Syntax Rules 1) Let C be the column identified by4he!!column name> in the con- 4aining!!alter column definition>. (SA) The descriptor of C shall include a default6alue. Access Rules None. General Rules 1) The default6alue is removed from4he column descriptor of C. Leveling Rules 1) The following restrictions apply for Intermediate SQL: None. 2) The following restrictions apply for Entry SQL in addition4o any Intermediate SQL restrictions: a) Conforming Entry SQL language shall not contain a!!drop col- umn default clause>. (R´)8 Database Language SQL X3H2-9(g()¬4/DBL CBR-00() .15 .15 !!drop column definition> Function Destroy a column. Format ::= DROP [ COLUMN ]!!column name>!!drop behavior> Syntax Rules 1) Let T be4he4able identified by4he!!table name> in4he con- taining and let TN be the name of T. 2) Let C be4he column identified by the CN. 0Î0Ã0È C shall be a column of T and C shall not be4he only column of T. 2 2 2) If RESTRICT is specified, then C shall not be referenced in the of any view descriptor or in the of any constraint descriptor other than a4able con- straint descriptor4hat contains references to no other column and4hat is included in4he4able descriptor of T. Note: A!!drop column definition> that does not specify CASCADE will fail if4here are any references to4hat column resulting from the use of CORRESPONDING, NATURAL, SELECT * (except where contained in an exists0redicate>), or REFERENCES without a in its!!referenced4able and columns>. Note: If CASCADE is specified,4hen any such dependent object will be dropped by4he execution of the spec- ified in the General Rules of4his Subclause. Access Rules None. ??eneral Rules 1) Let A be4he current!!authorization identifier>. The following !!revoke statement> is effectively executed with a current!!au- thorization identifier> of "_SYSTEM" and7ithout further Access Rule checking: REVOKE!?NSERT(CN), UPDATE(CN), REFERENCES(CN) ON TABLE TN FROM A CASCADE Schema definition and manipulation 289 X3H2-9(g()¬4/DBL CBR-00() 11.¬!!drop column definition> 2) Let VN be the name of any view4hat contains a reference4o column C of table T. The following!!drop6iew statement> is effectively executed7ith a current of "_SYSTEM" and without further Access Rule checking: DROP VIEW VN CASCADE 0Î0Ã0È!?f the column is not based on a domain,4hen its data4ype de- scriptor is destroyed. 2 2 2) The data associated with C is destroyed and the descriptor of C is removed from the descriptor of T. 5) The identified column and its descriptor are destroyed. 6) The degree of T is reduced by 1. The ordinal position of all columns having an ordinal position greater4han the ordinal position of C is reduced by 1. Leveling Rules 1) The following restrictions apply for Intermediate SQL: None. 2) The following restrictions apply for Entry SQL in addition4o any Intermediate SQL restrictions: a) Conforming Entry SQL language shall not contain a!!drop col- umn definition>. (Nã)0 Database Language SQL X3H2-9(g()¬4/DBL CBR-00() 11.­!!add table constraint definition> .16 !!add table constraint definition> Function Add a constraint4o a table. Format ::= ADD
Syntax Rules None. Access Rules None. General Rules 1) Let T be the table identified by the
in the con- 4aining!!alter table statement>. (SA) The4able constraint descriptor for4he!!table constraint defi- nition> is included in the table descriptor for T. Leveling Rules 1) The following restrictions apply for!?ntermediate SQL: None. (SA) The following restrictions apply for Entry SQL in addition to any!?ntermediate SQL restrictions: a) Conforming Entry SQL language shall not contain an!!add table constraint definition>. Schema definition and manipulation 291 X3H2-9(g()¬4/DBL CBR-00() 11.!!drop4able constraint definition> 11. Function Destroy a constraint on a table. Format ::= DROP CONSTRAINT!!constraint name>!!drop behavior> Syntax Rules 1) Let T be4he4able identified by4he!!table name> in4he con- taining . The schema identified by the explicit or implicit schema name of the
shall in- clude4he descriptor of T. (SA) The!!constraint name> shall identify a table constraint TC of T. 0Î0Ã0È!?f TC is a unique constraint and there exists a referential constraint RC7hose referenced table is T and7hose referenced columns are the unique columns of TC, then RC is said to be dependent on TC. 2 2 2) If RESTRICT is specified, then no table constraint shall be dependent on TC. Note: If CASCADE is specified,4hen any such dependent object will be dropped by4he effective execution of the specified in4he??eneral Rules of this Subclause. Access Rules None. General Rules 1) Let TCN(N)be4he!!constraint name> of any table constraint4hat is dependent on TC and let T(N)be4he!!table name> of4he4a- ble descriptor that includes TCN2. The following is effectively executed without further Access Rule checking: ALTER TABLE T(N)DROP CONSTRAINT TCN2 CASCADE 2) The descriptor of TC is removed from4he descriptor of T. 0Î0Ã0È The identified table constraint and its descriptor are de- stroyed. 292 Database Language SQL X0ß0¯0í0ó(g()92-154e¤BL CBR-002 11.!!drop4able constraint definition> Leveling Rules 1) The following restrictions apply for Intermediate SQL: None. 2) The following restrictions apply for Entry SQL in addition4o any Intermediate SQL restrictions: a) Conforming Entry SQL language shall not contain a!!drop4able constraint definition>. Schema definition and manipulation 293 X3H2-9(g()¬4/DBL CBR-00() 11.!!drop4able statement> 11. Function Destroy a table. Format ::= DROP TABLE
!!drop behavior> Syntax Rules 1) Let T be4he4able identified by4he!!table name> and let TN be that!!table name>. The schema identified by the explicit or implicit schema name of TN shall include4he descriptor of T. (SA) T shall be a base4able. 0Î0Ã0È T shall not be a declared local4emporary4able. 4)!?f RESTRICT is specified,4hen T shall not be referenced in 4he!!query expression> of any6iew descriptor or the of any constraint descriptor. Note: If CASCADE is specified,4hen such referencing objects 7ill be dropped by the execution of4he!!revoke statement> spec- ified in4he??eneral Rules of this Subclause. Access Rules 1) The current shall be equal to4he !!authorization identifier> that owns the schema identified by 4he!!schema name> of the table identified by TN. General Rules 1) Let A be the current . The following is effectively executed7ith a current of "_SYSTEM" and without further Access Rule checking: REVOKE ALL PRIVILEGES ON TN FROM A CASCADE (SA) The identified base4able and its descriptor are destroyed. Leveling Rules 1) The following restrictions apply for Intermediate SQL: None. (Nã)4 Database Language SQL X3H2-9(g()¬4/DBL CBR-00() .18 (SA) The following restrictions apply for Entry SQL in addition to any!?ntermediate SQL restrictions: a) Conforming Entry SQL language shall not contain any . Schema definition and manipulation (Nã)5 X0ß0¯0í0ó(g()92-154e¤BL CBR-002 .19 11. Function Define a viewed4able. Format !!view definition> ::= CREATE VIEW!!table name> [ !!view column list> ] AS!!query expression> [ WITH [!!levels clause> ] CHECK OPTION ] ::= CASCADED= LOCAL !!view column list> ::= Syntax Rules 1) The shall not contain a!!target specifica- tion> or a!!dynamic parameter specification>. (SA)!?f a is contained in a and the
contains a ,4hen that!!schema name> shall be the same as the specified or implicit of4he containing . 2 2) The schema identified by4he explicit or implicit schema name of4he!!table name> shall not include a table descriptor7hose 4able name is!!table name>. 2 2 2) The viewed4able defined by shall not be identified by any!!table reference> generally contained in the . 5) Any!!table name> that is specified in4he!!query expression> shall be different from the
of any . 5 5) If4he!!query expression> is5pdatable, then4he6iewed table is an updatable table. Otherwise, it is a read-anly table. 5 5 5) If4he!!query expression> is a!!query specification>4hat con- 4ains a!!group by clause> or a that is not con- 4ained in a!!subquery>,4hen the viewed4able defined by the is a grouped6iew. 8) If any4wo columns in the table specified by4he!!query ex- pression> have4he same , or if any column of4hat table has an implementation-dependent name, then a!!view column list> shall be specified. (Nã)6 Database Language SQL X3H2-9(g()¬4/DBL CBR-00() 11.!!view definition> 9) The same shall not be specified more than once in 4he!!view column list>. 10)The number of s in the shall be the same as the degree of the table specified by4he!!query expression>. 11)No column in4he4able specified by shall have a coercibility attribute of No collating sequence. Note: The coercibility attribute is described in Subclause 2 2 2.2.3, "Rules determining collating sequence usage". Note: The coercibility attribute for references4o the column is defined in Subclause 5 5.4, "". )If WITH CHECK OPTION is specified, then4he6iewed table shall be5pdatable. ª)If WITH CHECK OPTION is specified7ith no!!levels clause>, then a!!levels clause> of CASCADED is implicit. )Let V be the view defined by the . The5n- derlying columns of every i-th column of V are the underlying columns of the i-th column of4he!!query expression> and the underlying columns of V are the underlying columns of the . Access Rules 1) If a!!view definition> is contained in a!!module>,4hen the current shall be equal to4he!!au- thorization identifier> that owns the schema identified by4he implicit or explicit of4he!!table name>. ??eneral Rules 1) A view descriptor VD is created that describes V. The view de- scriptor includes4he!!table name>,4he!!query expression>, column descriptors taken from4he4able specified by the , and an indication of7hether 2 2 2 2ITH CHECK OPTION7as specified. If a!!view column list> is specified, then4he!!col- 5mn name> of the i-th column of4he6iew is4he i-th in4hat . Otherwise,4he!!column name>s of4he6iew are the s of the table specified by4he !!query expression>. 2) Let VN be the
. Let QE be the . If a!!view column list> is specified, then let VCL be the 0receded by a!!left0aren> and followed by a ; otherwise, let VCL be4he empty string. Case: a) When VN is immediately contained in some SQL-schema state- ment, it identifies4he6iew descriptor VD. Schema definition and manipulation 297 X3H2-9(g()¬4/DBL CBR-00() 11.!!view definition> b) Otherwise, VN references4he same table as4he!!table refer- ence>: ( QE ) AS VN VCL 2 2) Let A be4he!!authorization identifier> that owns V. 2 2 2) A set of0rivilege descriptors is created that defines4he0riv- ilege SELECT on4his table to A and SELECT for each column of V4o A. This privilege is grantable if and only if the appli- cable SELECT privileges on all
s contained in4he !!query expression> are grantable. The grantor of this0rivilege descriptor is set4o the special grantor value "_SYSTEM". 5) If V is updatable,4hen let T be4he leaf underlying4able of the . 6) For i ranging from 1 to4he number of distinct leaf5nderlying tables of the of V, let RTi be the
s of4hose4ables. For every column CV of V: a) Let CRij, for j ranging from 1 to4he number of columns of RTi that are5nderlying columns of CV, be the s of those columns. b)!?f A has REFERENCES(CRij) for all i and for all j, and A has REFERENCES on some column of RTi for all i, then a0rivilege descriptor is created4hat defines the privilege REFERENCES (CV) on V4o A. That privilege is grantable if and only if the REFERENCES0rivileges on all of the columns CRTij are grantable. The grantor of that0rivilege descriptor is set4o the special grantor value "_SYSTEM". 5 5 5) If V is updatable,4hen: a) A set of privilege descriptors is created4hat defines the privileges!?NSERT, UPDATE, and DELETE on V4hat are appli- cable0rivileges on T4o A. A0rivilege on V is grantable if and only if the corresponding privilege on T is grantable. b) For every column in V: i) There is a corresponding column in T from which the column of V is derived. Let CV and CT be the s of the corresponding columns of V and T respectively. ii) A set of0rivilege descriptors is created that defines the privileges!?NSERT(CV) and UPDATE(CV) on V,7here4he privileges!?NSERT(CT) and UPDATE(CT) on T are the appli- cable privileges4o A, respectively. A0rivilege on V is grantable if and only if4he corresponding0rivilege on T is grantable. The grantor of4hese0rivilege descriptors is set to4he special grantor6alue "_SYSTEM". (Nã)8 Database Language SQL X3H2-9(g()¬4/DBL CBR-00() 11.!!view definition> 8)!?f V is5pdatable, then let TLEAF be the leaf generally5nder- lying table of V. For every row in V4here is a corresponding row in TLEAF from which the row of V is derived and for each column in V4here is a corresponding column in TLEAF from7hich 4he column of V is derived. The insertion of a row into V is an insertion of a corresponding row into TLEAF. The deletion of a row from V is a deletion of the corresponding row in TLEAF. The updating of a column of a row in V is an5pdating of4he corresponding column of4he corresponding row in TLEAF. 9) Let V1 be a view. V1 spans V1. V1 spans a view V(N)if V(N)is a generally5nderlying table of V1. 10)An5pdate operation is an , , , , or!!preparable dynamic5pdate state- ment:0ositioned>. An5pdate operation on a6iew V is an update operation7hose!!table name> identifies V. )If a view V1 spans a view VA described by a6iew descriptor4hat includes 2 2 2 2ITH CHECK OPTION and an update operation on V17ould result in a row4hat would not appear in the result of VA, then a)!?f the view descriptor of VA includes CASCADED,4hen an ex- ception condition is raised: with check option violation. b)!?f the view descriptor of VA includes LOCAL and4he5pdate operation would result in a row that7ould appear in4he simply underlying4able of the simply5nderlying table of 4he!!query expression> contained in VA,4hen an exception condition is raised: with check option violation. 1(SA)Validation of a WITH CHECK OPTION constraint is effectively performed at4he end of each5pdate operation. 10Î0Ã0ÈIf4he character representation of4he!!query expression> cannot be represented in4he!?nformation Schema without truncation, then a completion condition is raised:7arning-query expression too long for information schema. Leveling Rules 1) The following restrictions apply for Intermediate SQL: a) Conforming!?ntermediate SQL language shall not contain any !!levels clause>, but the effect shall be that defined for a !!levels clause> of CASCADED. (SA) The following restrictions apply for Entry SQL in addition to any!?ntermediate SQL restrictions: a) The in a shall be a !!query specification>. Schema definition and manipulation (Nã)9 X0ß0¯0í0ó(g()92-154e¤BL CBR-002 .20 11.(eå) Function Destroy a6iew. Format ::= DROP VIEW
!!drop behavior> Syntax Rules 1) Let V be4he4able identified by4he!!table name> and let VN be that!!table name>. The schema identified by the explicit or implicit schema name of VN shall include4he descriptor of V. (SA) V shall be a viewed4able. 0Î0Ã0È!?f RESTRICT is specified,4hen V shall not be referenced in 4he!!query expression> of any6iew descriptor or the of any assertion descriptor or constraint descriptor. Note: If CASCADE is specified,4hen any such dependent object will be dropped by4he execution of the spec- ified in the General Rules of4his Subclause. Access Rules 1) The current!!authorization identifier> shall be equal4o the 4hat owns4he schema identified by the of4he4able identified by VN. ??eneral Rules 1) Let A be4he current!!authorization identifier>. The following !!revoke statement> is effectively executed with a current!!au- thorization identifier> of "_SYSTEM" and7ithout further Access Rule checking: REVOKE ALL PRIVILEGES ON VN FROM A CASCADE 2) The identified6iew and its descriptor are destroyed. Leveling Rules 1) The following restrictions apply for!?ntermediate SQL: None. (SA) The following restrictions apply for Entry SQL in addition to any!?ntermediate SQL restrictions: a) Conforming Entry SQL language shall not contain a . 2 200 Database Language SQL X0ß0¯0í0ó(g()92-154e¤BL CBR-002 .21 11.(h*) Function Define a domain. Format !!domain definition> ::= CREATE DOMAIN!!domain name> [ AS ] [ ] [!!domain constraint>... ] [ ] !!domain constraint> ::= [!!constraint name definition> ] [ ] Syntax Rules 1)!?f a is contained in a , and if the contains a!!schema name>, then4hat shall be4he same as4he specified or implicit !!schema name> of the containing!!schema definition>. The schema identified by4he explicit or implicit schema name of4he!!do- main name> shall not include a domain descriptor7hose domain name is . 2) If!!data4ype> specifies CHARACTER or CHARACTER VARYING and does not specify!!character set specification>, then4he character set name of4he default character set of the schema identified by4he implicit or explicit of!!domain name> is implicit. 0Î0Ã0È!?f specifies a that identi- fies a character set that has a default collation and4he!!do- main definition> does not directly contain a!!collate clause>, 4hen the collation of4he!!character string4ype> is the im- plicit collation of the domain. 4) Let D1 be some domain. D1 is in5sage by a domain constraint DC if and only if the of DC generally contains the either of D1 or of some domain D(N)such4hat D1 is in5sage by some domain constraint of D2. No domain shall be in usage by any of its own constraints. 5) If!!collate clause> is specified, then!!data4ype> shall be a character string4ype. 5 5) for every is specified: a) If!!constraint attributes> is not specified,4hen INITIALLY IMMEDIATE NOT DEFERRABLE is implicit. Schema definition and manipulation 0Ô0³1 X0ß0¯0í0ó(g()92-154e¤BL CBR-002 .21 b)!?f is not specified,4hen a 4hat contains an implementation- dependent is implicit. The assigned shall obey4he Syntax Rules of an explicit !!constraint name>. Access Rules 1) If a!!domain definition> is contained in a!!module>,4hen the current shall be equal to4he!!au- thorization identifier> that owns the schema identified by4he implicit or explicit of4he!!domain name>. General Rules 1) A!!domain definition> defines a domain. Note: Subclause 10.6, " and ", specifies when a constraint is effectively checked. (SA) A data type descriptor is created4hat describes the data4ype of4he domain being created. 2 2) A domain descriptor is created4hat describes the domain being created. The domain descriptor contains4he name of4he domain, 4he data type descriptor of4he data type, the of the if the contains a!!collate clause>,4he6alue of the if the immediately contains!!default clause>, and a domain constraint descriptor for every immediately contained . 2 2 2) A privilege descriptor is created that defines4he USAGE0riv- ilege on this domain to4he!!authorization identifier> of4he !!schema> or!!module> in7hich4he!!domain definition> appears. This0rivilege is grantable if and only if4he applicable privi- leges include a grantable REFERENCES privilege for each!!column reference> included in the domain descriptor and a grantable USAGE privilege for each!!domain name>, , , and contained in the of any domain constraint descriptor included in4he domain descriptor, and a grantable USAGE privilege for the contained in the included in4he domain descriptor. The grantor of4he0rivilege descriptor is set4o the special grantor value "_SYSTEM". 5) Let DSC be4he!!search condition> included in some domain con- straint descriptor DCD. Let D be the name of the domain7hose descriptor includes DCD. Let T be4he name of some table whose descriptor includes some column descriptor7ith column name C whose domain name is D. Let CSC be a copy of DSC in which every instance of the VALUE is replaced by C. 0Ô0³(N) Database Language SQL X3H2-9(g()¬4/DBL CBR-00() 11.(h*)!!domain definition> 6) The domain constraint specified by DCD for C is not satisfied if and only if EXISTS ( SELECT * FROM T WHERE NOT ( CSC ) ) is true. Leveling Rules 1) The following restrictions apply for!?ntermediate SQL: a) Conforming Intermediate SQL language shall not contain any . (SA) The following restrictions apply for Entry SQL in addition to any!?ntermediate SQL restrictions: a) Conforming Entry SQL language shall not contain any . Schema definition and manipulation 2 203 X3H2-9(g()¬4/DBL CBR-00() 11.(g )!!alter domain statement> 11.(g ) Function Change a domain and its definition. Format !!alter domain statement> ::= ALTER DOMAIN!!domain name>!!alter domain action> !!alter domain action> ::= !!set domain default clause> =!!drop domain default clause> | =!!drop domain constraint definition> Syntax Rules 1) Let D be4he domain identified by . The schema identified by the explicit or implicit schema name of the shall include the descriptor of D. Access Rules 1) The current!!authorization identifier> shall be equal4o the 4hat owns4he schema identified by the implicit or explicit!!schema name> of . ??eneral Rules 1) The domain descriptor of D is modified as specified by!!alter domain action>. Note: The changed domain descriptor of D is applicable to every column that is dependent on D. Leveling Rules 1) The following restrictions apply for!?ntermediate SQL: a) Conforming Intermediate SQL language shall contain no!!alter domain statement>. 2) The following restrictions apply for Entry SQL in addition4o any Intermediate SQL restrictions: None. 0Ô0³4 Database Language SQL X3H2-9(g()¬4/DBL CBR-00() 11.(y>)!!set domain default clause> .20µ0ó0Á0ü0à!!set domain default clause> Function Set the default value in a domain. Format ::= SET Syntax Rules None. Access Rules None. ??eneral Rules 1) Let D be4he domain identified by the in4he con- taining . (SA) The default6alue specified by the is placed in the domain descriptor of D. Leveling Rules 1) The following restrictions apply for!?ntermediate SQL: a) Conforming Intermediate SQL language shall contain no!!set domain default clause>. (SA) The following restrictions apply for Entry SQL in addition to any!?ntermediate SQL restrictions: None. Schema definition and manipulation 2 205 X3H2-9(g()¬4/DBL CBR-00() 11.(T )!!drop domain default clause> 11.(T ) Function Remove4he default clause of a domain. Format ::= DROP DEFAULT Syntax Rules 1) Let D be the domain identified by4he!!domain name> in the con- 4aining!!alter domain statement>. 2) The descriptor of D shall contain a default value. Access Rules None. ??eneral Rules 1) Let C be4he set of columns whose column descriptors contain4he domain descriptor of D. 2) For every column belonging4o C, if the column descriptor does not already contain a default6alue, then4he default6alue from the domain descriptor of D is placed in that column descriptor. 0Î0Ã0È The default6alue is removed from4he domain descriptor of D. Leveling Rules 1) The following restrictions apply for Intermediate SQL: a) Conforming!?ntermediate SQL language shall contain no . (SA) The following restrictions apply for Entry SQL in addition to any!?ntermediate SQL restrictions: None. 0Ô0³6 Database Language SQL X3H2-9(g()¬4/DBL CBR-00() .25 .25 !!add domain constraint definition> Function Add a constraint to a domain. Format ::= ADD!!domain constraint> Syntax Rules 1) Let D be4he domain identified by the in4he con- taining . (SA) Let D1 be some domain. D1 is in5sage by a domain constraint DC if and only if the of DC generally contains the either of D1 or of some domain D(N)such4hat D1 is in5sage by some domain constraint of D2. No domain shall be in usage by any of its own constraints. Access Rules None. ??eneral Rules 1) The constraint descriptor of4he!!domain constraint> is added to 4he domain descriptor of D. Leveling Rules 1) The following restrictions apply for Intermediate SQL: a) Conforming!?ntermediate SQL language shall contain no . (SA) The following restrictions apply for Entry SQL in addition to any!?ntermediate SQL restrictions: None. Schema definition and manipulation 2 207 X3H2-9(g()¬4/DBL CBR-00() 11.(Œ¡)!!drop domain constraint definition> .26 !!drop domain constraint definition> Function Destroy a constraint on a domain. Format !!drop domain constraint definition> ::= DROP CONSTRAINT!!constraint name> Syntax Rules 1) Let D be4he domain identified by the in4he con- taining . (SA) Let DC be4he descriptor of4he constraint identified by . 2 2) DC shall be included in the domain descriptor of D. Access Rules None. General Rules 1) The constraint descriptor of DC is removed from4he domain de- scriptor of D. 2) The constraint DC and its descriptor are destroyed. Leveling Rules 1) The following restrictions apply for!?ntermediate SQL: a) Conforming Intermediate SQL language shall contain no!!drop domain constraint definition>. (SA) The following restrictions apply for Entry SQL in addition to any!?ntermediate SQL restrictions: None. 0Ô0³8 Database Language SQL X3H2-9(g()¬4/DBL CBR-00() 11.(y])!!drop domain statement> .27 !!drop domain statement> Function Destroy a domain. Format !!drop domain statement> ::= DROP DOMAIN!!domain name>!!drop behavior> Syntax Rules 1) Let D be4he domain identified by and let DN be that!!domain name>. The schema identified by4he explicit or implicit schema name of DN shall include the descriptor of D. 2) If RESTRICT is specified, then D shall not be referenced by any column descriptor, in the of any view descriptor, or in4he!!search condition> of any constraint de- scriptor. Access Rules 1) The current shall be equal to4he !!authorization identifier> that owns the schema identified by 4he!!schema name> of the domain identified by DN. Let UA be4he !!authorization identifier> of4he current SQL-session. General Rules 1) Let C be any column descriptor that includes DN, let T be4he 4able described by the table descriptor4hat includes C, and let TN be the column name of T. C is modified as follows: a) DN is removed from C. A copy of the data4ype descriptor of D is included in C. b) If C does not include a and4he domain de- scriptor of D includes a!!default clause>,4hen a copy of the of D is included in C. c) For every domain constraint descriptor included in4he domain descriptor of D: i) Let TCD be a
consisting of a!!constraint name definition> whose is implementation-dependent, whose
is derived from the of4he do- main constraint descriptor by replacing every instance of VALUE by the of C, and whose are4he!!constraint attributes> of the domain constraint descriptor. Schema definition and manipulation 2 2SD X3H2-9(g()¬4/DBL CBR-00() 11.(y])!!drop domain statement> ii) If4he applicable privileges of UA include all of the priv- ileges necessary for UA4o successfully execute4he!!add 4able constraint definition> ALTER TABLE TN ADD TCD 4hen the following
is effec- 4ively executed7ith a current of UA: ALTER TABLE TN ADD TCD d) If C does not include a collation and the of D includes a collation,4hen i) Let CCN be4he!!collation name> of4he collation. ii) If4he applicable privileges for UA contain USAGE on CCN, 4hen CCN is added4o C as4he!!collation name>. 2) Let A be4he current!!authorization identifier>. The following !!revoke statement> is effectively executed with a current!!au- thorization identifier> of "_SYSTEM" and7ithout further Access Rule checking: REVOKE USAGE ON DOMAIN DN FROM A CASCADE 2 2) The identified domain is destroyed by destroying its descriptor and its data4ype descriptor. Leveling Rules 1) The following restrictions apply for!?ntermediate SQL: None. (SA) The following restrictions apply for Entry SQL in addition to any!?ntermediate SQL restrictions: a) Conforming Entry SQL language shall not contain a . 2 210 Database Language SQL X0ß0¯0í0ó(g()92-154e¤BL CBR-002 11.(R´)!!character set definition> 11.(R´) Function Define a character set. Format !!character set definition> ::= CREATE CHARACTER SET!!character set name> [ AS ] !!character set source> [ =!!limited collation definition> ] ::= ??ET!!existing character set name> !!existing character set name> ::= !!standard character repertoire name> | =!!schema character set name> !!schema character set name> ::=!!character set name> ::= COLLATION FROM Syntax Rules 1) If a!!character set definition> is contained in a and if4he!!character set name> immediately contained in4he!!character set definition> contains a!!schema name>, then4hat shall be4he same as4he specified or implicit!!schema name> of the . 2) The schema identified by4he explicit or implicit schema name of4he!!character set name> shall not include a character set descriptor7hose character set name is!!character set name>. 2 2) A shall identify some character set descriptor. 4)!?f neither nor!!limited collation definition> is specified, then4he following!!limited collation definition> is implicit: COLLATION FROM DEFAULT Schema definition and manipulation 2 2 X3H2-9(g()¬4/DBL CBR-00() 11.(R´)!!character set definition> Access Rules 1)!?f a is contained in a!!module>,4hen the current shall be equal to4he !!authorization identifier> that owns the schema identified by 4he implicit or explicit of4he!!character set name>. 2) The applicable0rivileges for the shall include USAGE. ??eneral Rules 1) A defines a character set. (SA) A character set descriptor is created for4he defined character set. 0Î0Ã0È The character set has4he same character repertoire as the char- acter set identified by the . 2 2 2) A privilege descriptor is created that defines4he USAGE0rivi- lege on this character set4o the of the schema or in which the appears. The grantor of4he0rivilege descriptor is set4o the special grantor value "_SYSTEM". This privilege is grantable. Leveling Rules 1) The following restrictions apply for!?ntermediate SQL: a)!?n conforming!?ntermediate SQL language, shall specify DEFAULT. (SA) The following restrictions apply for Entry SQL in addition to any!?ntermediate SQL restrictions: a) Conforming Entry SQL language shall not specify a . 0Ó0ë(N) Database Language SQL X3H2-9(g()¬4/DBL CBR-00() .29 .29 !!drop character set statement> Function Destroy a character set. Format !!drop character set statement> ::= DROP CHARACTER SET!!character set name> Syntax Rules 1) Let C be the character set identified by the and let CN be4he name of C. (SA) The schema identified by the explicit or implicit schema name of CN shall include4he descriptor of C. 0Î0Ã0È C shall not be referenced in the of any view descriptor or in the of any constraint de- scriptor, or be included in any collation descriptor or4ransla- tion descriptor. Access Rules 1) The current!!authorization identifier> shall be equal4o the 4hat owns4he schema identified by the of4he character set identified by C. General Rules 1) Let A be the current . The following is effectively executed7ith a current of "_SYSTEM" and without further Access Rule checking: REVOKE USAGE ON CHARACTER SET CN FROM A CASCADE 2) The descriptor of C is destroyed. Leveling Rules 1) The following restrictions apply for!?ntermediate SQL: None. (SA) The following restrictions apply for Entry SQL in addition to any!?ntermediate SQL restrictions: a) Conforming Entry SQL language shall contain no!!drop charac- 4er set statement>. Schema definition and manipulation 2 2ª X3H2-9(g()¬4/DBL CBR-00() 11.0Ô0³!!collation definition> 11.0Ô0³ Function Define a collating sequence. Format ::= CREATE COLLATION FOR!!character set specification> FROM!!collation source> [ ] ::= NO PAD = PAD SPACE !!collation source> ::= | ::= =!!schema collation name> = DESC !!collation name> | DEFAULT ::= TRANSLATION [ THEN COLLATION ] !!external collation> ::= EXTERNAL!!left0aren> !!schema collation name> ::=!!collation name> ::= | ::= !!implementation-defined collation name> ::=!!collation name> 0Ó0ë4 Database Language SQL X3H2-9(g()¬4/DBL CBR-00() .30 Syntax Rules 1) If a!!collation definition> is contained in a and if4he!!collation name> immediately contained in 4he!!collation definition> contains a!!schema name>, then4hat shall be4he same as4he specified or implicit !!schema name> of the . 2) The schema identified by4he explicit or implicit schema name of4he!!collation name> shall not include a collation descriptor 7hose collation name is!!collation name>. 2 2) A shall be4he name of a colla- tion defined by a national or international standard. An !!implementation-defined collation name> shall be the name of a collation that is implementation-defined. 4) The!!standard collation name>s and s4hat are supported are implementation-defined. Each collation identified by a!!standard collation name> or by a!!implementation-defined collation name> shall have associated 7ith it a0rivilege descriptor that7as effectively defined by the ??RANT USAGE ON COLLATION COLL TO PUBLIC where COLL is the or!!implementation- defined collation name>. 5) A collating sequence specified by or !!schema collation name> shall be a collating sequence4hat is defined for4he character repertoire of4he character set7ith which the is associated. 6) A!!schema collation name> shall be the name of a collating se- quence4hat is defined in the schema identified by4he explicit or implicit . 5 5 5) If a!!collation definition> does not specify!!pad attribute>, then Case: a) If a!!collating sequence definition> is specified that con- tains a 4hat identifies a collation for 7hich4he!!collation definition> specifies NO PAD, then NO PAD is implicit. b) Otherwise, PAD SPACE is implicit. 8) If NO PAD is specified, then4he collation is said4o have4he NO PAD attribute.!?f PAD SPACE is specified, then4he collation is said4o have4he PAD SPACE attribute. Schema definition and manipulation 0Ó0ë5 X0ß0¯0í0ó(g()92-154e¤BL CBR-002 .30 9)!?f is specified, then let T be the translation named by!!translation name>. Let C1 be4he colla- tion being defined by the . The source character set of T shall be4he same as4he character set of C1. 10)If THEN COLLATION!!collation name> is specified, then let C(N)be 4he collation named by in THEN COLLATION!!col- lation name>. The4arget character set of T shall be identical to4he character set of C2. Access Rules 1) If a!!collation definition> is contained in a , then 4he current!!authorization identifier> shall be equal4o the 4hat owns4he schema identified by the implicit or explicit!!schema name> of the . (SA) Let C be a collation identified by any con- tained in . The applicable0rivileges shall include USAGE on C. 0Î0Ã0È!?f is specified,4hen the applicable0rivi- leges shall include USAGE. ??eneral Rules 1) A defines a collating sequence. 2) DEFAULT specifies that4he collation is to be performed us- ing the order of characters as4hey appear in the character repertoire. 0Î0Ã0È!?f DESC is specified,4hen the collation is4he reverse of that specified by . 4) A0rivilege descriptor is created4hat defines the USAGE priv- ilege on4his collation to4he current!!authorization identi- fier>. The grantor of the privilege descriptor is set to4he special grantor6alue "_SYSTEM". 5) This privilege descriptor is grantable if and only if4he USAGE 0rivilege for4he current!!authorization identifier> on4he !!character set name> contained in4he!!collation definition> is also grantable and if4he USAGE0rivilege for4he current !!authorization identifier> on4he!!translation name> contained in4he!!translation collation>, if0resent, is also grantable. 5 5) If!!translation collation> is specified,4hen Case: a)!?f THEN COLLATION!!collation name> is specified, then let C(N)be4he collating sequence named by4he!!collation name> in THEN COLLATION . The collating sequence defined is obtained by effectively translating a character 0Ó0ë6 Database Language SQL X3H2-9(g()¬4/DBL CBR-00() .30 string using T,4hen applying4he collating sequence of C(N)to 4he result. b) Otherwise, the collating sequence defined is obtained by ef- fectively translating a character string5sing T, then apply- ing the default collating sequence for4he4arget character set of T. 7)!?f is specified,4hen the collating se- quence defined is that given by: a)!?f is specified, then4he national or international standard collation. b) Otherwise, the implementation-defined collation. 8) A collation descriptor is created for4he defined collation. Leveling Rules 1) The following restrictions apply for!?ntermediate SQL: a) Conforming Intermediate SQL language shall not contain any . (SA) The following restrictions apply for Entry SQL in addition to any!?ntermediate SQL restrictions: None. Schema definition and manipulation 2 2 X3H2-9(g()¬4/DBL CBR-00() 11.0Ó0ë!!drop collation statement> 11.0Ó0ë Function Destroy a collating sequence. Format !!drop collation statement> ::= DROP COLLATION!!collation name> Syntax Rules 1) Let C be the collating sequence identified by4he!!collation name> and let CN be the name of C. 2) The schema identified by4he explicit or implicit schema name of CN shall include the descriptor of C. Access Rules 1) The current!!authorization identifier> shall be equal4o the 4hat owns4he schema identified by the of4he collating sequence identified by C. ??eneral Rules 1) Let A be4he current!!authorization identifier>. The following !!revoke statement> is effectively executed with a current!!au- thorization identifier> of "_SYSTEM" and7ithout further Access Rule checking: REVOKE USAGE ON COLLATION CN FROM A CASCADE (SA) Let CD be any collation descriptor that includes CN. CD is modi- fied by deleting any occurrences of "THEN COLLATION CN" or "DESC (CN)" 2 2) Let CSD be any character set descriptor that includes CN. CSD is modified by deleting any occurrences of "COLLATION FROM CN" or "DESC (CN)". 2 2 2) Let DD be any column descriptor or domain descriptor4hat includes CN. DD is modified by deleting any occurrences of "COLLATE CN". 5) Let VD be any view descriptor whose includes "COLLATE CN" or any constraint descriptor whose includes "COLLATE CN". VD is modified by deleting any occurrences of "COLLATE CN". 6) The descriptor of C is destroyed. 2 2 Database Language SQL X0ß0¯0í0ó(g()92-154e¤BL CBR-002 11.0Ó0ë!!drop collation statement> Leveling Rules 1) The following restrictions apply for Intermediate SQL: a) Conforming!?ntermediate SQL language shall not contain any !!drop collation statement>. 2) The following restrictions apply for Entry SQL in addition4o any Intermediate SQL restrictions: None. Schema definition and manipulation 0Ó0ë9 X0ß0¯0í0ó(g()92-154e¤BL CBR-002 .3(N) .3(N)!!translation definition> Function Define a character translation. Format ::= CREATE TRANSLATION FOR!!source character set specification> TO!!target character set specification> FROM!!translation source> ::=!!character set specification> ::=!!character set specification> ::= !!translation specification> !!translation specification> ::= !!external4ranslation> | IDENTITY =!!schema4ranslation name> !!external4ranslation> ::= EXTERNAL!!left0aren> !!external4ranslation name> ::= !!standard4ranslation name> =!!implementation-defined4ranslation name> !!standard4ranslation name> ::=!!translation name> ::= !!schema4ranslation name> ::=!!translation name> Syntax Rules 1)!?f a is contained in a!!schema defi- nition> and if the immediately contained in the contains a ,4hen that !!schema name> shall be the same as the specified or implicit of4he!!schema definition>. 2 2(eå) Database Language SQL X0ß0¯0í0ó(g()92-154e¤BL CBR-002 11.0Õ0¡0é0Ã0É!!translation definition> 2) The schema identified by4he explicit or implicit schema name of 4he!!translation name> shall not include a translation descrip- 4or7hose4ranslation name is!!translation name>. 2 2) A shall be4he name of a4rans- lation defined by a national or international standard. An !!implementation-defined4ranslation name> shall be the name of a translation that is implementation-defined. 4) The!!standard4ranslation name>s and s4hat are supported are implementation- defined. Each translation identified by a or by a shall have associated with it a privilege descriptor4hat was effectively defined by4he!!grant statement> GRANT USAGE ON TRANSLATION TRANS TO PUBLIC where TRANS is4he!!standard4ranslation name> or . 5) A!!schema4ranslation name> shall identify a translation de- scriptor. Access Rules 1) If a!!translation definition> is contained in a , then 4he current!!authorization identifier> shall be equal4o the 4hat owns4he schema identified by the implicit or explicit!!schema name> of the . (SA)!?f is specified, then4he applicable privileges shall include USAGE. General Rules 1) A!!translation definition> defines a translation. 2) IDENTITY specifies a4ranslation4hat makes no changes4o the characters. 0Î0Ã0È A4ranslation descriptor is created for4he defined4ranslation. 4) A0rivilege descriptor PD is created that defines4he USAGE 0rivilege on this4ranslation4o the of the schema or in which the appears. The grantor of4he0rivilege descriptor is set4o the special grantor value "_SYSTEM". 5) PD is grantable if and only if4he USAGE0rivilege for4he!!au- thorization identifier> of4he schema or!!module> in7hich4he !!translation definition> appears is also grantable on every !!character set name> contained in4he!!translation definition>. Schema definition and manipulation 2 2(h*) X3H2-9(g()¬4/DBL CBR-00() 11.0Õ0¡0é0Ã0É!!translation definition> Leveling Rules 1) The following restrictions apply for Intermediate SQL: a) Conforming!?ntermediate SQL language shall contain no . (SA) The following restrictions apply for Entry SQL in addition to any!?ntermediate SQL restrictions: None. 2 2(g ) Database Language SQL X0ß0¯0í0ó(g()92-154e¤BL CBR-002 11.0Õ0£0ü0È!!drop4ranslation statement> 11.0Õ0£0ü0È Function Destroy a character translation. Format ::= DROP TRANSLATION Syntax Rules 1) Let T be4he4ranslation identified by4he!!translation name> and let TN be the name of T. 2) The schema identified by4he explicit or implicit schema name of TN shall include the descriptor of T. 2 2) T shall not be referenced in4he!!query expression> included in any view descriptor or in the included in any constraint descriptor or be included in any collation descriptor. Access Rules 1) The current!!authorization identifier> shall be equal4o the 4hat owns4he schema identified by the of4he4ranslation identified by T. General Rules 1) Let CD be any collation descriptor that includes a TRANSLATION TN. CD is modified by deleting4hat . 2) Let CSD be any!!character set definition> that references T. CSD is modified by deleting any occurrences of a that contains TN. 0Î0Ã0È Let A be the current . The following is effectively executed7ith a current of "_SYSTEM" and without further Access Rule checking: REVOKE USAGE ON TRANSLATION TN FROM A CASCADE 2 2 2) The descriptor of T is destroyed. Schema definition and manipulation 0Õ0¡0é0Ã0É0ª0ü0à X0ß0¯0í0ó(g()92-154e¤BL CBR-002 .30µ0ó0Á0ü0à Leveling Rules 1) The following restrictions apply for!?ntermediate SQL: a) Conforming Intermediate SQL language shall contain no!!drop 4ranslation statement>. 2) The following restrictions apply for Entry SQL in addition4o any Intermediate SQL restrictions: None. 0Õ0¡0é0Ã0É4 Database Language SQL X3H2-9(g()¬4/DBL CBR-00() .34 .34 !!assertion definition> Function Specify an integrity constraint by means of an assertion and spec- ify4he initial default4ime for checking4he assertion. Format !!assertion definition> ::= CREATE ASSERTION!!constraint name>!!assertion check> [!!constraint attributes> ] !!assertion check> ::= CHECK!!left0aren> !!right paren> Syntax Rules 1) If an is contained in a!!schema defi- nition> and if the contains a!!schema name>, then4hat shall be4he same as4he explicit or implicit of4he containing . 2) The schema identified by4he explicit or implicit schema name of 4he!!constraint name> shall not include a constraint descriptor 7hose constraint name is . 2 2) If!!constraint attributes> is not specified,4hen INITIALLY IMMEDIATE NOT DEFERRABLE is implicit. 4) The!!search condition> shall not contain a or a . 5) No!!query expression> in4he!!search condition> shall reference a temporary table. 5 5) The shall not generally contain a!!datetime 6alue function> or a that is CURRENT_USER, SESSION_USER, or SYSTEM_USER. 7) The!!qualified identifier> of!!constraint name> shall be differ- ent from4he!!qualified identifier> of4he!!constraint name> of any other constraint defined in the same schema. 8) The shall not generally contain a!!query specification> or a 4hat is0ossibly non- deterministic. Schema definition and manipulation 2 2(ry) X3H2-9(g()¬4/DBL CBR-00() 11.0Ö0Ã0·0§0ë!!assertion definition> Access Rules 1)!?f an!!assertion definition> is contained in a , then 4he current!!authorization identifier> shall be equal4o the 4hat owns4he schema identified by the implicit or explicit!!schema name> of the of4he!!assertion definition>. 2) Let TN be any
referenced in4he!!search condi- tion> of4he!!assertion definition>.!?f TN identifies a table described by a base table descriptor or a view descriptor,4hen Case: a)!?f a is contained in the , then4he applicable privileges shall include REFERENCES for each!!column name> CN of4he4able identified by TN,7here CN is contained in the . b) Otherwise,4he applicable privileges shall include REFERENCES for at least one column of4he4able identified by TN. ??eneral Rules 1) An!!assertion definition> defines an assertion. Note: Subclause 10.6, " and!!con- straint attributes>"+"+ specifies7hen a constraint is effectively checked. 2) The assertion is not satisfied if and only if the result of evaluating4he!!search condition> is false. 0Î0Ã0È An assertion descriptor is created that describes4he assertion being defined. The name included in4he assertion descriptor is !!constraint name>. The assertion descriptor includes an indication of whether the constraint is deferrable or not deferrable and7hether4he ini- tial constraint mode is deferred or immediate. The assertion descriptor includes the of the . 4)!?f the character representation of the cannot be represented in the Information Schema7ithout4runcation, 4hen a completion condition is raised: warning-search condition 4oo long for information schema. Leveling Rules 1) The following restrictions apply for!?ntermediate SQL: a) Conforming Intermediate SQL language shall not contain any . 0Õ0¡0é0Ã0É6 Database Language SQL X3H2-9(g()¬4/DBL CBR-00() .34 (SA) The following restrictions apply for Entry SQL in addition to any!?ntermediate SQL restrictions: None. Schema definition and manipulation 0Õ0¡0é0Ã0É7 X0ß0¯0í0ó(g()92-154e¤BL CBR-002 .35 .35 !!drop assertion statement> Function Destroy an assertion. Format ::= DROP ASSERTION Syntax Rules 1) Let A be the assertion identified by and let AN be the name of A. 2) The schema identified by4he explicit or implicit schema name of AN shall include the descriptor of A. Access Rules 1) The current!!authorization identifier> shall be equal4o the 4hat owns4he schema identified by the of4he assertion identified by AN. ??eneral Rules 1) The descriptor of A is destroyed. Leveling Rules 1) The following restrictions apply for!?ntermediate SQL: a) Conforming Intermediate SQL language shall not contain any . (SA) The following restrictions apply for Entry SQL in addition to any!?ntermediate SQL restrictions: None. 2 2(R´) Database Language SQL X0ß0¯0í0ó(g()92-154e¤BL CBR-002 .36 11.0Ø0¯0¿0ü0ë Function Define privileges. Format !!grant statement> ::= ??RANT!!privileges> ON!!object name> TO [ { }... ] [ 2 2 2 2ITH GRANT OPTION ] !!object name> ::= [ TABLE ]!!table name> | DOMAIN!!domain name> = COLLATION!!collation name> | CHARACTER SET = TRANSLATION!!translation name> Syntax Rules 1)!?f specifies a ,!!collation name>, !!character set name>, or , then!!privileges> shall specify USAGE; otherwise, USAGE shall not be specified. (SA) Let O be the object identified by4he!!object name>. 0Î0Ã0È Let A be the current . For each !!grantee> specified, a set of0rivilege descriptors is iden- tified. The privilege descriptors identified are4hose defining, for each explicitly or implicitly in!!privileges>,4hat on O held by A with grant option. Access Rules 1) The applicable privileges shall include a0rivilege identifying O. General Rules 1) The!!privileges> specify one or more privileges on the object identified by4he!!object name>. (SA) For every identified privilege descriptor, a privilege descrip- 4or is created that specifies4he identical!!grantee>, , object O, and grantor A. Let CPD be the set of0rivilege de- scriptors created. 0Î0Ã0È For every identified privilege descriptor7hose action is SELECT,!?NSERT, UPDATE, or REFERENCES7ithout a column name, privilege descriptors are also created for each column C in O Schema definition and manipulation 0Õ0¡0é0Ã0É9 X0ß0¯0í0ó(g()92-154e¤BL CBR-002 .36 for which A holds the corresponding privilege with grant op- 4ion. For each such column, a0rivilege descriptor is created 4hat specifies the identical ,4he identical!!action>, object C, and grantor A. 4)!?f WITH??RANT OPTION was specified, each privilege descriptor also indicates that4he0rivilege is grantable. 5) If!!table name> is specified, then let T be the table identified by the
. 6) For every5pdatable6iew V owned by some grantee G such4hat T is some leaf5nderlying table of4he!!query expression> of V: a) Let VN be the
of V. b)!?f WITH??RANT OPTION is specified, then let 2 2 2 2GO be "WITH GRANT OPTION"; otherwise, let WGO be a+ero-length string. c) For every0rivilege descriptor PD in CPD, let PA be4he ac- 4ion included in PD. i) If PA is!?NSERT, UPDATE, or DELETE, then4he following is effectively executed as4hough the current!!authorization identifier> were "_SYSTEM" and7ith- out further Access Rule checking: GRANT PA ON VN TO G WGO ii) If PA is A(CT), where A is!?NSERT or UPDATE and CT is the name of some column of T such4hat there is a correspond- ing column in V, named CVN, that is derived from CT,4hen 4he following!!grant statement> is effectively executed as4hough the current 7ere "_ SYSTEM" and without further Access Rule checking: GRANT A(CVN) ON VN TO G WGO 7) For every!!grantee>?? and for every6iew V1 owned by G, if G has been granted SELECT privilege WITH??RANT OPTION on all4ables identified by a
contained in the of V1, then for every0rivilege descriptor with a!!privileges> P that contains SELECT, a of "_SYSTEM", of V1, and G that is not grantable,4he following!!grant statement> is effectively executed7ith a current of "_SYSTEM" and without further Access Rule checking: ??RANT P ON V1 TO G WITH??RANT OPTION 8) For every!!grantee>?? and for every domain D1 owned by G, if G has been granted REFERENCES privilege WITH??RANT OPTION on every column referenced in the included in a domain constraint descriptor included in the domain descriptor of D1 and a grantable USAGE privilege on all domains, character sets, collations, and translations7hose!!domain name>s,!!character 0Õ0£0ü0È0 Database Language SQL X3H2-9(g()¬4/DBL CBR-00() 11.0Ø0¯0¿0ü0ë!!grant statement> set name>s,!!collation name>s, and s, respec- 4ively, are included in4he domain descriptor, and a grantable USAGE privilege for the contained in the included in4he domain descriptor, then for every 0rivilege descriptor with!!privileges> USAGE, a!!grantor> of "_ SYSTEM", D1, and!!grantee>??4hat is not grantable, the following is effectively executed with a cur- rent!!authorization identifier> of "_SYSTEM" and7ithout further Access Rule checking: GRANT USAGE ON DOMAIN D1 TO G WITH??RANT OPTION 9) For every!!grantee>?? and for every collation C1 owned by??, if 4he USAGE0rivilege of G for the character set identified by a contained in4he!!collation defi- nition> of C1 is grantable, then for every0rivilege descriptor with a!!privileges> P, a!!grantor> of "_SYSTEM"+"+!!object> of C1, and!!grantee>??4hat is not grantable, the following is effectively executed with a current!!authoriza- 4ion identifier> of "_SYSTEM" and7ithout further Access Rule checking: GRANT P ON COLLATION C1 TO?? 2 2 2 2ITH GRANT OPTION 10)For every G and for every translation T1 owned by G, if the USAGE privilege of?? for every character set identified by a!!character set specification> contained in the of T1 is grantable,4hen for every privilege descriptor7ith a P, a of "_SYSTEM", of T1, and G that is not grantable,4he fol- lowing!!grant statement> is effectively executed as though4he current!!authorization identifier> were "_SYSTEM" and7ithout further Access Rule checking: GRANT P ON TRANSLATION T1 TO?? 2 2 2 2ITH GRANT OPTION 11)If!!table name> is specified, then for each view V owned by some !!grantee>?? such that T or some column CT of T, let RTi, for i ranging from 14o the number of tables identified by4he!!table reference>s contained in4he!!query expression> of V, be4he !!table name>s of those tables. For every column CV of V: a) Let CRij, for j ranging from 14o the number of columns of RTi4hat are underlying columns of CV, be4he!!column name>s of4hose columns. b) If 2 2 2 2ITH GRANT OPTION7as specified, then let 2 2 2 2GO be "WITH GRANT OPTION"; otherwise, let WGO be a+ero-length string. c)!?f, following successful execution of4he!!grant statement>, G will have REFERENCES(CRTij) for all i and for all j, and A has REFERENCES on some column of RTi for all i,4he4he following!!grant statement> is effectively executed as though Schema definition and manipulation 2 20Ó0ë X3H2-9(g()¬4/DBL CBR-00() 11.0Ø0¯0¿0ü0ë!!grant statement> 4he current!!authorization identifier> were "_SYSTEM" and 7ithout further Access Rule checking: ??RANT REFERENCES CV ON V TO?? 2 2 2 2GO 1(SA)If4wo0rivilege descriptors are identical except that one in- dicates4hat the privilege is grantable and4he other indicates 4hat the privilege is not grantable, then both privilege de- scriptors are set to indicate that4he0rivilege is grantable. 10Î0Ã0ÈRedundant duplicate privilege descriptors are removed from4he multiset of all0rivilege descriptors. )For every combination of and on O specified in!!privileges>, if there is no corresponding privilege de- scriptor in the set of identified privilege descriptors,4hen a completion condition is raised: warning-privilege not granted. 15)If ALL PRIVILEGES was specified,4hen for each grantee, if no privilege descriptors were identified,4hen a completion condi- tion is raised: warning-privilege not granted. Leveling Rules 1) The following restrictions apply for Intermediate SQL: a) In Conforming Intermediate SQL language, an shall not specify COLLATION or TRANSLATION. (SA) The following restrictions apply for Entry SQL in addition to any!?ntermediate SQL restrictions: a) In Conforming Entry SQL language, an!!object name> shall not specify TABLE. b) In Conforming Entry SQL language, an!!object name> shall not specify CHARACTER SET or DOMAIN. 0Õ0£0ü0È(N) Database Language SQL X3H2-9(g()¬4/DBL CBR-00() .37 .37 !!revoke statement> Function Destroy0rivileges. Format ::= REVOKE [ GRANT OPTION FOR ]!!privileges> ON!!object name> FROM [ { }... ]!!drop behavior> Syntax Rules 1)!?f specifies a ,!!collation name>, !!character set name>, or , then!!privileges> shall specify USAGE; otherwise, USAGE shall not be specified. (SA)!?NSERT is equivalent to specifying both4he!?NSERT table priv- ilege and INSERT () for all columns of
. 0Î0Ã0È UPDATE is equivalent to specifying both4he UPDATE table priv- ilege and UPDATE () for all columns of
. 4) REFERENCES is equivalent to specifying both4he REFERENCES ta- ble privilege and REFERENCES () for all columns of
. 5) Let O be the object identified by4he!!object name>. 6) Let A be the current . For every specified, a set of privilege descriptors is iden- 4ified. A0rivilege descriptor is said to be identified if it belongs4o the set of0rivilege descriptors4hat define, for any explicitly or implicitly in!!privileges>,4hat on O granted by A4o . Note: Column0rivilege descriptors become identified7hen explicitly or implicitly contains a!!privilege column list>. 7) A0rivilege descriptor D is allowed4o be created by a grant permitted by P if either: a) The following conditions hold: i) P indicates4hat the privilege that it represents is grantable, and Schema definition and manipulation 0Õ0£0ü0È0ª0ü0à X0ß0¯0í0ó(g()92-154e¤BL CBR-002 .37 ii) The grantee of P is the same as the grantor of D or the grantee of P is PUBLIC, and iii) Case: 1) P and D are both column privilege descriptors. The ac- tion and4he identified column of P are the same as the action and identified column of D, respectively. (SA) P is a table privilege descriptor and D is a column privilege descriptor. The identified4able of P is4he same as the identified4able of D and the action of P is the same as the action of D and the action of P is SELECT. 0Î0Ã0È Neither P nor D are column privilege descriptors. The action and4he identified table, domain, character set, collation, or4ranslation of P are the same as the ac- 4ion and the identified4able, domain, character set, collation, or translation of D, respectively. b) The following conditions hold: i) The0rivilege descriptor for D indicates that its grantor is4he special grantor6alue "_SYSTEM", and ii) The action of P is4he same as4he action of D, and iii) The grantee of P is the owner of4he4able, collation, or 4ranslation identified by D, or4he grantee of P is PUBLIC, and iv) One of4he following conditions hold: 1) P and D are both table privilege descriptors,4he0riv- ilege descriptor for D identifies the
of a !!view definition> V and either: A) The action of P is SELECT and the identified4able of P is contained in the of V, or B) V is an5pdatable6iew and the identified4able of P is4he5nderlying table of4he!!query expression>. 2) P and D are both column privilege descriptors,4he0riv- ilege descriptor D identifies a CVN ex- 0licitly or implicitly contained in4he!!view column list> of a V and V is an updatable 6iew. For every column CV identified by a!!column name> CVN,4here is a corresponding column in the underly- ing table of4he!!query expression> TN. Let CTN be4he of4he column of4he!!query expression> from which CV is derived. The action for P is UPDATE or INSERT and4he identified column of P is TN.CTN. 2 20Ö0Ã0·0§0ë Database Language SQL X0ß0¯0í0ó(g()92-154e¤BL CBR-002 11.0Ú0½!!revoke statement> 2 2) P is a4able0rivilege descriptor and the column0rivi- lege descriptor D identifies a CV explic- itly or implicitly contained in the of a!!view definition> V. Let TN be a
con- 4ained in4he!!query expression> of4he6iew. The action for P is SELECT and4he identified table of P is TN. 4) The0rivilege descriptor D identifies4he!!collation name> of a CO and the identified character set name of P is contained in the immediately contained in CO. 5) The0rivilege descriptor D identifies4he!!translation name> of a TD and the identi- fied character set name of P is contained in the or4he!!target character set specification> immediately contained in TD. 8) A0rivilege descriptor D is said to be directly dependent on an- other privilege descriptor P if D represents a0rivilege allowed 4o be created by a grant permitted by P. 9) The0rivilege dependency graph is a directed graph such4hat: a) Each node represents a privilege descriptor, and b) Each arc from node P1 to node P2 represents the fact4hat P2 directly depends on P1. An independent node is one4hat has no incoming arcs. 10)A0rivilege descriptor P is said to be modified if either P is a SELECT column privilege descriptor and a SELECT table privilege descriptor7ith the same grantee, grantor, catalog name, schema name, and table name is a modified0rivilege descriptor, or: a) P indicates4hat the privilege that it represents is grantable, and b) P directly depends on an identified0rivilege descriptor or a modified privilege descriptor, and c) Let XO and XA respectively be the identifier of the object identified by a0rivilege descriptor X and the action of X. 2 2 2 2ithin the set of0rivilege descriptors5pon which P directly depends, there exists some XO and XA for which the set of identified privilege descriptors unioned with4he set of mod- ified0rivilege descriptors include all0rivilege descriptors specifying the grant of XA on XO with grant option, and d) At least one of4he following is true: i) GRANT OPTION FOR is specified and the grantor of P is the special grantor6alue "_SYSTEM". Schema definition and manipulation 0Õ0£0ü0È5 X0ß0¯0í0ó(g()92-154e¤BL CBR-002 .37 ii) There exists a0ath to P from an independent node that includes no identified or modified0rivilege descriptors. P is said4o be a marked modified0rivilege descriptor. iii) P directly depends on a marked modified0rivilege descrip- 4or, and the grantor of P is the special grantor value "_SYSTEM". P is said to be a marked modified privilege descriptor. 11)A privilege descriptor P is abandoned if: a) It is not an independent node, and Case: i) GRANT OPTION FOR is not specified, P is not itself a mod- ified0rivilege descriptor, and4here exists no0ath to P from any independent node other than0aths4hat include an identified0rivilege descriptor or a modified privilege descriptor. ii)??RANT OPTION FOR is specified, P is not itself a modi- fied privilege descriptor, and there exists no path4o P from any independent node other4han paths that include a modified0rivilege descriptor. b) P is a SELECT column privilege descriptor and4here exists a SELECT4able0rivilege descriptor X with4he same grantee, grantor, catalog name, schema name, and4able name and Case: i)??RANT OPTION FOR is not specified and X is an identified 0rivilege descriptor or an abandoned privilege descriptor. ii) GRANT OPTION FOR is specified and X is an abandoned privi- lege descriptor. 1(SA)Let S1 be the name of any schema and let A1 be4he!!authoriza- 4ion identifier> that owns the schema identified by S1. 10Î0Ã0ÈLet V be any6iew descriptor included in S1. V is said4o be abandoned if the destruction of all abandoned0rivilege descrip- tors and, if??RANT OPTION FOR is not specified, all identified 0rivilege descriptors7ould result in A1 no longer having SELECT privilege on one or more4ables or USAGE0rivilege on one or more domains, collations, character sets, or translations7hose names are contained in the of V. 14)Let TC be any table constraint descriptor included in S1. TC is said4o be abandoned if the destruction of all abandoned0rivi- lege descriptors and, if??RANT OPTION FOR is not specified, all identified0rivilege descriptors7ould result in A1 no longer having REFERENCES privilege on one or more referenced columns of TC or USAGE0rivilege on one or more domains, collations, 2 20Ø0¯0¿0ü0ë Database Language SQL X0ß0¯0í0ó(g()92-154e¤BL CBR-002 11.0Ú0½!!revoke statement> character sets, or4ranslations whose names are contained in any !!search condition> of TC. 15)Let AX be any assertion descriptor included in S1. AX is said to be abandoned if4he destruction of all abandoned privilege descriptors and, if GRANT OPTION FOR is not specified, all iden- 4ified privilege descriptors would result in A1 no longer having REFERENCES0rivilege on one or more referenced columns of AX or USAGE privilege on one or more domains, collations, character sets, or4ranslations whose names are contained in any!!search condition> of AX. 16)Let DC be any domain constraint descriptor included in S1. DC is said to be abandoned if4he destruction of all abandoned privi- lege descriptors and, if GRANT OPTION FOR is not specified, all identified privilege descriptors would result in A1 no longer having REFERENCES0rivilege on one or more referenced columns of DC or USAGE privilege on one or more domains, collations, character sets, or4ranslations whose names are contained in any !!search condition> of DC. 17)Let DO be any domain descriptor included in S1. DO is said4o be abandoned if the destruction of all abandoned0rivilege descrip- tors and, if??RANT OPTION FOR is not specified, all identified 0rivilege descriptors7ould result in A1 no longer having USAGE 0rivilege on the collation whose name is contained in4he!!col- late clause> of DO, if any. 18)If RESTRICT is specified, then4here shall be no abandoned0riv- ilege descriptors, abandoned views, abandoned4able constraints, abandoned assertions, abandoned domain constraints, or abandoned domains. Access Rules 1) The applicable0rivileges shall include a privilege identifying O. ??eneral Rules 1) If??RANT OPTION FOR is not specified, then: a) All abandoned privilege descriptors are destroyed, and b) The identified privilege descriptors are destroyed, and c) The modified privilege descriptors are set to indicate that 4hey are not grantable. 2) If??RANT OPTION FOR is specified, then Case: a) If CASCADE is specified,4hen all abandoned privilege de- scriptors are destroyed. Schema definition and manipulation 2 20Ú0½ X3H2-9(g()¬4/DBL CBR-00() 11.0Ú0½!!revoke statement> b) Otherwise, if4here are any0rivilege descriptors directly dependent on an identified0rivilege descriptor that are not modified privilege descriptors,4hen an exception condition is raised: dependent privilege descriptors still exist. The identified0rivilege descriptors and4he modified privilege descriptors are set to indicate that4hey are not grantable. 2 2) For every abandoned view descriptor V, let S1.VN be the
of V. The following!!drop6iew statement> is effectively executed7ithout further Access Rule checking: DROP VIEW S1.VN CASCADE 4) For every abandoned4able constraint descriptor TC, let S1.TCN be4he!!constraint name> of TC and let S(‘Ñ)T2 be the
of the table that contains TC (S1 and S(N)not necessarily dif- ferent). The following is effectively executed without further Access Rule checking: ALTER TABLE S(‘Ñ)T2 DROP CONSTRAINT S1.TCN CASCADE 5) For every abandoned assertion descriptor AX, let S1.AXN be the of AX. The following!!drop assertion state- ment> is effectively executed without further Access Rule check- ing: DROP ASSERTION S1.AXN 5 5) For every abandoned domain constraint descriptor DC, let S1.DCN be4he!!constraint name> of DC and let S(‘Ñ)DN be the of4he domain that contains DC. The following is effectively executed7ithout further Access Rule checking: ALTER DOMAIN S(‘Ñ)DN DROP CONSTRAINT S1.DCN 7) For every abandoned domain descriptor DO, let S1.DN be the of DO. The following!!drop domain statement> is effectively executed7ithout further Access Rule checking: DROP DOMAIN S1.DN CASCADE 8) For every combination of and on O specified in!!privileges>, if there is no corresponding privilege de- scriptor in the set of identified privilege descriptors,4hen a completion condition is raised: warning-privilege not revoked. 9) If ALL PRIVILEGES was specified,4hen for each!!grantee>, if no privilege descriptors were identified,4hen a completion condition is raised: warning-privilege not revoked. 2 20Ú0Ë0Ò Database Language SQL X0ß0¯0í0ó(g()92-154e¤BL CBR-002 11.0Ú0½!!revoke statement> Leveling Rules 1) The following restrictions apply for Intermediate SQL: None. 2) The following restrictions apply for Entry SQL in addition4o any Intermediate SQL restrictions: a) Conforming Entry SQL language shall not contain a!!revoke statement>. Schema definition and manipulation 2 20Ø0ë0Ä X3H2-9(g()¬4/DBL CBR-00() 0Ö0Ã0·0§0ë0 Database Language SQL X3H2-9(g()¬4/DBL CBR-00() 1(N) Module .1 Function Define a module. Format ::= !!module name clause> [ ... ] !!module contents>... ::= SCHEMA!!schema name> = AUTHORIZATION!!module authorization identifier> = SCHEMA AUTHORIZATION !!module authorization identifier> ::= !!authorization identifier> ::= =!!dynamic declare cursor> | Syntax Rules 1)!?f SCHEMA!!schema name> is not specified,4hen a equal to!!module authorization identifier> is implicit. (SA)!?f the explicit or implicit!!schema name> does not specify a , then an implementation-defined!!catalog name> is implicit. 2 2) The implicit or explicit!!catalog name> is4he implicit for all5nqualified!!schema name>s in4he!!module>. 2 2 2) A or shall0recede in the text of the any!!procedure>4hat references 4he!!cursor name> of the or . Module 0Ö0Ã0·0§0ë1 X0ß0¯0í0ó(g()92-154e¤BL CBR-002 .1!!module> 5) For every in a , there shall be exactly one!!procedure> in that!!module> that contains an!!open state- ment> that specifies4he!!cursor name> declared in4he!!declare cursor>. Note: See the Syntax Rules of Subclause ª.1, "". Access Rules None. General Rules 1)!?f the SQL-agent that0erforms a call of a in a !!module> is not a0rogram4hat conforms4o the programming language standard specified by4he!!language clause> of that !!module>,4hen the effect is implementation-dependent. (SA)!?f the SQL-agent performs calls of s from more4han one Ada task, then4he results are implementation-dependent. 2 2) Case: a) If a!!module authorization identifier> is specified,4hen it is the current for0rivilege determination for4he execution of each!!procedure> in the . b) Otherwise,4he current!!authorization identifier> for privi- lege determination for the execution of each in 4he!!module> is4he SQL-session!!authorization identifier>. 2 2 2) After the last4ime that an SQL-agent performs a call of a!!pro- cedure>: a) A or a is effec- 4ively executed. If an unrecoverable error has occurred, or if the SQL-agent terminated5nexpectedly, or if any con- straint is not satisfied, then a!!rollback statement> is 0erformed. Otherwise,4he choice of7hich of these SQL- statements to0erform is implementation-dependent. The deter- mination of7hether an SQL-agent has terminated5nexpectedly is implementation-dependent. b) Let D be the of any system descriptor area that is currently allocated within an SQL-session associated 7ith the SQL-agent. A!!deallocate descriptor statement>4hat specifies DEALLOCATE DESCRIPTOR D is effectively executed. 0Ö0Ã0·0§0ë(N) Database Language SQL X3H2-9(g()¬4/DBL CBR-00() 1(‘Ñ)1 c) All SQL-sessions associated with4he SQL-agent are4ermi- nated. Leveling Rules 1) The following restrictions apply for Intermediate SQL: a) A shall not contain a!!temporary table declaration>. (SA) The following restrictions apply for Entry SQL in addition to any!?ntermediate SQL restrictions: a) A shall be associated7ith an SQL-agent during its execution. An SQL-agent shall be associated with at most one !!module>. b) A!!module contents> shall not be a . c) A shall specify AUTHORIZATION and shall not specify SCHEMA. Module 2 243 X3H2-9(g()¬4/DBL CBR-00() 1(‘Ñ)(N) .2 Function Name a!!module>. Format ::= MODULE [ ] [ ] !!module character set specification> ::= NAMES ARE Syntax Rules 1)!?f a does not specify a ,4hen the is unnamed. 2) The shall be different from the of any other!!module> in4he same SQL-environment. Note: An SQL-environment may have multiple!!module>s4hat are unnamed. 2 2) If4he!!language clause> of the containing!!module> specifies ADA,4hen a shall be specified, and that!!module name> shall be a valid Ada library unit name. 2 2 2) If a!!module character set specification> is not specified, then a!!module character set specification> that specifies an implementation-defined character set4hat contains at least every character that is in!!SQL language character> is implicit. Access Rules None. ??eneral Rules 1) If a!!module name> is specified,4hen in4he SQL-environment4he containing has4he name given by!!module name>. Leveling Rules 1) The following restrictions apply for!?ntermediate SQL: None. 2 244 Database Language SQL X0ß0¯0í0ó(g()92-154e¤BL CBR-002 .2!!module name clause> 2) The following restrictions apply for Entry SQL in addition4o any Intermediate SQL restrictions: a) A!!module character set specification> shall not be speci- fied. Module 0Ö0Ã0·0§0ë5 X0ß0¯0í0ó(g()92-154e¤BL CBR-002 .3!!procedure> .3 Function Define a procedure. Format ::= PROCEDURE !!parameter declaration list> !!SQL procedure statement>!!semicolon> !!parameter declaration list> ::= !!parameter declaration> ["!!comma>!!parameter declaration>(... ] =!!parameter declaration>... ::= !!data4ype> =!!status0arameter> ::= SQLCODE= SQLSTATE Syntax Rules 1) The!!procedure name> shall be different from the of any other in4he containing . Note: The!!procedure name> should be a standard-conforming pro- cedure, function, or routine name of the language specified by the subject . Failure4o observe this recommen- dation will have implementation-dependent effects. (SA) The!!parameter name> of each in a!!pro- cedure> shall be different from4he!!parameter name> of any other!!parameter declaration> in that!!procedure>. 0Î0Ã0È Any!!parameter name> contained in4he!!SQL procedure statement> of a shall be specified in a in4hat . Note: s in a without enclos- ing parentheses and without commas separating multiple!!param- eter declaration>s is a deprecated feature that is supported for compatibility with earlier6ersions of4his International Standard. See Annex D, "Deprecated features". 4) A call of a!!procedure> shall supply n parameters, where n is 4he number of!!parameter declaration>s in4he!!procedure>. 0Ö0Ã0·0§0ë6 Database Language SQL X3H2-9(g()¬4/DBL CBR-00() .3!!procedure> 5) A!!procedure> shall contain at least one , at most one 4hat specifies SQLCODE, and at most one!!status0arameter> that specifies SQLSTATE. A0arameter4hat corresponds with SQLCODE is referred4o as an SQLCODE parameter. A0arameter4hat corresponds with SQLSTATE is referred to as an SQLSTATE parameter. The SQLCODE and SQLSTATE parameters are referred to as status0arameters. Note: SQLSTATE is the preferred status0arameter. The SQLCODE status0arameter is a deprecated feature4hat is supported for compatibility7ith earlier versions of this!?nternational Standard. See Annex D, "Deprecated features". 5 5) Whether a is for an input parameter, an output0arameter, or both is determined as follows: Case: a) A!!status0arameter> is an output0arameter. b) For every that is not a , Case: i)!?f the of a parameter is contained in a !!value specification> or a that is contained in!!SQL procedure statement>, but it is not contained in a or a 4hat is contained in , then4he0arameter is an input0arameter. ii) If4he!!parameter name> of a0arameter is contained in a or a 4hat is contained in , but it is not contained in a!!value specification> or a that is contained in!!SQL procedure statement>,4hen the parameter is an output0arameter. iii) If4he!!parameter name> of a0arameter is contained in a or a!!simple6alue specification> 4hat is contained in and it is contained in a or a 4hat is contained in , then4he0arameter is both an input parameter and an output0arameter. iv) Otherwise,4he0arameter is neither an input0arameter nor an output parameter. 5 5 5) The Syntax Rules of Subclause .4, "Calls4o a ", shall be4rue. Module 0Ö0Ã0·0§0ë7 X0ß0¯0í0ó(g()92-154e¤BL CBR-002 .3!!procedure> Access Rules None. General Rules 1) A!!procedure> defines a0rocedure4hat may be called by an SQL- agent. (SA)!?f the 4hat contains4he!!procedure> is associated 7ith an SQL-agent4hat is associated with another!!module> that contains a with4he same , then4he effect is implementation-defined. 2 2) If4he!!module> that contains the has an explicit MAI that is different from4he SQL-session!!authorization identifier> SAI,4hen: a) 2 2 2 2hether or not SAI can invoke!!procedure>s in a!!module> with explicit MAI is implementation-defined, as are any restrictions0ertaining to such invocation. b) If SAI is restricted from invoking a!!procedure> in a 7ith explicit!!module authorization identifier> MAI, then an exception condition is raised: invalid authorization specification. 4)!?f the value of any input0arameter0rovided by4he SQL-agent falls outside4he set of allowed values of the data4ype of4he 0arameter, or if the value of any output parameter resulting from4he execution of the falls outside the set of6alues supported by4he SQL-agent for4hat parameter,4hen the effect is implementation-defined. If4he implementation- defined effect is4he raising of an exception condition, then an exception condition is raised: data exception-invalid parameter value. 5) Let S be4he!!SQL procedure statement> of the . 5 5) When4he!!procedure> is called by an SQL-agent: Case: a)!?f S is an , then: i) The 4hat contains S is associated7ith the SQL- agent. ii) The diagnostics area is emptied. iii) S is executed. 0Ö0Ã0·0§0ë8 Database Language SQL X3H2-9(g()¬4/DBL CBR-00() .3!!procedure> iv) If S successfully initiated or resumed an SQL-session, then subsequent calls to a!!procedure> by the SQL-agent are associated with4hat SQL-session until the SQL-agent 4erminates the SQL-session or makes it dormant. b)!?f S is an ,4hen: i) The!!module> that contains S is associated with4he SQL- agent. ii) S is executed. c) Otherwise: i) If no SQL-session is current for4he SQL-agent, then Case: 1) If4he SQL-agent has not executed an!!SQL connection statement> and4here is no default SQL-session asso- ciated7ith the SQL-agent,4hen the following is effectively executed: CONNECT TO DEFAULT (SA)!?f the SQL-agent has not executed an and there is a default SQL-session associated 7ith the SQL-agent,4hen the following is effectively executed: SET CONNECTION DEFAULT 2 2) Otherwise, an exception condition is raised: connection exception-connection does not exist. Subsequent calls4o a or invocations of s by the SQL-agent are associated7ith the SQL-session5ntil4he SQL-agent4erminates the SQL-session or makes it dormant. ii) If an SQL-transaction is active for the SQL-agent,4hen S is associated7ith that SQL-transaction. iii) If no SQL-transaction is active for the SQL-agent and S is a transaction-initiating SQL-statement, then 1) An SQL-transaction is effectively initiated and asso- ciated with4his call and7ith subsequent calls of any !!procedure> or invocations of!!direct SQL statement>s by4hat SQL-agent until the SQL-agent terminates4hat SQL-transaction. (SA) Case: A) If a!!set transaction statement> has been executed since4he4ermination of the last SQL-transaction in the SQL-session,4hen the access mode, constraint Module 0Ö0Ã0·0§0ë9 X0ß0¯0í0ó(g()92-154e¤BL CBR-002 .3!!procedure> mode, and isolation level of the SQL-transaction are set as specified by the . B) Otherwise,4he access mode of that SQL-transaction is read-write, the constraint mode for all constraints in 4hat SQL-transaction is immediate, and the isolation level of4hat SQL-transaction is SERIALIZABLE. 2 2) The SQL-transaction is associated with4he SQL-session. 4) The!!module> that contains S is associated with4he SQL-transaction. iv) The!!module> that contains S is associated with4he SQL- agent. 6) If S contains an!!SQL schema statement> and the access mode of the current SQL-transaction is read-only, then an exception condition is raised: invalid transaction state. 6i) The diagnostics area is emptied. 6ii) The values of all input parameters4o the are established. 6iii)S is executed. 5 5 5) If4he non-dynamic or dynamic execution of an or the execution of an , , or!!dynamic single row select state- ment> occurs within4he same SQL-transaction as4he non-dynamic or dynamic execution of an SQL-schema statement and4his is not allowed by the SQL-implementation, then an exception condition is raised: invalid4ransaction state. 8) 2 2 2 2hen a is called by an SQL-agent, let PDi be the of4he i-th parameter and let DTi and PNi be4he!!data4ype> and4he!!parameter name> specified in PDi, respectively. Let PIi be4he i-th parameter in4he0roce- dure call. 9) If S is a
=!!view definition> =!!grant statement> =!!domain definition> =!!character set definition> | =!!translation definition> | !!SQL schema manipulation statement> ::= !!drop schema statement> =!!alter table statement> =!!drop4able statement> | | =!!alter domain statement> | | =!!drop collation statement> | =!!drop assertion statement> ::= !!open statement> | | | INTO!!select4arget list>
!!select4arget list> ::= ["!!comma>!!target specification> }... ] Syntax Rules 1) The number of elements in4he!!select list> shall be the same as the number of elements in the and
are4hose specified in the . b) If Q is empty,4hen no SQL-data values are assigned to any 4argets identified by4he!!select4arget list>, and a comple- 4ion condition is raised: no data. 0Ú0Ë0Ò(N) Database Language SQL X3H2-9(g()¬4/DBL CBR-00() 10Ô0¢0¹0È0ë5 is in an implementation-dependent order. 5)!?f an exception condition is raised during the assignment of a value to a4arget,4hen the values of targets are implementation- dependent. 5 5) The target identified by4he i-th of the
2 2 2 2HERE CURRENT OF Syntax Rules 1) The containing shall contain a!!declare cursor> whose is4he same as4he!!cursor name> in the . Let CR be the cursor specified by . 2) CR shall be an5pdatable cursor. Note: updatable cursor is defined in Subclause 10Ô0¢0¹0È0ë1, "". 2 2) Let T be4he4able identified by4he!!table name>. Let QS be4he !!query specification>4hat is4he simply underlying4able of the simply5nderlying table of CR. The simply underlying4able of QS shall be T. Note: The simply5nderlying table of a!!cursor specification> is defined in Subclause ª.1, "". Access Rules 1) The applicable0rivileges shall include DELETE for4he!!table name>. Note: The applicable0rivileges for a
are defined in Subclause 10.3, "". General Rules 1)!?f the access mode of4he current SQL-transaction is read-anly and T is not a4emporary4able, then an exception condition is raised: invalid4ransaction state. (SA)!?f cursor CR is not0ositioned on a row, then an exception con- dition is raised: invalid cursor state. 2 2) The row from7hich4he current row of CR is derived is marked for deletion. 4)!?f,7hile CR is open,4he 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 4hat identifies any cursor other than CR,5pdated 2 284 Database Language SQL X0ß0¯0í0ó(g()92-154e¤BL CBR-002 ª.6!!delete statement: positioned> by any!!update statement: searched>, or updated by any!!update statement: positioned> that identifies any cursor other4han CR, then a completion condition is raised:7arning-cursor operation conflict. 5) All rows that are marked for deletion are effectively deleted at the end of4he!!delete statement: positioned> prior to4he checking of any integrity constraint. 5 5) If4he!!delete statement: positioned> deleted the last row of CR, then4he0osition of CR is after4he last row; otherwise, the position of CR is before4he next row. Leveling Rules 1) The following restrictions apply for Intermediate SQL: None. 2) The following restrictions apply for Entry SQL in addition4o any Intermediate SQL restrictions: None. Data manipulation 0Ú0Ë0Ò5 X0ß0¯0í0ó(g()92-154e¤BL CBR-002 ª.7!!delete statement: searched> 10Ô0¢0¹0È0ë7 !!delete statement: searched> Function Delete rows of a table. Format ::= DELETE FROM!!table name> [ WHERE ] Syntax Rules 1) Let T be4he4able identified by4he!!table name>. T shall not be a read-anly table. 2) The scope of4he!!table name> is4he entire . Access Rules 1) The applicable0rivileges shall include DELETE for4he!!table name>. Note: The applicable0rivileges for a
are defined in Subclause 10.3, "". General Rules 1)!?f the access mode of4he current SQL-transaction is read-anly and T is not a4emporary4able, then an exception condition is raised: invalid4ransaction state. (SA) Case: a)!?f is not specified,4hen all rows of T are marked for deletion. b)!?f is specified,4hen it is applied to each row of T7ith the
bound4o that row, and all rows for7hich4he result of4he!!search condition> is 4rue are marked for deletion. The is effectively evaluated for each row of T before marking for deletion any row of T. Each in the is effectively executed for each row of T and4he results5sed in4he ap- 0lication of the 4o the given row of T. If any executed contains an outer reference4o a column of T,4he reference is to4he6alue of that column in 4he given row of T. Note: Outer reference is defined in Subclause 6.4, "". 2 286 Database Language SQL X0ß0¯0í0ó(g()92-154e¤BL CBR-002 ª.7!!delete statement: searched> 2 2) If any row4hat is marked for deletion by the has been marked for deletion by any!!delete statement: positioned> that identifies some cursor CR4hat is still open or5pdated by any 4hat identifies some cursor CR that is still open, then a completion condition is raised:7arning-cursor operation conflict. 4) All rows that are marked for deletion are effectively deleted at the end of4he!!delete statement: searched> prior to4he checking of any integrity constraint. 5) If no row is deleted, then a completion condition is raised: no data. Leveling Rules 1) The following restrictions apply for!?ntermediate SQL: a) No leaf generally5nderlying table of T shall be an5nder- lying table of any!!query expression> generally contained in 4he!!search condition>. 2) The following restrictions apply for Entry SQL in addition4o any Intermediate SQL restrictions: None. Data manipulation 2 287 X3H2-9(g()¬4/DBL CBR-00() 10Ô0¢0¹0È0ë8 ª.8 Function Create new rows in a4able. Format !!insert statement> ::= INSERT!?NTO
!!insert columns and source> !!insert columns and source> ::= [!!left0aren> !!right paren> ] !!query expression> | DEFAULT VALUES !!insert column list> ::= Syntax Rules 1) The table T identified by the
shall not be a read- only4able. (SA) An that specifies DEFAULT VALUES is equivalent to an that specifies a !!query expression> of4he form VALUES (DEFAULT, . . . ) 7here4he number of "DEFAULT" entries is equal to4he number of columns of T. 2 2) No!!column name> of T shall be identified more4han once. If4he !!insert column list> is omitted, then an 4hat identifies all columns of T in4he ascending sequence of 4heir ordinal0ositions7ithin T is implicit. 2 2 2) A column identified by4he!!insert column list> is an object column. 5) Let QT be the table specified by4he!!query expression>. The degree of QT shall be equal4o the number of s in the . The column of table T identified by the i-th!!column name> in the corresponds 7ith the i-th column of QT. 5 5) The Syntax Rules of Subclause 9.(l4) "Store assignment"+"+ apply4o corresponding columns of T and QT as TARGET and VALUE, respec- 4ively. 2 288 Database Language SQL X0ß0¯0í0ó(g()92-154e¤BL CBR-002 ª.8!!insert statement> Access Rules 1) Case: a)!?f an!!insert column list> is specified, then4he applicable shall include!?NSERT for each!!column name> in the . b) Otherwise,4he applicable privileges shall include!?NSERT for each!!column name> in T. Note: The applicable0rivileges for a
are defined in Subclause 10.3, "". (SA) Each in4he!!insert column list> shall identify a column of T. General Rules 1)!?f the access mode of4he current SQL-transaction is read-anly and T is not a4emporary4able, then an exception condition is raised: invalid4ransaction state. (SA) Let B be the leaf generally5nderlying table of T. 0Î0Ã0È The!!query expression> is effectively evaluated before inserting any rows into B. 2 2 2) Let Q be4he result of4hat . Case: a)!?f Q is empty, then no row is inserted and a completion con- dition is raised: no data. b) Otherwise, for each row R of Q: i) A candidate row of B is effectively created in which the 6alue of each column is its default6alue, as specified in 4he??eneral Rules of Subclause .5, "". The candidate row includes every column of B. ii) For every object column in the candidate row,4he6alue of 4he object column identified by4he i-th in the is replaced by the i-th6alue of R. iii) Let C be a column that is represented in4he candidate row and let SV be its value in4he candidate row. The General Rules of Subclause 9.(l4) "Store assignment"+"+ are applied4o C and SV as TARGET and VALUE, respectively. iv) The candidate row is inserted into B. Note: The data values allowable in the candidate row may be constrained by a 2 2 2 2ITH CHECK OPTION constraint. The effect of a WITH CHECK OPTION constraint is defined in4he??eneral Rules of Subclause 11., "". Data manipulation 2 289 X3H2-9(g()¬4/DBL CBR-00() 10Ô0¢0¹0È0ë8 Leveling Rules 1) The following restrictions apply for!?ntermediate SQL: a) The leaf generally underlying4able of T shall not be gen- erally contained in the immediately contained in the except as the of a!!column reference>. 2) The following restrictions apply for Entry SQL in addition4o any Intermediate SQL restrictions: a) The!!query expression> that is contained in an shall be a or it shall be a!!ta- ble value constructor>4hat contains exactly one!!row value constructor> of the form "!!row value constructor list> ", and each!!row value constructor ele- ment> of that!!row value constructor list> shall be a!!value specification>. b) If4he data type of the target identified by4he i-th is an exact numeric type, then4he data type of the i- 4h item of the shall be an exact numeric 4ype. c)!?f the data4ype of4he4arget C identified by the i-th!!col- 5mn name> is character string, then4he length in characters of4he i-th item of the shall be less4han or equal4o the length of C. d) The!!insert columns and source> shall immediately contain a !!query expression>. 0Ø0ë0Ä0 Database Language SQL X3H2-9(g()¬4/DBL CBR-00() 10Ô0¢0¹0È0ë9 ª.9 Function Update a row of a table. Format ::= UPDATE
SET!!set clause list> 2 2 2 2HERE CURRENT OF ::= ["!!comma>!!set clause> }... ] !!set clause> ::= ::= =!!null specification> | DEFAULT ::= Syntax Rules 1) The containing shall contain a!!declare cursor> for a cursor7hose!!cursor name> is the same as the in4he!!update statement: positioned>. Let CR be4he cursor specified by!!cursor name>. (SA) CR shall be an updatable cursor. Note:5pdatable cursor is defined in Subclause ª.1, "". 0Î0Ã0È Let T be the table identified by the
. Let QS be the that is the simply5nderlying table of4he simply underlying4able of CR. The simply5nderlying table of QS shall be T. Note: The simply underlying4able of a is defined in Subclause 10Ô0¢0¹0È0ë1, "". 2 2 2) If CR is an ordered cursor, then for each OC, the column of T identified by OC shall not be directly or in- directly referenced in4he!!order by clause> of the defining !!cursor specification> for CR. Data manipulation 0Ø0ë0Ä1 X0ß0¯0í0ó(g()92-154e¤BL CBR-002 ª.9!!update statement: positioned> 5) No leaf generally underlying4able of T shall be an underly- ing4able of any generally contained in any immediately contained in any contained in4he!!set clause list>. 6) A!!value expression> in a!!set clause> shall not directly con- tain a!!set function specification>. 5 5 5) The same!!object column> shall not appear more4han once in a . 8) If4he cursor identified by was specified using an explicit or implicit of FOR UPDATE, 4hen each!!column name> specified as an!!object column> shall identify a column in the explicit or implicit!!column name list> associated7ith the . 9) The scope of4he!!table name> is4he entire . 10)For every!!set clause>,4he Syntax Rules of Subclause 9.2, "Store assignment", apply to4he column of T identified by4he !!object column> and4he!!value expression> of4he!!set clause> as TARGET and VALUE, respectively. Access Rules 1) The applicable privileges shall include UPDATE for each!!object column>. Note: The applicable privileges for a!!table name> are defined in Subclause 10.0Ñ0ü0Ä "". 2) Each!!column name> specified as an!!object column> shall iden- 4ify a column of T. ??eneral Rules 1) If4he access mode of the current SQL-transaction is read-only and T is not a temporary table,4hen an exception condition is raised: invalid transaction state. 2) If cursor CR is not positioned on a row,4hen an exception con- dition is raised: invalid cursor state. 0Î0Ã0È The object row is4hat row from7hich4he current row of CR is derived. 2 2 2) If, while CR is open, the object row has been marked for dele- 4ion by any!!delete statement: searched>, marked for deletion by any 4hat identifies any cursor other than CR,5pdated by any , or 5pdated by any 4hat identifies any cursor other than CR,4hen a completion condition is raised: warning-cursor operation conflict. 2 292 Database Language SQL X0ß0¯0í0ó(g()92-154e¤BL CBR-002 ª.9!!update statement: positioned> 5) The value of DEFAULT is the default value indicated in4he col- umn descriptor for4he!!object column> in the containing!!set clause>. 5 5) The s are effectively evaluated before5pdat- ing the object row. If a!!value expression> contains a reference 4o a column of T,4hen the reference is4o the value of4hat column in the object row before any value of4he object row is 5pdated. 7) CR remains positioned on its current row, even if an exception condition is raised during derivation of any!!value expression> associated7ith the object row. 8) A!!set clause> specifies an object column and an update6alue of that column. The object column is the column identified by 4he!!object column> in the . The update6alue is the value specified by4he!!update source>. Note: The data values allowable in the object row may be con- strained by a 2 2 2 2ITH CHECK OPTION constraint. The effect of a 2 2 2 2ITH CHECK OPTION constraint is defined in the General Rules of Subclause 11., "". 9) The object row is updated as specified by each!!set clause>. For each , the value of4he specified object column, denoted by C, is replaced by4he specified5pdate value, denoted by SV. The General Rules of Subclause 9.2, "Store assignment", are applied to C and SV as TARGET and VALUE, respectively. Leveling Rules 1) The following restrictions apply for Intermediate SQL: a) CR shall not be an ordered cursor. 2) The following restrictions apply for Entry SQL in addition4o any Intermediate SQL restrictions: a)!?f the data4ype of4he column identified by the i-th!!object column> is an exact numeric4ype,4hen the data4ype of4he i-th in the shall be an exact numeric4ype. b)!?f the data4ype of4he column identified by the i-th!!object column> C is character string, then4he length in characters of4he i-th in the shall be less4han or equal4o the length of C. c) An shall not specify DEFAULT. Data manipulation 0Ø0ë0Ä0ª0ü0à X0ß0¯0í0ó(g()92-154e¤BL CBR-002 ª.10 ª.10 !!update statement: searched> Function Update rows of a table. Format ::= UPDATE
SET!!set clause list> [ 2 2 2 2HERE!!search condition> ] Syntax Rules 1) Let T be the table identified by the
. T shall be an updatable table. 2) A in a shall not directly con- 4ain a . 0Î0Ã0È The same shall not appear more than once in a !!set clause list>. 4) The scope of the
is the entire!!update statement: searched>. 5) For every , the Syntax Rules of Subclause 9.(l4) "Store assignment"+"+ apply4o the column of T identified by the and the of the as TARGET and VALUE, respectively. Access Rules 1) The applicable0rivileges shall include UPDATE for each . Note: The applicable0rivileges for a
are defined in Subclause 10.3, "". (SA) Each specified as an shall iden- tify a column of T. General Rules 1)!?f the access mode of4he current SQL-transaction is read-anly and T is not a4emporary4able, then an exception condition is raised: invalid4ransaction state. (SA) Case: a)!?f a is not specified,4hen all rows of T are the object rows. 2 294 Database Language SQL X0ß0¯0í0ó(g()92-154e¤BL CBR-002 10Ô0¢0¹0È0ë10!!update statement: searched> b)!?f a is specified,4hen it is applied to each row of T7ith the
bound4o that row, and the object rows are those rows for7hich4he result of 4he!!search condition> is4rue. The!!search condition> is effectively evaluated for each row of T before updating any row of T. Each!!subquery> in4he!!search condition> is effectively executed for each row of T and the results used in the ap- plication of4he!!search condition> to4he given row of T. !?f any executed!!subquery> contains an outer reference to a column of T, the reference is4o the value of4hat column in the given row of T. Note: Outer reference is defined in Subclause 5 5.4, "". 0Î0Ã0È!?f any row in4he set of object rows has been marked for dele- tion by any 4hat identifies some cursor CR that is still open or updated by any!!update state- ment: positioned> that identifies some cursor CR4hat is still open,4hen a completion condition is raised: warning-cursor operation conflict. 2 2 2) If4he set of object rows is empty, then a completion condition is raised: no data. 5)!?f a completion condition no data has been raised, then no fur- 4her General Rules of4his Subclause are applied. 5 5) The s are effectively evaluated for each row of T before5pdating any row of T. 7) A!!set clause> specifies an object column and an update6alue of that column. The object column is the column identified by 4he!!object column> in the . The update6alue is the value specified by4he!!update source>. Note: The data values allowable in the object row may be con- strained by a 2 2 2 2ITH CHECK OPTION constraint. The effect of a 2 2 2 2ITH CHECK OPTION constraint is defined in the General Rules of Subclause 11., "". 8) Each object row is5pdated as specified by each . For each!!set clause>,4he6alue of the specified object column, denoted by C, is replaced by the specified update6alue, denoted by SV. The??eneral Rules of Subclause 9.(l4) "Store assignment"+"+ are applied4o C and SV as TARGET and VALUE, respectively. Data manipulation 2 295 X3H2-9(g()¬4/DBL CBR-00() 10Ô0¢0¹0È0ë10!!update statement: searched> Leveling Rules 1) The following restrictions apply for Intermediate SQL: a) No leaf generally underlying4able of T shall be an under- lying4able of any generally contained in the or in any!!value expression> immedi- ately contained in any!!update source> contained in the . 2) The following restrictions apply for Entry SQL in addition4o any Intermediate SQL restrictions: a)!?f the data4ype of4he column identified by the i-th!!object column> is an exact numeric4ype,4hen the data4ype of4he i-th in the shall be an exact numeric4ype. b)!?f the data4ype of4he column identified by the i-th!!object column> C is character string, then4he length in characters of4he i-th in the shall be less4han or equal4o the length of C. 0Ø0ë0Ä6 Database Language SQL X3H2-9(g()¬4/DBL CBR-00() 10Ô0¢0¹0È0ë!!temporary table declaration> ª.11 !!temporary table declaration> Function Declare a declared local4emporary4able4hat will be effectively materialized the first time4hat any in4he!!module> 4hat contains4he!!temporary table declaration> is executed and whose scope is all4he!!procedure>s of4hat executed 7ithin the same SQL-session. Format !!temporary table declaration> ::= DECLARE LOCAL TEMPORARY TABLE!!qualified local table name>
[ ON COMMIT" PRESERVE | DELETE( ROWS ] Syntax Rules 1) Let T be the of . T shall be different from the of any other contained within4he!!module>. 2) Let A be4he current!!authorization identifier>. 2 2) The descriptor of the table defined by a!!temporary table decla- ration> includes the name of T and the column descriptor speci- fied by each . The i-th column descriptor is given by the i-th!!column definition>. 4) A!!temporary table declaration> shall contain at least one . 5) If ON COMMIT is not specified,4hen ON COMMIT DELETE ROWS is implicit. Access Rules None. ??eneral Rules 1) Let U be4he implementation-dependent that is effectively derived from4he implementation-dependent SQL- session identifier associated7ith the SQL-session and an implementation-dependent name associated with4he!!module> that contains the . 2) The definition of T within a!!module> is effectively equivalent to4he definition of a0ersistent base4able U.T. Within4he module, any reference4o MODULE.T is equivalent4o a reference to U.T. Data manipulation 0Ø0ë0Ä7 X0ß0¯0í0ó(g()92-154e¤BL CBR-002 ª.11 2 2) A set of0rivilege descriptors is created that define the priv- ileges!?NSERT, SELECT, UPDATE, DELETE, and REFERENCES on4his table and INSERT (), UPDATE (), and REFERENCES () for every!!column definition> in the table definition4o A. These0rivileges are not grantable. The grantor for each of4hese0rivilege descriptors is set to4he special grantor6alue "_SYSTEM". 4) The definition of a4emporary4able0ersists for the duration of the SQL-session. The4ermination of the SQL-session is effec- tively followed by4he execution of the following 7ith the current and current!!schema name> U7ithout further Access Rule checking: DROP TABLE T 5) The definition of a declared local4emporary4able does not appear in any view of the Information Schema. Leveling Rules 1) The following restrictions apply for!?ntermediate SQL: a) Conforming Intermediate SQL language shall not contain any . 2) The following restrictions apply for Entry SQL in addition4o any Intermediate SQL restrictions: None. 2 298 Database Language SQL X0ß0¯0í0ó(g()92-154e¤BL CBR-002  Transaction management 14.1 !!set transaction statement> Function Set the attributes of the next SQL-transaction for4he SQL-agent. Format !!set transaction statement> ::= SET TRANSACTION!!transaction mode> [ { (... ] !!transaction mode> ::= | | !!transaction access mode> ::= READ ONLY = READ WRITE ::= ISOLATION LEVEL !!level of isolation> ::= READ UNCOMMITTED = READ COMMITTED | REPEATABLE READ | SERIALIZABLE !!diagnostics size> ::= DIAGNOSTICS SIZE!!number of conditions> ::=!!simple6alue specification> Syntax Rules 1) No shall be specified more4han once. (SA)!?f an!!isolation level> is not specified,4hen a of ISOLATION LEVEL SERIALIZABLE is implicit. 0Î0Ã0È!?f READ 2 2 2 2RITE is specified,4hen the shall not be READ UNCOMMITTED. Transaction management 2 299 X3H2-9(g()¬4/DBL CBR-00() 14.1 2 2 2) If a!!transaction access mode> is not specified and a of READ UNCOMMITTED is specified,4hen READ ONLY is implicit. Otherwise, READ 2 2 2 2RITE is implicit. 5) The data type of shall be exact numeric with scale 0. Access Rules None. General Rules 1)!?f a statement is executed when an SQL-transaction is currently active,4hen an exception condition is raised: invalid transaction state. 2) If!!number of conditions> is specified and is less4han 1,4hen an exception condition is raised: invalid condition number. 0Î0Ã0È Let TXN be the next SQL-transaction for4he SQL-agent. 4)!?f READ ONLY is specified, then4he access mode of TXN is set4o read-anly.!?f READ 2 2 2 2RITE is specified,4hen the access mode of TXN is set to read-write. 5) The isolation level of TXN is set to an implementation-defined isolation level4hat will not exhibit any of the phenomena that 4he explicit or implicit 7ould not exhibit, as specified in Table 9, "SQL-transaction isolation levels and 4he4hree0henomena". 5 5) If!!number of conditions> is specified, then4he diagnostics area limit of TXN is set to!!number of conditions>. 5 5 5) If!!number of conditions> is not specified, then4he diagnostics area limit of TXN is set to an implementation-dependent6alue not less than 1. Leveling Rules 1) The following restrictions apply for!?ntermediate SQL: None. (SA) The following restrictions apply for Entry SQL in addition to any!?ntermediate SQL restrictions: a) Conforming Entry SQL language shall not contain any . 400 Database Language SQL X3H2-9(g()¬4/DBL CBR-00() 14.(N) .2 Function If an SQL-transaction is currently active,4hen set the constraint mode for4hat SQL-transaction in4he current SQL-session. If no SQL-transaction is currently active, then set4he constraint mode for the next SQL-transaction in the current SQL-session for the SQL-agent. Format !!set constraints mode statement> ::= SET CONSTRAINTS " DEFERRED | IMMEDIATE } !!constraint name list> ::= ALL | [ { }... ] Syntax Rules 1) If a!!constraint name> is specified,4hen it shall identify a constraint. (SA) The constraint identified by shall be DEFERRABLE. Access Rules None. ??eneral Rules 1) If an SQL-transaction is currently active,4hen let TXN be4he currently active SQL-transaction. Otherwise, let TXN be4he next SQL-transaction for the SQL-agent. 2) If!?MMEDIATE is specified,4hen Case: a)!?f ALL is specified, then4he constraint mode in TXN of all constraints4hat are DEFERRABLE is set to immediate. b) Otherwise,4he constraint mode in TXN for the constraints identified by the s in the is set to immediate. 0Î0Ã0È!?f DEFERRED is specified,4hen Transaction management 401 X0ß0¯0í0ó(g()92-154e¤BL CBR-002 .2!!set constraints mode statement> Case: a) If ALL is specified,4hen the constraint mode in TXN of all constraints that are DEFERRABLE is set4o deferred. b) Otherwise,4he constraint mode in TXN for the constraints identified by the s in the is set to deferred. Leveling Rules 1) The following restrictions apply for Intermediate SQL: a) Conforming!?ntermediate SQL language shall not contain any !!set constraints mode statement>. 2) The following restrictions apply for Entry SQL in addition4o any Intermediate SQL restrictions: None. 2 2 202 Database Language SQL X0ß0¯0í0ó(g()92-154e¤BL CBR-002 .3!!commit statement> 14.0µ0ó0Á0ü0à!!commit statement> Function Terminate4he current SQL-transaction7ith commit. Format !!commit statement> ::= COMMIT [ 2 2 2 2ORK ] Syntax Rules None. Access Rules None. General Rules 1)!?f the current SQL-transaction is0art of an encompassing4rans- action4hat is controlled by an agent other than4he SQL-agent, then an exception condition is raised: invalid4ransaction4er- mination. (SA) For every open cursor CR in any!!module> associated7ith the current SQL-transaction,4he following statement is implicitly executed: CLOSE CR 2 2) For every temporary table in any!!module> associated7ith the current SQL-transaction that specifies4he ON COMMIT DELETE option and4hat was updated by4he current SQL-transaction, the execution of4he!!commit statement> is effectively0receded by 4he execution of a 4hat specifies DELETE FROM T,7here T is the
of that4emporary 4able. 4) The effects specified in the General Rules of Subclause 14.(l4) "" occur as if the statement SET CONSTRAINTS ALL IMMEDIATE were executed. 5) Case: a) If any constraint is not satisfied, then any changes4o SQL- data or schemas4hat were made by4he current SQL-transaction are canceled and an exception condition is raised: transac- 4ion rollback-integrity constraint violation. Transaction management 400ª0ü0à X0ß0¯0í0ó(g()92-154e¤BL CBR-002 .3!!commit statement> b)!?f any other error preventing commitment of4he SQL- transaction has occurred, then any changes4o SQL-data or schemas that7ere made by the current SQL-transaction are canceled and an exception condition is raised:4ransaction rollback with an implementation-defined subclass value. c) Otherwise, any changes to SQL-data or schemas4hat were made by4he current SQL-transaction are made accessible4o all concurrent and subsequent SQL-transactions. 6) The current SQL-transaction is terminated. Leveling Rules 1) The following restrictions apply for!?ntermediate SQL: None. (SA) The following restrictions apply for Entry SQL in addition to any!?ntermediate SQL restrictions: a) In conforming Entry SQL language, WORK shall be specified. 404 Database Language SQL X3H2-9(g()¬4/DBL CBR-00() 14.4 .4 Function Terminate the current SQL-transaction with rollback. Format ::= ROLLBACK [ WORK ] Syntax Rules None. Access Rules None. ??eneral Rules 1) If4he current SQL-transaction is part of an encompassing trans- action that is controlled by an agent other4han the SQL-agent and the is not being implicitly executed, 4hen an exception condition is raised: invalid transaction ter- mination. 2) For every open cursor CR in any associated with4he current SQL-transaction, the following statement is implicitly executed: CLOSE CR 0Î0Ã0È Any changes4o SQL-data or schemas that7ere made by the current SQL-transaction are canceled. 4) The current SQL-transaction is terminated. Leveling Rules 1) The following restrictions apply for!?ntermediate SQL: None. (SA) The following restrictions apply for Entry SQL in addition to any!?ntermediate SQL restrictions: a) In conforming Entry SQL language, WORK shall be specified. Transaction management 405 X0ß0¯0í0ó(g()92-154e¤BL CBR-002 2 2 20 Database Language SQL X0ß0¯0í0ó(g()92-154e¤BL CBR-002 ¬ Connection management ¬.1 Function Establish an SQL-connection. Format !!connect statement> ::= CONNECT TO ::= [ AS!!connection name> ] [ USER ] | DEFAULT Syntax Rules 1)!?f is not specified, then an implementation-defined !!user name> for4he SQL-connection is implicit. Access Rules None. ??eneral Rules 1) If a!!connect statement> is executed after4he first4ransaction- initiating SQL-statement executed by4he current SQL-transaction and4he implementation does not support4ransactions that affect more4han one SQL-server, then an exception condition is raised: feature not supported-multiple server4ransactions (SA)!?f is specified, then let S be the character string 4hat is4he6alue of and let V be4he character string that is the value of TRIM ( BOTH ' ' FROM CV ) 0Î0Ã0È!?f V does not conform4o the Format and Syntax Rules of an , then an exception condition is raised: invalid authorization specification. Connection management 407 X0ß0¯0í0ó(g()92-154e¤BL CBR-002 ¬.1!!connect statement> 4)!?f the 4hat contains4he!!procedure>4hat contains4he !!connect statement> specifies a!!module authorization identi- fier>, then7hether or not must be identical to4hat is implementation-defined, as are any other restrictions on the value of!!user name>. Otherwise, any restrictions on4he6alue of are implementation-defined. 5)!?f the value of!!user name>6iolates the implementation-defined restrictions,4hen an exception condition is raised: invalid authorization specification. 5 5) If!!connection name>7as specified, then let CV be4he6alue of the immediately contained in .!?f neither DEFAULT nor were specified, then let CV be4he6alue of . Let CN be4he result of TRIM ( BOTH ' ' FROM CV ) !?f CN does not conform to4he Format and Syntax Rules of an !!identifier>,4hen an exception condition is raised: invalid connection name. 5 5 5) If an SQL-connection7ith name CN has already been established by the current SQL-agent and has not been disconnected, or if DEFAULT is specified and a default SQL-connection has already been established by4he current SQL-agent and has not been dis- connected, then an exception condition is raised: connection exception-connection name in5se. 8) Case: a)!?f DEFAULT is specified, then4he default SQL-session is initiated and associated7ith the default SQL-server. The method by which the default SQL-server is determined is implementation-defined. b) Otherwise, an SQL-session is initiated and associated with 4he SQL-server identified by . The method by 7hich!!SQL-server name> is used4o determine the appropriate SQL-server is implementation-defined. 9)!?f the successfully initiates an SQL- session, then: a) The current SQL-connection and current SQL-session, if any, become a dormant SQL-connection and a dormant SQL-session, respectively. The SQL-server context information is0reserved and is not affected in any way by operations performed over 4he initiated SQL-connection. Note: The SQL-session context information is defined in Subclause 4.0Ô0³, "SQL-sessions". 408 Database Language SQL X3H2-9(g()¬4/DBL CBR-00() ¬.1!!connect statement> b) The SQL-session initiated by4he!!connect statement> becomes 4he current SQL-session and4he SQL-connection established to 4hat SQL-session becomes the current SQL-connection. Note:!?f the fails to initiate an SQL- session,4hen the current SQL-connection and current SQL- session, if any, remain unchanged. 10)If4he SQL-client cannot establish4he SQL-connection,4hen an exception condition is raised: connection exception- SQL-client 5nable to establish SQL-connection. 11)If4he SQL-server rejects the establishment of4he SQL- connection, then an exception condition is raised: connection exception- SQL-server rejected establishment of SQL-connection. )The SQL-server for the subsequent execution of s in any s associated7ith the SQL-agent is set4o the SQL-server identified by!!SQL-server name>. ª)The SQL-session!!authorization identifier> is set4o . Leveling Rules 1) The following restrictions apply for Intermediate SQL: a) Conforming!?ntermediate SQL language shall not contain any !!connect statement>. (SA) The following restrictions apply for Entry SQL in addition to any!?ntermediate SQL restrictions: None. Connection management 409 X0ß0¯0í0ó(g()92-154e¤BL CBR-002 ¬.2!!set connection statement> 15.(N)!!set connection statement> Function Select an SQL-connection from4he available SQL-connections. Format !!set connection statement> ::= SET CONNECTION!!connection object> !!connection object> ::= DEFAULT =!!connection name> Syntax Rules None. Access Rules None. ??eneral Rules 1) If a!!set connection statement> is executed after the first transaction-initiating SQL-statement executed by4he current SQL-transaction and4he implementation does not support4rans- actions that affect more4han one SQL-server, then an excep- 4ion condition is raised: feature not supported-multiple server 4ransactions. 2) Case: a) If DEFAULT is specified and there is no default SQL- connection that is current or dormant for4he current SQL- agent,4hen an exception condition is raised: connection exception-connection does not exist. b) Otherwise, if does not identify an SQL- session that is current or dormant for4he current SQL-agent, then an exception condition is raised: connection exception- connection does not exist. 0Î0Ã0È!?f the SQL-connection identified by!!connection object> cannot be selected,4hen an exception condition is raised: connection exception-connection failure. 2 2 2) The current SQL-connection and current SQL-session become a dor- mant SQL-connection and a dormant SQL-session, respectively. 2 2 210 Database Language SQL X0ß0¯0í0ó(g()92-154e¤BL CBR-002 ¬.2!!set connection statement> The SQL-server context information is preserved and is not af- fected in any7ay by operations0erformed over the selected SQL-connection. Note: The SQL-session context information is defined in Subclause 4.0Ô0³, "SQL-sessions". 5) The SQL-connection identified by becomes the current SQL-connection and4he SQL-session associated with4hat SQL-connection becomes4he current SQL-session. All SQL-session context information is restored to4he same state as at the time 4he SQL-connection became dormant. Note: The SQL-session context information is defined in Subclause 2 2 2.30, "SQL-sessions". 5 5) The SQL-server for4he subsequent execution of!!procedure>s in any!!module>s associated with4he SQL-agent is set to4hat of 4he current SQL-connection. Leveling Rules 1) The following restrictions apply for Intermediate SQL: a) Conforming!?ntermediate SQL language shall not contain any !!set connection statement>. 2) The following restrictions apply for Entry SQL in addition4o any Intermediate SQL restrictions: None. Connection management 411 X0ß0¯0í0ó(g()92-154e¤BL CBR-002 ¬.3!!disconnect statement> 15.0µ0ó0Á0ü0à!!disconnect statement> Function Terminate an SQL-connection. Format !!disconnect statement> ::= DISCONNECT!!disconnect object> !!disconnect object> ::= !!connection object> = ALL = CURRENT Syntax Rules None. Access Rules None. ??eneral Rules 1) If!!connection name> is specified and does not identify an SQL-connection that is current or dormant for 4he current SQL-agent, then an exception condition is raised: connection exception-connection does not exist. 2) If DEFAULT is specified and there is no default SQL-connection 4hat is current or dormant for the current SQL-agent,4hen an exception condition is raised: connection exception-connection does not exist. 0Î0Ã0È!?f CURRENT is specified and4here is no current SQL-connection for the current SQL-agent,4hen an exception condition is raised: connection exception-connection does not exist. 4) Let C be the current SQL-connection. 5) Let L be a list of SQL-connections.!?f a is specified, then L is that SQL-connection.!?f CURRENT is spec- ified, then L is the current SQL-connection, if any. If ALL is specified,4hen L is a list representing every SQL-connection that is current or dormant for4he current SQL-agent, in an implementation-dependent order. If DEFAULT is specified,4hen L is4he default SQL-connection. 5 5) If any SQL-connection in L is active, then an exception condi- 4ion is raised: invalid4ransaction state. 41(N) Database Language SQL X3H2-9(g()¬4/DBL CBR-00() 15.0µ0ó0Á0ü0à 7) For every SQL-connection C1 in L,4reating the SQL-session S1 identified by C1 as4he current SQL-session, all of4he actions 4hat are required after4he last call of a by an SQL-agent, except for the execution of a!!rollback statement> or a!!commit statement>, are0erformed. C1 is terminated, re- gardless of any exception condition that might occur during the disconnection process. Note: See the General Rules of Subclause 1(‘Ñ)1, ""+"+ for 4he actions4o be0erformed after4he last call of a by an SQL-agent. 8) If any error is detected during execution of a!!disconnect statement>,4hen a completion condition is raised: warning- disconnect error. 9) If C is contained in L, then4here is no current SQL-connection following the execution of4he!!disconnect statement>. Otherwise, C remains the current SQL-connection. Leveling Rules 1) The following restrictions apply for!?ntermediate SQL: a) Conforming Intermediate SQL language shall not contain any . (SA) The following restrictions apply for Entry SQL in addition to any!?ntermediate SQL restrictions: None. Connection management 2 2 2ª X3H2-9(g()¬4/DBL CBR-00() 414 Database Language SQL X3H2-9(g()¬4/DBL CBR-00() 16 Session management ­.1 Function Set4he default catalog name for unqualified s in !!preparable statement>s4hat are prepared in the current SQL- session by an or a!!prepare state- ment> and in!!direct SQL statement>s4hat are invoked directly. Format ::= SET CATALOG Syntax Rules 1) The!!data4ype> of the shall be an SQL character data4ype. Access Rules None. ??eneral Rules 1) Let S be4he character string that is the value of4he!!value specification> and let V be the character string4hat is4he 6alue of TRIM ( BOTH ' ' FROM S ) (SA)!?f V does not conform4o the Format and Syntax Rules of a!!cat- alog name>,4hen an exception condition is raised: invalid catalog name. 0Î0Ã0È The default catalog name of4he current SQL-session is set to V. Leveling Rules 1) The following restrictions apply for!?ntermediate SQL: a) Conforming Intermediate SQL language shall not contain any . Session management 415 X0ß0¯0í0ó(g()92-154e¤BL CBR-002 ­.1!!set catalog statement> (SA) The following restrictions apply for Entry SQL in addition to any!?ntermediate SQL restrictions None. 2 2 2­ Database Language SQL X0ß0¯0í0ó(g()92-154e¤BL CBR-002 ­.2!!set schema statement> 16.(N)!!set schema statement> Function Set4he default schema name for5nqualified!!qualified name>s in !!preparable statement>s4hat are prepared in the current SQL- session by an or a!!prepare state- ment> and in!!direct SQL statement>s4hat are invoked directly. Format ::= SET SCHEMA Syntax Rules 1) The data type of the shall be an SQL char- acter data4ype. Access Rules None. ??eneral Rules 1) Let S be4he character string that is the value of4he!!value specification> and let V be the character string4hat is4he 6alue of TRIM ( BOTH ' ' FROM S ) (SA)!?f V does not conform4o the Format and Syntax Rules of a !!schema name>, then an exception condition is raised: invalid schema name. 0Î0Ã0È Case: a)!?f V conforms4o the Format and Syntax Rules for a that contains a , then let X be the 0art and let Y be4he!!unqualified schema name> 0art of V. The following statement is implicitly executed: SET CATALOG 'X' and4he!!set schema statement> is effectively replaced by: SET SCHEMA 'Y' b) Otherwise, the default unqualified schema name of4he current SQL-session is set to V. Session management 2 2 2 X3H2-9(g()¬4/DBL CBR-00() 16.(N) Leveling Rules 1) The following restrictions apply for!?ntermediate SQL: a) Conforming Intermediate SQL language shall not contain any . (SA) The following restrictions apply for Entry SQL in addition to any!?ntermediate SQL restrictions: None. 2 2 2 Database Language SQL X0ß0¯0í0ó(g()92-154e¤BL CBR-002 16.0µ0ó0Á0ü0à 16.0µ0ó0Á0ü0à!!set names statement> Function Set the default character set name for!!identifier>s and!!character string literal>s in!!preparable statement>s4hat are prepared in 4he current SQL-session by an!!execute immediate statement> or a !!prepare statement> and in s that are invoked directly. Format !!set names statement> ::= SET NAMES!!value specification> Syntax Rules 1) The!!data4ype> of the shall be an SQL character data4ype. Access Rules None. ??eneral Rules 1) Let S be4he character string that is the value of4he!!value specification> and let V be the character string4hat is4he 6alue of TRIM ( BOTH ' ' FROM S ) (SA)!?f V does not conform4o the Format and Syntax Rules of a!!char- acter set name>,4hen an exception condition is raised: invalid character set name. 0Î0Ã0È The default character set name of4he current SQL-session is set to V. Leveling Rules 1) The following restrictions apply for!?ntermediate SQL: a) Conforming Intermediate SQL language shall not contain any . 2) The following restrictions apply for Entry SQL in addition4o any Intermediate SQL restrictions: None. Session management 2 2 2 X3H2-9(g()¬4/DBL CBR-00() 16.4 ­.4 Function Set the of the current SQL-session. Format ::= SET SESSION AUTHORIZATION!!value specification> Syntax Rules 1) The of4he!!value specification> shall be an SQL character data type. Access Rules None. General Rules 1)!?f a is ex- ecuted and an SQL-transaction is currently active,4hen an exception condition is raised: invalid transaction state. 2) Let S be4he character string that is the value of4he!!value specification> and let V be the character string4hat is4he 6alue of TRIM ( BOTH ' 'FROM S ) 2 2) If V does not conform to4he Format and Syntax Rules of an!!au- thorization identifier>,4hen an exception condition is raised: invalid authorization specification. 2 2 2) Whether or not4he!!authorization identifier> for the SQL- session can be set to an other4han the of the SQL-session when4he SQL-session is started is implementation-defined, as are any restrictions0ertaining to such changes. 5) If4he current!!authorization identifier> is restricted from setting4he!!authorization identifier> to4he specified6alue, then an exception condition is raised: invalid authorization specification. 6) Let T be any temporary table defined in4he currently active SQL-session.!?n all the privilege descriptors for T and for each of the columns of T, the is set to V. 420 Database Language SQL X3H2-9(g()¬4/DBL CBR-00() 16.4 7) The!!authorization identifier> of4he current SQL-session is set to V. Leveling Rules 1) The following restrictions apply for!?ntermediate SQL: None. (SA) The following restrictions apply for Entry SQL in addition to any!?ntermediate SQL restrictions: a) Conforming Entry SQL language shall not contain any . Session management 2 2 2(h*) X3H2-9(g()¬4/DBL CBR-00() 16.5 16.5 !!set local time+one statement> Function Set the default local time+one displacement for4he current SQL- session. Format !!set local time+one statement> ::= SET TIME ZONE!!set time+one value> !!set time+one value> ::= !!interval6alue expression> = LOCAL Syntax Rules 1) The of4he!!interval6alue expression> immediately contained in the shall be!?NTERVAL HOUR TO MINUTE. Access Rules None. General Rules 1) Case: a)!?f LOCAL is specified, then4he default local4ime zone dis- placement of4he current SQL-session is set to4he original implementation-defined default local4ime zone displace- ment that7as established7hen the current SQL-session was started. b) Otherwise, Case: i)!?f the value of4he!!interval6alue expression> is not the null value and is between!?NTERVAL -':59' and!?NTERVAL +'10Ú0ó0¹00',4hen the default local time+one displacement of 4he current SQL-session is set to4he6alue of the . ii) Otherwise, an exception condition is raised: data exception- invalid time+one displacement6alue. 42(N) Database Language SQL X3H2-9(g()¬4/DBL CBR-00() ­.5!!set local time+one statement> Leveling Rules 1) The following restrictions apply for!?ntermediate SQL; None. (SA) The following restrictions apply for Entry SQL; a) Conforming Entry SQL language shall not contain any!!set local time+one statement>. Session management 2 2 2(y>) X3H2-9(g()¬4/DBL CBR-00() 424 Database Language SQL X3H2-9(g()¬4/DBL CBR-00() 17 Dynamic SQL 17.1 Description of SQL item descriptor areas Function Specify4he identifiers, data4ypes, and codes used in SQL item descriptor areas. Syntax Rules 1) An SQL item descriptor area comprises the items specified in Table 17, "Data4ypes of s used in SQL item descriptor areas". (SA) Let DT be a data type. The data4ype T of a!!simple6alue spec- ification> or a!!simple4arget specification> SVT is said4o match the data4ype specified by4he item descriptor area if and only if one of the following conditions is true. Case: a) TYPE indicates NUMERIC and T is specified by NUMERIC(P,S), where P is4he6alue of PRECISION and S is4he6alue of SCALE. b) TYPE indicates DECIMAL and T is specified by DECIMAL(P,S), where P is4he6alue of PRECISION and S is4he6alue of SCALE. c) TYPE indicates INTEGER and T is specified by INTEGER. d) TYPE indicates SMALLINT and T is specified by SMALLINT. e) TYPE indicates FLOAT and T is specified by FLOAT(P), where P is4he6alue of PRECISION. f) TYPE indicates REAL and T is specified by REAL. g) TYPE indicates DOUBLE PRECISION and T is specified by DOUBLE PRECISION. h) TYPE indicates BIT and T is specified by BIT(L), where L is 4he6alue of LENGTH. i) TYPE indicates BIT VARYING and T is specified by BIT VARYING(L),7here Case: i) SVT is a!!simple6alue specification> and L is4he6alue of LENGTH. Dynamic SQL 2 2 2(ry) X3H2-9(g()¬4/DBL CBR-00() 17.1 Description of SQL item descriptor areas ii) SVT is a!!simple4arget specification> and L is not less than4he6alue of LENGTH. j) TYPE indicates CHARACTER and T is specified by CHARACTER(L), 7here L is the value of LENGTH and the formed by the values of CHARACTER_SET_CATALOG, CHARACTER_SET_SCHEMA, and CHARACTER_SET_NAME identifies4he character set of SVT. k) TYPE indicates CHARACTER VARYING and T is specified by CHARACTER VARYING(L), where the formed by the values of CHARACTER_SET_CATALOG, CHARACTER_SET_ SCHEMA, and CHARACTER_SET_NAME identifies the character set of SVT and Case: i) SVT is a!!simple6alue specification> and L is4he6alue of LENGTH. ii) SVT is a and L is not less 4han the value of LENGTH. 2 2) An item descriptor area is6alid if and only if TYPE indicates a code defined in Table 18, "Codes used for SQL data types in Dynamic SQL"+"+ and one of the following is4rue: Case: a) TYPE indicates NUMERIC and PRECISION and SCALE are6alid 0recision and scale6alues for the NUMERIC data4ype. b) TYPE indicates DECIMAL and PRECISION and SCALE are valid precision and scale values for4he DECIMAL data type. c) TYPE indicates FLOAT and PRECISION is a valid precision value for the FLOAT data4ype. d) TYPE indicates INTEGER, SMALLINT, REAL, or DOUBLE PRECISION. e) TYPE indicates BIT or BIT VARYING and LENGTH is a valid length6alue for4he BIT date type. f) TYPE indicates CHARACTER or CHARACTER VARYING, LENGTH is a6alid length value for the CHARACTER data4ype, and CHARACTER_SET_CATALOG, CHARACTER_SET_SCHEMA, and CHARACTER_ SET_NAME are a valid qualified character set name for4he CHARACTER data type. g) TYPE indicates a!!datetime4ype>, DATETIME_INTERVAL_CODE is a code specified in Table , "Codes associated with datetime data4ypes in Dynamic SQL", and PRECISION is a6alid6alue for4he!!time0recision> or!!timestamp precision> of the indicated datetime datatype. 2 2 2(Œ¡) Database Language SQL X0ß0¯0í0ó(g()92-154e¤BL CBR-002 .1 Description of SQL item descriptor areas h) TYPE indicates an!!interval4ype>, DATETIME_INTERVAL_CODE is a code specified in Table (eå), "Codes5sed for s in Dynamic SQL"+"+ and DATETIME_INTERVAL_PRECISION and PRECISION are6alid6alues for and!!interval fractional seconds precision> for an . Table 17-Data4ypes of s ________________used_in_SQL_item_descriptor_areas_________________ _____________Data_Type__________________________________ | TYPE = exact numeric7ith scale 0 = = | | | LENGTH = exact numeric7ith scale 0 = = | | | OCTET_LENGTH = exact numeric7ith scale 0 = = | | | RETURNED_LENGTH = exact numeric7ith scale 0 = = | | | RETURNED_OCTET_ = exact numeric7ith scale 0 = LENGTH = PRECISION | exact numeric with scale 0 | | = = = SCALE | exact numeric with scale 0 | | = = = DATETIME_INTERVAL_ | exact numeric with scale 0 | CODE | DATETIME_INTERVAL_ = exact numeric7ith scale 0 = = PRECISION | | | = = = NULLABLE | exact numeric with scale 0 | | = = =!?NDICATOR | exact numeric with scale 0 | | = = = DATA | matches data4ype specified by TYPE, | LENGTH, PRECISION, SCALE, DATETIME_ INTERVAL_CODE, DATETIME_INTERVAL_ PRECISION, CHARACTER_SET_CATALOG, CHARACTER_SET_SCHEMA, and CHARACTER_SET_ NAME | NAME = character string with character set SQL_ = = | TEXT and length not less4han 8 charac- | | =4ers = = | | | UNNAMED = exact numeric7ith scale 0 = = | | | COLLATION_CATALOG = character string with character set SQL_ = = | TEXT and length not less4han 8 charac- | 4ers = COLLATION_SCHEMA | character string7ith character set SQL_ | | = TEXT and length not less than 1(R´) charac-= = | ters | | = = Dynamic SQL 427 X0ß0¯0í0ó(g()92-154e¤BL CBR-002 .1 Description of SQL item descriptor areas Table 17-Data4ypes of s used ________________in_SQL_item_descriptor_areas_(Cont.)_______________ ______________Data_Type__________________________________ = COLLATION_NAME | character string7ith character set SQL_ | TEXT and length not less than 1(R´) charac- ters | CHARACTER_SET_ = character string with character set SQL_ = = CATALOG | TEXT and length not less4han 8 charac- | | =4ers = = | | | CHARACTER_SET_SCHEMA= character string with character set SQL_ = = | TEXT and length not less4han 8 charac- | | =4ers = = | | | CHARACTER_SET_NAME = character string with character set SQL_ = = | TEXT and length not less4han 8 charac- | |______________________|_ters______________________________________| = | | |Access Rules = = = | | None. General Rules 1) Table 18, "Codes used for SQL data types in Dynamic SQL"+"+ speci- fies4he codes associated with4he SQL data types. 2 2 2(R´) Database Language SQL X0ß0¯0í0ó(g()92-154e¤BL CBR-002 .1 Description of SQL item descriptor areas ______Table_-Codes_used_for_SQL_data_types_in_Dynamic_SQL_______ Data_Type__________________Code___________________________________ | Implementation-defined =!! 0 = data types = BIT |  | | = = = BIT VARYING | ¬ | | = = = CHARACTER | 1 | | = = = CHARACTER VARYING |  | | = = = DATE, TIME, or TIMESTAMP | 9 | | = = = DECIMAL | 0µ0ó0Á0ü0à | | = = = DOUBLE PRECISION | 8 | | = = = FLOAT | 6 | | = = =!?NTEGER | 4 | | = = =!?NTERVAL | 10 | | = = = NUMERIC | (N) | | = = = REAL | 7 | | = = =_SMALLINT_________________|_5_____________________________________| | = = (SA) Table 19, "Codes associated7ith datetime data types in Dynamic SQL"+"+ specifies4he codes associated with4he datetime data 4ypes. _Table_19-Codes_associated_with_datetime_data_types_in_Dynamic_SQL_ _Datetime_Data_Type_________Code___________________________________ = DATE | 1 | | = = = TIME | (N) | | = = = TIME WITH TIME ZONE | 4 | | = = = TIMESTAMP | 0µ0ó0Á0ü0à | | = = =_TIMESTAMP_WITH_TIME_ZONE_|_5_____________________________________| | = = 0Î0Ã0È Table 20, "Codes used for!!intervaliualifier>s in Dynamic SQL", specifies the codes associated7ith s for interval data types. Dynamic SQL 2 2 2(Nã) X3H2-9(g()¬4/DBL CBR-00() 17.1 Description of SQL item descriptor areas ____Table_(eå)-Codes_used_for_s_in_Dynamic_SQL___ _Datetime_Qualifier_________Code___________________________________ = DAY | 0µ0ó0Á0ü0à | | = = = DAY TO HOUR | 8 | | = = = DAY TO MINUTE | 9 | | = = = DAY TO SECOND | 10 | | = = =?!OUR | 4 | | = = =?!OUR TO MINUTE |  | | = = =?!OUR TO SECOND |  | | = = = MINUTE | 5 | | = = = MINUTE TO SECOND | ª | | = = = MONTH | (N) | | = = = SECOND | 6 | | = = = YEAR | 1 | | = = =_YEAR_TO_MONTH____________|_7_____________________________________| | = = Leveling Rules 1) The following restrictions apply for!?ntermediate SQL: None. (SA) The following restrictions apply for Entry SQL in addition to any!?ntermediate SQL restrictions: None. 430 Database Language SQL X3H2-9(g()¬4/DBL CBR-00() .2!!allocate descriptor statement> .2 Function Allocate an SQL descriptor area. Format !!allocate descriptor statement> ::= ALLOCATE DESCRIPTOR!!descriptor name> [ 2 2 2 2ITH MAX ] !!occurrences> ::=!!simple6alue specification> Syntax Rules 1) The data type of shall be exact numeric7ith scale 0. 2) If 2 2 2 2ITH MAX is not specified, then an implementation- defined default value for that is greater than 0 is implicit. Access Rules None. General Rules 1) Let S be the character string4hat is4he6alue of the 4hat is immediately contained in and let V be4he character string that is the result of TRIM ( BOTH ' ' FROM S ) !?f V does not conform4o the Format and Syntax Rules of an , then an exception condition is raised: invalid SQL descriptor name. (SA) The!!allocate descriptor statement> allocates an SQL descriptor area whose name is V and whose scope is specified by the . The descriptor area will have at least!!occurrences> number of item descriptor areas. All values are initially5n- defined. If an SQL descriptor has already been allocated whose name is V,7hose scope is specified by4he!!scope option>, and 4hat has not yet been deallocated, then an exception condition is raised: invalid SQL descriptor name. 0Î0Ã0È!?f is less than 1 or is greater4han an implementation- defined maximum6alue, then an exception condition is raised: dynamic SQL error-invalid descriptor index. The maximum number Dynamic SQL 431 X0ß0¯0í0ó(g()92-154e¤BL CBR-002 .2!!allocate descriptor statement> of SQL descriptor areas4hat can be allocated at one time is implementation-defined. Leveling Rules 1) The following restrictions apply for!?ntermediate SQL: a) An and a shall be a!!lit- eral>. (SA) The following restrictions apply for Entry SQL in addition to any!?ntermediate SQL restrictions: a) Conforming Entry SQL language shall not contain any Dynamic SQL language. 43(N) Database Language SQL X3H2-9(g()¬4/DBL CBR-00() .3!!deallocate descriptor statement> .3 Function Deallocate an SQL descriptor area. Format !!deallocate descriptor statement> ::= DEALLOCATE DESCRIPTOR!!descriptor name> Syntax Rules None. Access Rules None. ??eneral Rules 1) The deallocates an SQL de- scriptor area7hose name is4he6alue of the 's and7hose scope is specified by 4he!!scope clause>.!?f an SQL descriptor area is not currently allocated whose name is the value of4he!!descriptor name>'s !!simple6alue specification> and whose scope is specified by the , then an exception condition is raised: invalid SQL descriptor name. Leveling Rules 1) The following restrictions apply for!?ntermediate SQL: a) A!!descriptor name> shall be a . 2) The following restrictions apply for Entry SQL in addition4o any Intermediate SQL restrictions: a) Conforming Entry SQL language shall contain no Dynamic SQL language. Dynamic SQL 430ª0ü0à X0ß0¯0í0ó(g()92-154e¤BL CBR-002 .4!!get descriptor statement> 17.4 !!get descriptor statement> Function ??et information from an SQL descriptor area. Format !!get descriptor statement> ::= GET DESCRIPTOR!!descriptor name>!!get descriptor information> !!get descriptor information> ::= | VALUE ["!!comma>!!get item information> }... ] ::= COUNT ::= !!simple4arget specification (ŒÇ)!!equals operator>!!descriptor item name>> ::= !!simple4arget specification ´ ::=!!simple4arget specification> !!simple4arget specification (ŒÇ) ::=!!simple4arget specification> !!descriptor item name> ::= TYPE = LENGTH | OCTET_LENGTH = RETURNED_LENGTH = RETURNED_OCTET_LENGTH = PRECISION = SCALE = DATETIME_INTERVAL_CODE | DATETIME_INTERVAL_PRECISION | NULLABLE =!?NDICATOR = DATA | NAME = UNNAMED = COLLATION_CATALOG = COLLATION_SCHEMA | COLLATION_NAME = CHARACTER_SET_CATALOG = CHARACTER_SET_SCHEMA | CHARACTER_SET_NAME 434 Database Language SQL X3H2-9(g()¬4/DBL CBR-00() 17.4 Syntax Rules 1) The data type of shall be exact numeric7ith scale 0. 2) The data4ype of!!simple4arget specification ´ shall be exact numeric with scale 0. 0Î0Ã0È The data type of a shall be4he data type shown in Table , "Data types of!!key word>s5sed in SQL item descriptor areas"+"+ for4he corresponding!!descriptor item name>. Access Rules None. ??eneral Rules 1) If a!!descriptor name> specified in a identifies an SQL descriptor area4hat is not currently allocated, then an exception condition is raised: invalid SQL descriptor name. (SA)!?f the data4ype of4he!!simple4arget specification> associated with4he keyword DATA does not match4he data type specified by the item descriptor area, then an exception condition is raised: data exception-error in assignment. Note: Match is defined in the Syntax Rules of Subclause .1, "Description of SQL item descriptor areas". 0Î0Ã0È!?f the specified in a!!get descriptor statement> is greater4han the number of specified when4he !!descriptor name>7as allocated or less4han 1,4hen an excep- tion condition is raised: dynamic SQL error-invalid descriptor index. 4)!?f the specified in a!!get descriptor statement> is greater4han the value of COUNT, then a completion condition is raised: no data. 5)!?f a is executed4o get the value of DATA without getting the value of!?NDICATOR and4he6alue of INDICATOR is negative,4hen an exception condition is raised: data exception-null value, no indicator parameter. 5 5) If an exception condition is raised in a!!get descriptor state- ment>,4hen the values of all targets specified by!!simple4ar- get specification ´ and!!simple4arget specification (ŒÇ) are implementation-dependent. Dynamic SQL 435 X0ß0¯0í0ó(g()92-154e¤BL CBR-002 .4!!get descriptor statement> 5 5 5) A gets values in the SQL descriptor area specified by!!descriptor name>. The values are as follows: a) COUNT is a count of4he number of!!dynamic parameter specifi- cation>s or!!select list> columns described in item descrip- tor areas. b) The6alues of TYPE, LENGTH, OCTET_LENGTH, RETURNED_LENGTH, RETURNED_OCTET_LENGTH, PRECISION, SCALE, DATETIME_INTERVAL_ CODE, DATETIME_INTERVAL_PRECISION, COLLATION_CATALOG, COLLATION_SCHEMA, COLLATION_NAME, CHARACTER_SET_CATALOG, CHARACTER_SET_SCHEMA, and CHARACTER_SET_NAME are the data 4ype, length (in characters, bits, or0ositions, as appro- priate), length in octets, returned length in characters, returned length in octets,0recision, scale, datetime data 4ype, interval qualifier, collation, and character set of a!!dynamic parameter specification> or column, if4he column name is implementation-dependent, then NAME is4he implementation-dependent name for4he column and UNNAMED is set4o ± otherwise, NAME is the of4he column and UNNAMED is set4o 0. For a!!dynamic parameter specification>, the values of NAME and UNNAMED are implementation-dependent. d) DATA is a6alue for4he!!target specification> described by 4he item descriptor area specified by!!item number>. If4he 6alue of INDICATOR is negative,4hen the value of DATA is 5ndefined. e) INDICATOR is a6alue for4he!!indicator parameter> associated with4he!!target specification>. f) Case: i) For a!!select list> column, if NULLABLE is set to 1, then the column can have the null6alue; otherwise,4he column cannot have4he null value. ii) For a!!dynamic parameter specification>, NULLABLE is set 4o 1, indicating that4he!!dynamic parameter specification> can have4he null value. 2 2 20Ø0¯0¿0ü0ë Database Language SQL X0ß0¯0í0ó(g()92-154e¤BL CBR-002 .4!!get descriptor statement> Leveling Rules 1) The following restrictions apply for Intermediate SQL: a) A shall be a!!literal>. (SA) The following restrictions apply for Entry SQL in addition to any!?ntermediate SQL restrictions: a) Conforming Entry SQL language shall not contain any Dynamic SQL language. Dynamic SQL 437 X0ß0¯0í0ó(g()92-154e¤BL CBR-002 .5!!set descriptor statement> 17.5 !!set descriptor statement> Function Set information in an SQL descriptor area. Format !!set descriptor statement> ::= SET DESCRIPTOR!!descriptor name>!!set descriptor information> !!set descriptor information> ::= | VALUE ["!!comma>!!set item information> }... ] ::= COUNT ::= !!equals operator>!!simple6alue specification 2> !!simple6alue specification 1> ::= !!simple6alue specification 2> ::= !!item number> ::=!!simple6alue specification> Syntax Rules 1) The data type of shall be exact numeric7ith scale 0. 2) The data4ype of!!simple6alue specification 1> shall be an exact numeric with scale 0. 0Î0Ã0È The data type of a s used in SQL item descriptor areas", for the corresponding . shall not be RETURNED_LENGTH, RETURNED_OCTET_LENGTH, OCTET_LENGTH, NULLABLE, COLLATION_ CATALOG, COLLATION_SCHEMA, COLLATION_NAME, NAME, or UNNAMED. Other alternatives for!!descriptor item name> shall not be spec- ified more than once in a!!set descriptor statement>. Access Rules None. 438 Database Language SQL X3H2-9(g()¬4/DBL CBR-00() 17.5 General Rules 1)!?f a specified in a!!set descriptor state- ment> identifies an SQL descriptor area that is not currently allocated,4hen an exception condition is raised: invalid SQL descriptor name. 2) If4he!!item number> specified in a is greater than4he number of!!occurrences> specified7hen the was allocated or less than 1, then an excep- 4ion condition is raised: dynamic SQL error-invalid descriptor index. 2 2) A sets values in the SQL descriptor area specified by!!descriptor name>. The values are as follows: a) COUNT is a count of4he number of!!dynamic parameter specifi- cation>6alues or!!target specification>s described in item descriptor areas. b) TYPE, LENGTH, PRECISION, SCALE, DATETIME_INTERVAL_CODE, DATETIME_INTERVAL_PRECISION, CHARACTER_SET_CATALOG, CHARACTER_ SET_SCHEMA, and CHARACTER_SET_NAME are a description of the data4ype, length (in characters, bits, or0ositions, as ap- 0ropriate),0recision, scale, datetime data4ype, interval qualifier, and character set of a value or!!target specification> described by4he item descriptor area specified by!!item number>. c) DATA is a value for the described by4he item descriptor area specified by!!item number>. INDICATOR is a6alue for4he!!indicator parameter> associated with4he!!dynamic parameter specification>. 4) 2 2 2 2hen more4han one value is set in a single!!set descriptor statement>,4he6alues are effectively assigned in the fol- lowing order: TYPE, DATETIME_INTERVAL_CODE, DATETIME_INTERVAL_ PRECISION, PRECISION, SCALE, CHARACTER_SET_CATALOG, CHARACTER_ SET_SCHEMA, CHARACTER_SET_NAME, LENGTH,!?NDICATOR, and DATA. 2 2 2 2hen any value other than DATA is set, the value of DATA becomes undefined. 5) For every specified, let DIN be4he!!de- scriptor item name> and let V be4he6alue of the Case: a)!?f DIN is TYPE and V indicates CHARACTER or CHARACTER VARYING, then CHARACTER_SET_CATALOG, CHARACTER_SET_SCHEMA, and CHARACTER_SET_NAME are set4o the values for4he de- fault character set name for the SQL-session, LENGTH is set 4o 1, and all other item descriptor area fields are set4o implementation-dependent6alues. b)!?f DIN is TYPE and V indicates BIT or BIT VARYING, then LENGTH is set4o 1 and all other item descriptor area fields are set to implementation-dependent values. c) If DIN is TYPE and V indicates DATETIME,4hen PRECISION is set4o 0 and all other item descriptor area fields are set to implementation-dependent values. d) If DIN is TYPE and V indicates!?NTERVAL,4hen DATETIME_ INTERVAL_PRECISION is set to 2 and all other item descrip- 4or area fields are set4o implementation-dependent6alues. e)!?f DIN is TYPE and V indicates NUMERIC or DECIMAL, then SCALE is set to 0, PRECISION is set4o the implementation-defined default6alue for4he0recision of NUMERIC or DECIMAL data types, respectively, and all other item descriptor area fields are set4o implementation-dependent6alues. f)!?f DIN is TYPE and V indicates INTEGER or SMALLINT,4hen all other item descriptor area fields are set to implementation- dependent6alues. g)!?f DIN is TYPE and V indicates FLOAT,4hen PRECISION is set 4o the implementation-defined default6alue for4he0recision of FLOAT data4ypes and all other item descriptor area fields are set4o implementation-dependent6alues. h)!?f DIN is TYPE and V indicates REAL or DOUBLE PRECISION, then all other item descriptor area fields are set4o implementation-dependent6alues. i)!?f DIN is DATETIME_INTERVAL_CODE and TYPE is DATETIME, then i)!?f V indicates DATE, TIME, or TIME WITH TIME ZONE, then PRECISION is set4o 0 and all other item descriptor area fields are set4o implementation-dependent6alues. ii)!?f V indicates TIMESTAMP, or TIMESTAMP WITH TIME ZONE, then PRECISION is set4o 6 and all other item descriptor area fields are set4o implementation-dependent6alues. 2 2 240 Database Language SQL X0ß0¯0í0ó(g()92-154e¤BL CBR-002 .5!!set descriptor statement> j)!?f DIN is DATETIME_INTERVAL_CODE and TYPE is INTERVAL, then DATETIME_INTERVAL_PRECISION is set to 2 and i)!?f V indicates DAY TO SECOND,?!OUR TO SECOND, MINUTE TO SECOND, or SECOND,4hen PRECISION is set4o 6. ii) Otherwise, PRECISION is set4o 0. 5 5) If an exception condition is raised in a!!set descriptor statement>,4hen the values of all elements of the item de- scriptor area specified in the are implementation-dependent. 5 5 5) Restrictions on changing TYPE, LENGTH, PRECISION, DATETIME_ INTERVAL_CODE, DATETIME_INTERVAL_PRECISION, SCALE, CHARACTER_ SET_CATALOG, CHARACTER_SET_SCHEMA, and CHARACTER_SET_NAME values resulting from the execution of a!!describe statement> before execution of a ,!!dynamic open statement>, or are implementation-defined, except as specified in4he??eneral Rules of Subclause .9, "". Leveling Rules 1) The following restrictions apply for!?ntermediate SQL: a) A!!descriptor name> shall be a . 2) The following restrictions apply for Entry SQL in addition4o any Intermediate SQL restrictions: a) Conforming Entry SQL language shall not contain any Dynamic SQL language. Dynamic SQL 2 2 241 X3H2-9(g()¬4/DBL CBR-00() 17.6 17.6 !!prepare statement> Function Prepare a statement for execution. Format ::= PREPARE FROM !!SQL statement variable> ::= !!preparable statement> ::= | | =!!preparable SQL session statement> | ::= =!!dynamic single row select statement> =!!insert statement> | =!!update statement: searched> | | ::= !!preparable SQL4ransaction statement> ::= ::= !!SQL session statement> !!dynamic select statement> ::= !!dynamic single row select statement> ::=!!query specification> !!preparable implementation-defined statement> ::= !SMSee the Syntax Rules. 44(N) Database Language SQL X3H2-9(g()¬4/DBL CBR-00() .6!!prepare statement> Syntax Rules 1) The of shall not be a . 2) The data4ype of!!SQL statement variable> shall be character string. 2 2) The Format and Syntax Rules for are implementation-defined. Access Rules None. ??eneral Rules 1) Let P be4he contents of4he!!SQL statement variable>. 2) If P is a or a !!preparable dynamic5pdate statement:0ositioned>, then P refers to either a dynamic cursor7ith the same!!cursor name> or to an extended dynamic cursor whose 6alue is the same as the . Case: a) If both an extended dynamic cursor and a dynamic cursor with 4he same name as the exist,4hen an exception condition is raised: ambiguous cursor name. b)!?f there is neither an extended dynamic cursor nor a dynamic cursor7ith the name of ,4hen an exception condition is raised: invalid cursor name. 2 2) Let E1, E2, E3, and E4 be s of4he form "" or a!!dynamic parameter specifi- cation> enclosed in any number of matching parentheses. Let F be a 7hose data type is determined6ia??eneral Rules in Clause 5 5, "Scalar expressions" and4he Rules in this Subclause. Let X1, X2, X3, and X4 be s meeting the criteria for either En or F. 2 2 2) If one or more of the following are true, then an exception condition is raised: syntax error or access rule6iolation in dynamic SQL statement. a) P does not conform to4he Format, Syntax Rules, and Access Rules of a!!preparable statement>. b) P contains E1 as a simply contained in a !!select list>. c) P contains E1 as both operands of a single dyadic operator. Dynamic SQL 440ª0ü0à X0ß0¯0í0ó(g()92-154e¤BL CBR-002 .6!!prepare statement> d) P contains a!!value expression> of4he form "+ E1", "+"+"+ E1", "E1 COLLATE "+"+ or "EXTRACT ( FROM E1)". e) P contains a 7ith argument E1. f) P contains a 7ith a value E1 in the . g) P contains an!!overlaps0redicate> where E1 is the 4hat is4he second in either the first or second operands of the . h) P contains E1 as4he first operand of COALESCE or the first in a or both operands of NULLIF. i) P contains a or where E1 is both4he i-th in the that is the first operand and the i-th !!value expression> in4he!!row value constructor>4hat is4he second operand of4he!!comparison0redicate> or4he second or 4hird operand of the . j) P contains a in7hich4he i-th in each!!row value constructor> is E1 and either: i) P is not an!!insert statement>, or ii) P is an and4he!!table value construc- 4or> is not4he!!query expression> simply contained in the !!insert statement>. k) P contains an!!in0redicate> with an in7hich E1 is both the and the first of4he!!in6alue list>. l) P contains a!!position expression> in which both immediately contained!!character value expression>s are E1. m) P contains a or a whose immediately contained is E1. n) P contains a!!fold> whose operand is E1. o) P contains a whose or is E1. p) P contains a 7hose!!character value expression> is E1. q) P contains a . 2 2 244 Database Language SQL X0ß0¯0í0ó(g()92-154e¤BL CBR-002 17.6 5) Case: a) If E1 is followed by an !?Q,4hen the data4ype of E1 is assumed4o be!?NTERVAL IQ. b) In OCTET_LENGTH(E1), CHARACTER_LENGTH(E1), and CHARACTER_ LENGTH(E1), the data4ype of E1 is assumed4o be CHARACTER VARYING(L),7here L is the implementation-defined maximum 6alue of for CHARACTER VARYING. c) In POSITION(X1!?N X2), and SUBSTRING(X1 FROM X0µ0ó0Á0ü0àFOR X4), if X1 (X2) meets the criteria for E1, E(l4) E0Ñ0ü0Ä and E4,4hen the data4ype of X1 (X(SA) is assumed to be CHARACTER VARYING(L), where L is4he implementation-defined maximum value of !!length> for CHARACTER VARYING.!?f X3 (X4) meets the cri- 4eria for E1, E(l4) E0Ñ0ü0Ä and E4,4hen the data4ype of X0µ0ó0Á0ü0à(X4) is assumed to be NUMERIC(P,0), where P is4he implementation- defined maximum6alue of for NUMERIC. d)!?n a of the form "X1!!concatenation oper- ator> X2"+"+ if X1 (X2) meets the criteria for E1, E(l4) E0Ñ0ü0Ä and E4,4hen the data4ype of X1 (X(SA) is assumed to be CHARACTER VARYING(L), where L is4he implementation-defined maximum value of!!length> for CHARACTER VARYING. e)!?n BIT_LENGTH(E1), the data4ype of E1 is assumed4o be BIT VARYING(L),7here L is the implementation-defined maximum 6alue of for BIT VARYING. f) In a!!value expression> of4he form "E1 + ", " + E1" or " - E1", the data 4ype of E1 is assumed4o be Case: i) If4he!!datetime4erm> is a date data type, then4he data 4ype of E1 is assumed4o be!?NTERVAL YEAR(P) TO MONTH, 7here P is the implementation-defined maximum!!interval leading field precision>. ii) Otherwise,4he data type of E1 is assumed to be INTERVAL DAY(P) TO SECOND(F),7here P and F are4he implementation- defined maximum and max- imum , respectively. g)!?n a of the form " * E1" or " XëE1"+"+4he data type of E1 is assumed to be NUMERIC(P,0), where P is4he implementation-defined maximum value of!!precision> for NUMERIC. h) In all other!!value expression>s of the form "E1+ F", "E1- F"+"+ "E1* F", "E1/ F"+"+ "F + E1"+"+ "F - E1"+"+ "F * E1"+"+ or "F E1", the data4ype of E1 is assumed4o be4he data type of F. Dynamic SQL 2 2 245 X3H2-9(g()¬4/DBL CBR-00() 17.6 i)!?n a of the form "CAST (E1 AS )"+"+ "CAST (E1 AS )"+"+4he data type of E1 is the of4he specified domain or4he explicitly- specified!!data4ype>. j) If one or more operands of COALESCE are E1, then4he data type of E1 is assumed to be the data4ype of4he first operand. k) If one or more!!when operand>s in a are E1,4hen the data4ype of E1 is assumed4o be4he data type of the first . l) If one operand of NULLIF is E1, then4he data type of E1 is assumed to be the data4ype of4he other operand. m) In4he first and second operands of a or , or the first and third operands of a , if the i-th6alue of one operand is E1, 4hen the data4ype of E1 is4he data type of the i-th6alue of the other operand. n)!?n the first and second operands of an , if either of4he first!!row value constructor element>s is E1,4hen the data4ype of E1 is4he data type of the first of4he other operand. If both of4he first!!row value constructor element>s are E1, then 4he data type of each E1 is assumed4o be TIMESTAMP 2 2 2 2ITH TIME ZONE. o)!?n a in7hich4he i-th of some!!row value constructor> is E14hat contains a!!row value constructor>7hose i-th is not E1, the data4ype of E1 is4he data type of the i-th !!value expression> of4he first!!row value constructor>7hose i-th is not E1. 0) In a!!table value constructor> in which the i-th!!value ex- pression> in each is E1 that is the simply contained in an , the data4ype of E1 is4he data type of the corresponding column of the implicit or explicit!!insert column list> con- 4ained in4he!!insert statement>. q)!?n an!!in0redicate> that specifies a!!table subquery>,4he data types of!!value expression>s E1 in4he!!row value con- structor> are assumed4o be4he same as4he data types of4he respective columns of4he!!table subquery>. r)!?n an!!in0redicate> that specifies an , if the is not E1,4hen let D be its data type. Otherwise, let D be the data4ype of4he first!!value specification> of the . The data type of any E1 in the is assumed to be D. 2 2 246 Database Language SQL X0ß0¯0í0ó(g()92-154e¤BL CBR-002 17.6 s)!?f E1 appears for!!match value>, , or in , then4he data type of E1 is assumed to be CHARACTER VARYING(L), where L is 4he implementation-defined maximum value of!!length> for CHARACTER VARYING. t)!?f any value in4he!!row value constructor> of a or!!match predicate> is E1, then4he data type of E1 is assumed to be the same as the data4ype of 4he respective column of the
. 5) If!!value specification> in ,!!set schema statement>,!!set names statement>, or!!set session authorization identifier statement> is E1,4hen the data 4ype of E1 is assumed4o be CHARACTER VARYING(L),7here L is the implementation-defined maximum6alue of for CHARACTER VARYING. 6) If!!simple6alue specification> in!!set local time+one statement> is E1, then4he data type of E1 is assumed to be CHARACTER VARYING(L), where L is4he implementation-defined maximum value of!!length> for CHARACTER VARYING. w)!?f a in a is E1, then4he data type of E1 is assumed to be the same data type as the corresponding . 5 5) If4he6alue of the identifies an existing prepared statement, then an implicit DEALLOCATE PREPARE SSN is executed,7here SSN is the value of4he!!SQL statement name>. 5 5 5) P is0repared for execution. 8) If!!extended statement name> is specified for the , then let S be the character string4hat is4he6alue of the and let V be4he character string that is the result of TRIM ( BOTH ' ' FROM S ) !?f V does not conform4o the Format and Syntax Rules of an , then an exception condition is raised: invalid SQL statement identifier. 9) Case: a) If!!extended statement name> is specified for the , then4he6alue of the is associated with4he0repared statement. This value and ex- plicit or implied shall be specified for each !!execute statement> or that is to be associated7ith this0repared statement. Dynamic SQL 2 2 247 X3H2-9(g()¬4/DBL CBR-00() 17.6 b)!?f is specified for the , then: i) If P is a and!!statement name> is associated7ith a cursor C4hrough a!!dynamic declare cur- sor>, then an association is made between C and P. The association is0reserved5ntil4he0repared statement is destroyed. ii)!?f P is not a!!cursor specification> and is associated with a cursor C through a ,4hen an exception condition is raised: dynamic SQL error- prepared statement is not a cursor specification. iii) Otherwise,4he same shall be specified for each that is to be associated7ith this prepared statement. 10)The6alidity of an value or a!!state- ment name> in an SQL-transaction different from4he one in which the statement was prepared is implementation-dependent. Leveling Rules 1) The following restrictions apply for!?ntermediate SQL: None. (SA) The following restrictions apply for Entry SQL in addition to any!?ntermediate SQL restrictions: a) Conforming Entry SQL language shall not contain any Dynamic SQL language. 448 Database Language SQL X3H2-9(g()¬4/DBL CBR-00() .7!!deallocate0repared statement> .7 Function Deallocate SQL-statements4hat have been prepared7ith a . Format !!deallocate0repared statement> ::= DEALLOCATE PREPARE Syntax Rules 1) If!!SQL statement name> is a!!statement name>,4hen the 4hat contains4he!!deallocate0repared statement> shall also contain a that specifies4he same . Access Rules None. General Rules 1)!?f the does not identify a statement0re- pared in4he scope of the , then an excep- 4ion condition is raised: invalid SQL statement name. 2) If4he6alue of identifies an existing prepared statement4hat is4he!!cursor specification> of an open cursor,4hen an exception condition is raised: invalid cursor state. 0Î0Ã0È The0repared statement identified by the is destroyed. Any cursor that7as allocated7ith an!!allocate cursor statement>4hat is associated with4he0repared state- ment identified by the is destroyed.!?f the value of4he!!SQL statement name> identifies an existing 0repared statement that is a , then any 0repared statements4hat reference that cursor are destroyed. Leveling Rules 1) The following restrictions apply for Intermediate SQL: a) Conforming!?ntermediate SQL language shall contain no . 2) The following restrictions apply for Entry SQL in addition4o Intermediate SQL restrictions: None. Dynamic SQL 449 X0ß0¯0í0ó(g()92-154e¤BL CBR-002 .8!!describe statement> 17.8 !!describe statement> Function Obtain information about the column, with data type SDT. Note: See4he??eneral Rules of Subclause .8, "". b) Let TDT be4he 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. c)!?f the CAST ( SV AS TDT ) Dynamic SQL 457 X0ß0¯0í0ó(g()92-154e¤BL CBR-002 .9!!using clause> violates4he Syntax Rules of Subclause 5 5.10, ""+"+4hen an exception condition is raised: dynamic SQL error- restricted data4ype attribute violation. d)!?f the CAST ( SV AS TDT ) 6iolates the General Rules of Subclause 5 5.10, ""+"+4hen an exception condition is raised in accordance 7ith the General Rules of Subclause 5 5.10, "". e) The!!cast specification> CAST ( SV AS TDT ) is effectively0erformed, and is4he6alue TV of4he i-th . f) If TV is4he null value,4hen the value of!?NDICATOR is set to -1. g)!?f TV is not the null6alue, then: i) The value of!?NDICATOR is set to 0 and4he6alue of DATA is set4o TV. ii) Case: 1)!?f TYPE indicates CHARACTER VARYING or BIT VARYING,4hen RETURNED_LENGTH is set to4he length in characters or bits, respectively, of TV, and RETURNED_OCTET_LENGTH is set4o the length in octets of TV. (SA)!?f SDT is CHARACTER VARYING or BIT VARYING,4hen RETURNED_LENGTH is set to4he length in characters or bits, respectively, of SV, and RETURNED_OCTET_LENGTH is set4o the length in octets of SV. Note: All other6alues of4he SQL descriptor area are5n- changed. Leveling Rules 1) The following restrictions apply for!?ntermediate SQL: a) A!!descriptor name> shall be a . 2) The following restrictions apply for Entry SQL in addition4o any Intermediate SQL restrictions: a) Conforming Entry SQL language shall not contain any Dynamic SQL language. 2 2 258 Database Language SQL X0ß0¯0í0ó(g()92-154e¤BL CBR-002 .10 17.10 Function Associate input0arameters and output4argets7ith a prepared statement and execute the statement. Format ::= EXECUTE [!!result5sing clause> ] [!!parameter using clause> ] ::= !!parameter using clause> ::= Syntax Rules 1) If!!SQL statement name> is a!!statement name>,4hen the contain- ing!!module> shall contain a whose is the same as the of the . 2) If!!result5sing clause> is specified,4hen the shall contain either a!!using arguments> or 4hat contains4he keyword!?NTO. Access Rules None. ??eneral Rules 1) When4he!!execute statement> is executed, if4he!!SQL statement name> does not identify a statement P previously0repared in4he scope of the , then an exception condition is raised: invalid SQL statement name. 2) If P is a 4hat does not conform4o the Format and Syntax Rules of a!!dynamic single row select statement>, then an exception condition is raised: dynamic SQL error-cursor specification cannot be executed. 0Î0Ã0È!?f P contains4he!!table name> of a created or declared local 4emporary4able and if the is not in the same!!module> as4he!!prepare statement>4hat prepared4he0re- pared statement,4hen an exception condition is raised: syntax rule or access rule6iolation in dynamic SQL statement. Dynamic SQL 2 2 259 X3H2-9(g()¬4/DBL CBR-00() 17.10!!execute statement> 4)!?f P contains!!dynamic parameter specification>s and a is not specified,4hen an exception condition is raised: dynamic SQL error-5sing clause required for dynamic 0arameters. 5) If P is a and a is not specified, then an exception condition is raised: dynamic SQL error-using clause required for result fields. 6)!?f a 4hat is!!using descriptor> is specified, then4he??eneral Rules specified in Subclause .9, "", for a in an!!execute statement> are applied. 7)!?f P is a!!dynamic single row select statement>, then4he ??eneral Rules specified in Subclause .9, "", for a in an are applied. 8) P is executed. Case: a) If P is a ,4hen all General Rules in Subclause 10Ô0¢0¹0È0ë5, "
2 2 2 2HERE CURRENT OF Syntax Rules 1)!?f DCN is a!!cursor name> CN,4hen the containing!!module> shall contain a 7hose!!cursor name> is CN. (SA) Let CR be4he cursor identified by DCN. 2 2) CR shall be an5pdatable cursor. Note: updatable cursor is defined in Subclause 10Ô0¢0¹0È0ë1, "". 2 2 2) Let T be4he4able identified by4he!!table name>. Let QS be4he !!query specification>4hat is4he simply underlying4able of the simply5nderlying table of CR. The simply underlying4able of QS shall be T. Note: The simply5nderlying table of a!!cursor specification> is defined in Subclause ª.1, "". Access Rules 1) All Access Rules of Subclause ª.6, "", apply to4he!!dynamic delete statement: positioned>. ??eneral Rules 1) All General Rules of Subclause 10Ô0¢0¹0È0ë6, ""+"+ apply4o the , replacing ""7ith "". Leveling Rules 1) The following restrictions apply for!?ntermediate SQL: None. 47(N) Database Language SQL X3H2-9(g()¬4/DBL CBR-00() .17 (SA) The following restrictions apply for Entry SQL in addition to any!?ntermediate SQL restrictions: a) Conforming Entry SQL language shall not contain any Dynamic SQL language. Dynamic SQL 470ª0ü0à X0ß0¯0í0ó(g()92-154e¤BL CBR-002 .18 .18 !!dynamic update statement: positioned> Function Update a row of a4able. Format !!dynamic update statement: positioned> ::= UPDATE!!table name> SET ["!!comma>!!set clause> }... ] 2 2 2 2HERE CURRENT OF Syntax Rules 1)!?f DCN is a!!cursor name> CN,4hen the containing!!module> shall contain a 7hose!!cursor name> is CN. (SA) Let CR be4he cursor identified by DCN. 2 2) CR shall be an5pdatable cursor. Note: updatable cursor is defined in Subclause 10Ô0¢0¹0È0ë1, "". 2 2 2) Let T be4he4able identified by4he!!table name>. Let QS be4he !!query specification>4hat is4he simply underlying4able of the simply5nderlying table of CR. The simply underlying4able of QS shall be T. Note: The simply5nderlying table of a!!cursor specification> is defined in Subclause ª.1, "". 5)!?f CR is an ordered cursor,4hen for each!!object column> OC, 4he column of T identified by OC shall not be directly or in- directly referenced in the of4he defining for CR. 5 5) No leaf generally underlying4able of T shall be an underly- ing4able of any generally contained in any immediately contained in any contained in4he!!set clause list>. 7) A!!value expression> in a!!set clause> shall not directly con- tain a!!set function specification>. 8) The same!!object column> shall not appear more4han once in a . 9) If CR was specified using an explicit or implicit of FOR UPDATE,4hen each!!column name> specified as an!!object column> shall identify a column in the explicit or implicit!!column name list> associated7ith the . 2 2 274 Database Language SQL X0ß0¯0í0ó(g()92-154e¤BL CBR-002 17.!!dynamic update statement: positioned> 10)The scope of4he!!table name> is4he entire . )For every!!set clause>,4he Syntax Rules of Subclause 9.2, "Store assignment", apply to4he column of T identified by4he !!object column> and4he!!value expression> of4he!!set clause> as TARGET and VALUE, respectively. Access Rules 1) All Access Rules of Subclause 10Ô0¢0¹0È0ë9, ""+"+ apply4o the . General Rules 1) All??eneral Rules of Subclause ª.9, "", apply to4he!!dynamic update statement: positioned>, replacing ""7ith "" and ""7ith "". Leveling Rules 1) The following restrictions apply for!?ntermediate SQL: None. (SA) The following restrictions apply for Entry SQL in addition to any!?ntermediate SQL restrictions: a) Conforming Entry SQL language shall not contain any Dynamic SQL language. Dynamic SQL 2 2 275 X3H2-9(g()¬4/DBL CBR-00() 17.!!preparable dynamic delete statement:0ositioned> .19 !!preparable dynamic delete statement:0ositioned> Function Delete a row of a table through a dynamic cursor. Format !!preparable dynamic delete statement:0ositioned> ::= DELETE [ FROM!!table name> ] WHERE CURRENT OF!!cursor name> Syntax Rules 1) If!!table name> is not specified, then4he name of4he5nder- lying table of4he!!cursor specification> identified by is implicit. 2) All Syntax Rules of Subclause ª.6, "", apply to4he!!preparable dynamic delete statement: 0ositioned>, replacing ""7ith " or!!allocate cursor statement>" and ""7ith "". Access Rules 1) All Access Rules of Subclause 10Ô0¢0¹0È0ë6, ""+"+ apply4o the . ??eneral Rules 1) All General Rules of Subclause 10Ô0¢0¹0È0ë6, ""+"+ apply4o the , replacing "" with "". Leveling Rules 1) The following restrictions apply for!?ntermediate SQL: a) Conforming Intermediate SQL language shall contain no !!preparable dynamic delete statement:0ositioned>. (SA) The following restrictions apply for Entry SQL in addition to any!?ntermediate SQL restrictions: None. 476 Database Language SQL X3H2-9(g()¬4/DBL CBR-00() 17.(eå)!!preparable dynamic5pdate statement:0ositioned> .20 !!preparable dynamic5pdate statement:0ositioned> Function Update a row of a table through a dynamic cursor. Format !!preparable dynamic5pdate statement:0ositioned> ::= UPDATE [
] SET!!set clause list> 2 2 2 2HERE CURRENT OF Syntax Rules 1)!?f
is not specified,4hen the name of the under- lying4able of the identified by!!cursor name> is implicit. (SA) All Syntax Rules of Subclause 10Ô0¢0¹0È0ë9, ""+"+ apply4o the , replacing "" with " or " and "" with "". Access Rules 1) All Access Rules of Subclause ª.9, "", apply to4he!!preparable dynamic5pdate statement: 0ositioned>. General Rules 1) All??eneral Rules of Subclause ª.9, "", apply to4he!!preparable dynamic5pdate statement: 0ositioned>, replacing ""7ith "". Leveling Rules 1) The following restrictions apply for Intermediate SQL: a) Conforming!?ntermediate SQL language shall contain no . 2) The following restrictions apply for Entry SQL in addition4o any Intermediate SQL restrictions: None. Dynamic SQL 477 X0ß0¯0í0ó(g()92-154e¤BL CBR-002 2 2 278 Database Language SQL X0ß0¯0í0ó(g()92-154e¤BL CBR-002  Diagnostics management 18.1 !!get diagnostics statement> Function Get exception or completion condition information from4he diagnos- 4ics area. Format !!get diagnostics statement> ::= ??ET DIAGNOSTICS!!sql diagnostics information> !!sql diagnostics information> ::= !!statement information> =!!condition information> !!statement information> ::= !!statement information item> [ { (... ] !!statement information item> ::= !!statement information item name> ::= NUMBER | MORE = COMMAND_FUNCTION | DYNAMIC_FUNCTION = ROW_COUNT !!condition information> ::= EXCEPTION!!condition number> ["!!comma>!!condition information item> }... ] ::= !!simple4arget specification>!!equals operator>!!condition information item name> ::= CONDITION_NUMBER = RETURNED_SQLSTATE = CLASS_ORIGIN | SUBCLASS_ORIGIN | SERVER_NAME Diagnostics management 479 X0ß0¯0í0ó(g()92-154e¤BL CBR-002 .1!!get diagnostics statement> = 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 !!condition number> ::= Syntax Rules 1) The data4ype of a!!simple4arget specification> contained in a or shall be the data4ype specified in Table 21, "s for use with!!get diagnostics statement>"+"+ for4he corresponding !!statement information item name> or . 2) The data4ype of!!condition number> shall be exact numeric7ith scale 0. 2 2 280 Database Language SQL X0ß0¯0í0ó(g()92-154e¤BL CBR-002 18.1 _Table_21-s_for_use_with___ ___________Data_Type__________________________________ |_________________s_______________| = | | | NUMBER exact numeric7ith scale 0 = = | | MORE = character string (1) = = | | | COMMAND_FUNCTION = character6arying (L) = = | | | DYNAMIC_FUNCTION = character6arying (L) = = | | |_ROW_COUNT____________|_exact_numeric_with_scale_0________________| = | | |_________________s_______________| = | | | CONDITION_NUMBER exact numeric7ith scale 0 = = | | RETURNED_SQLSTATE = character string (5) = = | | | CLASS_ORIGIN = character6arying (L) = = | | | SUBCLASS_ORIGIN = character6arying (L) = = | | | SERVER_NAME = character6arying (L) = = | | | CONNECTION_NAME = character6arying (L) = = | | | CONSTRAINT_CATALOG = character6arying (L) = = | | | CONSTRAINT_SCHEMA = character6arying (L) = = | | | CONSTRAINT_NAME = character6arying (L) = = | | | CATALOG_NAME = character6arying (L) = = | | | SCHEMA_NAME = character6arying (L) = = | | | TABLE_NAME = character6arying (L) = = | | | COLUMN_NAME = character6arying (L) = = | | | CURSOR_NAME = character6arying (L) = = | | | MESSAGE_TEXT = character6arying (L) = = | | | MESSAGE_LENGTH = exact numeric7ith scale 0 = = | | |_MESSAGE_OCTET_LENGTH_|_exact_numeric_with_scale_0________________| = | | | Where L is an impleme|tation-defined integer not less than 1(R´). = =______________________|___________________________________________| | = Access Rules None. Diagnostics management 481 X0ß0¯0í0ó(g()92-154e¤BL CBR-002 .1!!get diagnostics statement> General Rules 1) Specification of retrieves informa- tion about4he statement execution recorded in4he diagnostics area into!!simple4arget specification>. a) The value of NUMBER is4he number of exception or completion conditions that have been stored in4he diagnostics area as a result of executing4he0revious SQL-statement other than a !!get diagnostics statement>. Note: The!!get diagnostics statement> itself may return infor- mation6ia4he SQLCODE or SQLSTATE0arameters, but does not modify4he0revious contents of the diagnostics area. b) The value of MORE is: Y More conditions7ere raised during execution of4he SQL-statement4han have been stored in the diagnostics area. N All of the conditions4hat were raised during execution of the SQL-statement have been stored in the diagnostics area. c) The value of COMMAND_FUNCTION is4he identification of4he SQL-statement executed. Table 2(l4) "SQL-statement character codes for use in4he diagnostics area" specifies4he identi- fier of4he SQL-statements. d) The6alue of DYNAMIC_FUNCTION is the identification of the prepared statement executed. Table 2(l4) "SQL-statement char- acter codes for use in4he diagnostics area", specifies the identifier of the SQL-statements. Table (g )-SQL-statement character _______________codes_for_use_in_the_diagnostics_area_______________ _SQL-statement____________________Identifier_______________________ =!!allocate cursor statement> | ALLOCATE CURSOR | | = = =!!allocate descriptor state- | ALLOCATE DESCRIPTOR | ment> =!!alter domain statement> | ALTER DOMAIN | | = = =!!alter table statement> | ALTER TABLE | | = = =!!assertion definition> | CREATE ASSERTION | | = = =!!character set definition> | CREATE CHARACTER SET | | = = =!!close statement> | CLOSE CURSOR | | = = =!!collation definition> | CREATE COLLATION | | = = =!!commit statement> | COMMIT 2 2 2 2ORK | | = = 48(N) Database Language SQL X3H2-9(g()¬4/DBL CBR-00() .1!!get diagnostics statement> Table 2(g()SQL-statement character codes _____________for_use_in_the_diagnostics_area_(Cont.)______________ SQL-statement____________________Identifier_______________________ | = CONNECT = = | | | | | | | = = =!!delete statement: positioned> | DELETE CURSOR | | = = =!!delete statement: searched> | DELETE 2 2 2 2HERE | | = = =!!describe statement> | DESCRIBE | | = = =!!direct select statement: | SELECT | multiple rows> | = DISCONNECT = = | | | = CREATE DOMAIN = = | | | = DROP ASSERTION = = | | | = DROP CHARACTER SET = = | | | = DROP COLLATION = = | | | = DROP DOMAIN = = | | | = DROP SCHEMA = = | | | = DROP TABLE = = | | | = DROP TRANSLATION = = | | | = DROP VIEW = = | | | = DYNAMIC CLOSE = = | | | | = DYNAMIC FETCH = = | | | = DYNAMIC OPEN = = | | | =!!dynamic update statement: | DYNAMIC UPDATE CURSOR | | positioned> = = = | | | = EXECUTE!?MMEDIATE = = | | | = EXECUTE = = | | | = FETCH = = | | | =??ET DESCRIPTOR = = | | Diagnostics management 2 2 283 X3H2-9(g()¬4/DBL CBR-00() 18.1 Table (g )-SQL-statement character codes ______________for_use_in_the_diagnostics_area_(Cont.)______________ _SQL-statement____________________Identifier_______________________ =!!get diagnostics statement> | GET DIAGNOSTICS | | = = =!!grant statement> | GRANT | | = = =!!insert statement> | INSERT | | = = =!!open statement> | OPEN | | = = =!!preparable dynamic delete | DYNAMIC DELETE CURSOR | statement:0ositioned> | | | | = = =!!prepare statement> | PREPARE | | = = =!!revoke statement> | REVOKE | | = = =!!rollback statement> | ROLLBACK 2 2 2 2ORK | | = = =!!schema definition> | CREATE SCHEMA | | = = =!!select statement: single row> | SELECT | | = = =!!set catalog statement> | SET CATALOG | | = = =!!set connection statement> | SET CONNECTION | | = = =!!set constraints mode state- | SET CONSTRAINT | ment> =!!set descriptor statement> | SET DESCRIPTOR | | = = =!!set local time+one state- | SET TIME ZONE | ment> =!!set names statement> | SET NAMES | | = = =!!set schema statement> | SET SCHEMA | | = = =!!set transaction statement> | SET TRANSACTION | | = = =!!set session authorization | SET SESSION AUTHORIZATION | identifier statement> =!!table definition> | CREATE TABLE | | = = =!!translation definition> | CREATE TRANSLATION | | = = =!!update statement: positioned> | UPDATE CURSOR | | = = =!!update statement: searched> | UPDATE 2 2 2 2HERE | | = = =_______________|_CREATE_VIEW_____________________| | = = e) The value of ROW_COUNT is the number of rows affected as4he result of executing a!!delete statement: searched>,!!insert statement>, or as a direct re- sult of executing4he0revious SQL-statement. Let S be the , , or!!update 2 2 284 Database Language SQL X0ß0¯0í0ó(g()92-154e¤BL CBR-002 18.1 statement: searched>. Let T be4he4able identified by4he !!table name> directly contained in S. Case: i) If S is an!!insert statement>,4hen the value of ROW_COUNT is4he number of rows inserted into T. ii)!?f S is not an and does not contain a !!search condition>,4hen the value of ROW_COUNT is the cardinality of T before4he execution of S. iii) Otherwise, let SC be the directly con- tained in S. The6alue of ROW_COUNT is effectively derived by executing4he statement: SELECT COUNT(*) FROM T 2 2 2 2HERE SC before4he execution of S. The value of ROW_COUNT following4he execution of an SQL- statement that does not directly result in4he execution of a , an!!insert statement>, or an !!update statement: searched> is implementation-dependent. 2) If!!condition information>7as specified, then let N be the value of!!condition number>.!?f N is less than 1 or greater than 4he number of conditions stored in the diagnostics area, then an exception condition is raised: invalid condition number.!?f has4he6alue 1, then4he diagnostics infor- mation retrieved corresponds4o the condition indicated by4he SQLSTATE or SQLCODE6alue actually returned by execution of4he 0revious SQL-statement other than a!!get diagnostics statement>. Otherwise,4he association between!!condition number> values and specific conditions raised during evaluation of4he??eneral Rules for4hat SQL-statement is implementation-dependent. 2 2) Specification of!!condition information item> retrieves informa- 4ion about the N-th condition in the diagnostics area into the . a) The6alue of CONDITION_NUMBER is the value of!!condition number>. b) The6alue of CLASS_ORIGIN is the identification of the naming authority4hat defined the class value of RETURNED_SQLSTATE. That6alue shall be 'ISO 9075' for any RETURNED_SQLSTATE 7hose class6alue is fully defined in Subclause 2(‘Ñ)1, "SQLSTATE"+"+ and shall be an implementation-defined charac- ter string other4han 'ISO 9075' for any RETURNED_SQLSTATE 7hose class6alue is an implementation-defined class value. c) The6alue of SUBCLASS_ORIGIN is4he identification of 4he naming authority that defined4he subclass value of RETURNED_SQLSTATE. That6alue shall be 'ISO 9075' for any RETURNED_SQLSTATE7hose subclass value is fully defined in Diagnostics management 485 X0ß0¯0í0ó(g()92-154e¤BL CBR-002 .1!!get diagnostics statement> Subclause 2(‘Ñ)1, "SQLSTATE"+"+ and shall be an implementation- defined character string other than 'ISO 9075' for any RETURNED_SQLSTATE whose subclass6alue is an implementation- defined subclass value. d) The6alue of RETURNED_SQLSTATE is4he SQLSTATE parameter that 7ould have been returned if4his were4he only completion or exception condition possible. e) If4he6alue of RETURNED_SQLSTATE corresponds to7arning 7ith a subclass of cursor operation conflict,4hen the value of CURSOR_NAME is the name of the cursor4hat caused4he completion condition to be raised. f) If4he6alue of RETURNED_SQLSTATE corresponds to integrity constraint violation,4ransaction rollback-integrity con- straint6iolation, or4riggered data change6iolation, then: i) The values of CONSTRAINT_CATALOG and CONSTRAINT_SCHEMA are the and4he!!unqualified schema name> of the !!schema name> of the schema containing the constraint or assertion. The value of CONSTRAINT_NAME is the of4he constraint or assertion. ii) Case: 1)!?f the violated integrity constraint is a4able con- straint, then4he6alues of CATALOG_NAME, SCHEMA_NAME, and TABLE_NAME are the , the of the , and4he!!qualified identifier> or , respectively, of4he table in7hich4he4able constraint is contained. (SA)!?f the violated integrity constraint is an assertion and if only one4able referenced by4he assertion has been modified as a result of executing4he SQL-statement, 4hen the values of CATALOG_NAME, SCHEMA_NAME, and TABLE_ NAME are the , the of the , and4he!!qualified iden- 4ifier> or , respectively, of4he modified4able. 0Î0Ã0È Otherwise, the values of CATALOG_NAME, SCHEMA_NAME, and TABLE_NAME are!!space>s. !?f TABLE_NAME identifies a declared local4emporary4able, 4hen CATALOG_NAME is s and SCHEMA_NAME is "MODULE". g) If4he6alue of RETURNED_SQLSTATE corresponds to syntax error or access rule6iolation, syntax error or access rule viola- 4ion in dynamic SQL statement, or syntax error or access rule 6iolation in direct SQL statement, then: i) The values of CATALOG_NAME, SCHEMA_NAME, and TABLE_NAME 486 Database Language SQL X3H2-9(g()¬4/DBL CBR-00() .1!!get diagnostics statement> are the , the of the of4he schema that contains the table 4hat caused4he syntax error or4he access rule6iola- 4ion and the or , respectively.!?f TABLE_NAME refers to a declared local tem- porary4able, then CATALOG_NAME is!!space>s and SCHEMA_NAME contains "MODULE". ii) If4he syntax error or4he access rule6iolation7as for an inaccessible column, then4he6alue of COLUMN_NAME is the of4hat column. Otherwise,4he6alue of COLUMN_NAME is s. h) If4he6alue of RETURNED_SQLSTATE corresponds to invalid cursor state,4hen the value of CURSOR_NAME is the name of the cursor4hat is in the invalid state. i)!?f the value of RETURNED_SQLSTATE corresponds4o with check option violation,4hen the values of CATALOG_NAME, SCHEMA_ NAME, and TABLE_NAME are4he!!catalog name> and the of4he!!schema name> of the schema 4hat contains4he6iew that caused the violation of4he 2 2 2 2ITH CHECK OPTION, and the of that6iew, respectively. j)!?f the value of RETURNED_SQLSTATE does not correspond4o syntax error or access rule violation, syntax error or access rule6iolation in dynamic SQL statement, or syntax error or access rule violation in direct SQL statement,4hen: i)!?f the values of CATALOG_NAME, SCHEMA_NAME, TABLE_NAME, and COLUMN_NAME identify a column for which no0rivileges are granted4o the current , then4he value of COLUMN_NAME is replaced by a zero-length string. ii) If4he6alues of CATALOG_NAME, SCHEMA_NAME, and TABLE_NAME identify a4able for7hich no privileges are granted4o 4he current!!authorization identifier>,4hen the values of CATALOG_NAME, SCHEMA_NAME, and TABLE_NAME are replaced by a zero-length string. iii) If4he6alues of CONSTRAINT_CATALOG, CONSTRAINT_SCHEMA, and CONSTRAINT_NAME identify a
for some4able T and if no0rivileges for T are granted to the current , then4he6alues of CONSTRAINT_CATALOG, CONSTRAINT_SCHEMA, and CONSTRAINT_NAME are replaced by a zero-length string. iv) If4he6alues of CONSTRAINT_CATALOG, CONSTRAINT_SCHEMA, and CONSTRAINT_NAME identify an assertion contained in some schema S and if the owner of S is not the of4he current SQL-session, then4he6alues of CONSTRAINT_CATALOG, CONSTRAINT_SCHEMA, and CONSTRAINT_NAME are replaced by a zero-length string. Diagnostics management 487 X0ß0¯0í0ó(g()92-154e¤BL CBR-002 .1!!get diagnostics statement> k) The value of MESSAGE_TEXT is an implementation-defined char- acter string. Note: An implementation may set this4o s, to a+ero- length string, or4o a character string describing the condi- 4ion indicated by RETURNED_SQLSTATE. l) The value of MESSAGE_LENGTH is4he length in characters of 4he character string value in MESSAGE_TEXT. m) The6alue of MESSAGE_OCTET_LENGTH is the length in octets of the character string6alue in MESSAGE_TEXT. n) The values of CONNECTION_NAME and SERVER_NAME are Case: i)!?f COMMAND_FUNCTION or DYNAMIC_FUNCTION identifies an!!SQL connection statement>, then4he explicit or implicit and4he associated , respectively, referenced by4he!!SQL connection statement>. ii) Otherwise,4he explicit or implicit and 4he associated , respectively, corre- sponding to4he most-recently executed explicit or implicit or!!set connection statement>. o) The6alues of character string items where not otherwise specified by4he0receding rules are set4o a zero-length string. Note: There are no numeric items that are not set by these rules. Leveling Rules 1) The following restrictions apply for Intermediate SQL; None. 2) The following restrictions apply for Entry SQL; a) Conforming Entry SQL language shall not contain any . 2 2 288 Database Language SQL X0ß0¯0í0ó(g()92-154e¤BL CBR-002  Embedded SQL 19.1 !!embedded SQL host program> Function Specify an!!embedded SQL host program>. Format !!embedded SQL host program> ::= !!embedded SQL Ada0rogram> | =!!embedded SQL COBOL0rogram> | =!!embedded SQL MUMPS0rogram> | | ::= !!SQL prefix> [!!SQL terminator> ] ::= !!declare cursor> | =!!temporary table declaration> =!!embedded exception declaration> | ::= EXEC SQL | SQL !!SQL terminator> ::= END-EXEC =!!semicolon> =!!right paren> !!embedded SQL declare section> ::= [!!embedded character set declaration> ] [ ... ] =!!embedded SQL MUMPS declare> ::= Embedded SQL 2 2 289 X3H2-9(g()¬4/DBL CBR-00() 19.1 SQL NAMES ARE ::= !!SQL prefix> BEGIN DECLARE SECTION [ ] !!embedded SQL end declare> ::= END DECLARE SECTION [!!SQL terminator> ] ::= !!SQL prefix> BEGIN DECLARE SECTION [ ] [!!host6ariable definition>... ] END DECLARE SECTION !!SQL terminator> ::= !!Ada variable definition> =!!C variable definition> =!!COBOL variable definition> =!!Fortran variable definition> =!!MUMPS variable definition> =!!Pascal6ariable definition> | !!embedded6ariable name> ::= !!host identifier> ::= !!Ada host identifier> =!!C host identifier> =!!COBOL host identifier> =!!Fortran host identifier> =!!MUMPS host identifier> =!!Pascal host identifier> | Syntax Rules 1) An!!embedded SQL host program> is a compilation unit4hat con- sists of programming language4ext and SQL text. The programming language4ext shall conform to4he requirements of a specific standard0rogramming language. The SQL4ext shall consist of one or more!!embedded SQL statement>s and, optionally, one or more s, as defined in4his International Standard. Note: Compilation5nit is defined in Subclause 4.­, "Modules". 2) Case: a) An!!embedded SQL statement> or!!embedded SQL MUMPS declare> that is contained in an shall 2 2 290 Database Language SQL X0ß0¯0í0ó(g()92-154e¤BL CBR-002 19.1 contain an!!SQL prefix> that is "SQL". There shall be no between the and "SQL" nor between "SQL" and the . b) An!!embedded SQL statement>,!!embedded SQL begin declare>, or 4hat is not contained in an !!embedded SQL MUMPS0rogram> shall contain an!!SQL prefix> that is "EXEC SQL". 0Î0Ã0È Case: a) An , , or!!embedded SQL end declare> contained in an shall contain an 4hat is END-EXEC. b) An , , or!!embedded SQL end declare> contained in an shall not contain an . c) An!!embedded SQL statement>,!!embedded SQL begin declare>, or contained in an!!embedded SQL Ada0rogram>,!!embedded SQL C0rogram>,!!embedded SQL Pascal program>, or!!embedded SQL PL/I program> shall contain an 4hat is a!!semicolon>. d) An!!embedded SQL statement> or!!embedded SQL MUMPS declare> that is contained in an shall contain an 4hat is a!!right paren>. 4) Case: a) An 4hat is contained in an !!embedded SQL MUMPS0rogram> shall be an . b) An!!embedded SQL declare section> that is not contained in an shall not be an!!embedded SQL MUMPS declare>. Note: There is no restriction on4he number of!!embedded SQL declare section>s4hat may be contained in an!!embedded SQL host program>. 5) The!!token>s comprising an , , or!!embedded SQL end declare> shall be separated by characters and shall be specified on one line. Otherwise, the rules for the continuation of lines and tokens from one line4o the next and for4he0lacement of host language comments are4hose of the programming language of the containing !!embedded SQL host program>. Embedded SQL 491 X0ß0¯0í0ó(g()92-154e¤BL CBR-002 .1!!embedded SQL host program> 6)!?f an!!embedded character set declaration> is not specified, then an 4hat specifies an implementation-defined character set that contains at least every character4hat is in is implicit. 7) A!!temporary table declaration>4hat is contained in an!!em- bedded SQL host program> shall0recede in the text of that !!embedded SQL host program> any SQL-statement or 4hat references4he!!table name> of4he!!temporary table declaration>. 8) A!!declare cursor> that is contained in an shall precede in4he4ext of4hat any SQL-statement that references the of 4he!!declare cursor>. 9) A 4hat is contained in an!!embedded SQL host program> shall0recede in the text of that!!embedded SQL host program> any SQL-statement4hat references4he!!cursor name> of the . 10)Any!!host identifier>4hat is contained in an!!embedded SQL statement> in an shall be defined in exactly one contained in that!!em- bedded SQL host program>. In0rogramming languages4hat support s in subprograms, two s with different, non-overlapping scope in4he host language are4o be regarded as defining different host6ari- ables, even if they specify4he same variable name. That shall appear in4he4ext of4he!!embedded SQL host program>0rior4o any 4hat references4he!!host identifier>. The shall be such4hat a host language reference to4he!!host iden- 4ifier> is valid at every!!embedded SQL statement> that contains the . 11)A defines4he host language data type of the . For every such host language data4ype an equivalent SQL is specified in Subclause .3, "", Subclause .4, "", Subclause .5, "", Subclause .6, "", Subclause .7, "", Subclause .8, ""+"+ and Subclause 19.9, "". )If one or more s that specify SQLSTATE or SQLCODE appear in an ,4hen the s shall be such that a host language reference4o SQLSTATE or SQLCODE, respectively, is valid at every!!embedded SQL statement>, including!!embedded SQL state- ment>s4hat appear in any subprograms contained in4hat . No shall0recede 2 2 292 Database Language SQL X0ß0¯0í0ó(g()92-154e¤BL CBR-002 19.1 any of its applicable status code definitions in4he4ext of4he main program or subprograms4hat comprise4he!!embedded SQL host program>. ª)Given an H,4here is an implied standard-conforming SQL!!module> M and an implied standard- conforming host0rogram P derived from H. The derivation of4he implied0rogram P and4he implied!!module> M of an H effectively precedes4he0rocessing of any host language0rogram4ext manipulation commands such as inclusion or copying of text. ??iven an H with an implied M and an implied program P defined as above: a) The implied M of H shall be a standard-conforming SQL!!module>. b)!?f H is an , an!!embedded SQL C 0rogram>, an , an!!embedded SQL Fortran0rogram>, an , an!!embed- ded SQL Pascal program>, or an , 4hen the implied program P shall be a standard-conforming Ada0rogram, a standard-conforming C program, a standard- conforming COBOL program, a standard-conforming Fortran 0rogram, a standard-conforming MUMPS program, a standard- conforming Pascal0rogram, or standard-conforming PL/I pro- gram, respectively. 14)M is derived from H as follows: a) M contains a!!module name clause> whose is either implementation-dependent or is omitted. b) M contains a!!module character set specification> that is identical to4he explicit or implicit 7ith the keyword "SQL" removed. c) M contains a that specifies either ADA, C, COBOL, FORTRAN, MUMPS, PASCAL, or PLI,7here?! is re- spectively an , an!!embedded SQL C 0rogram>, an , an!!embedded SQL Fortran0rogram>, an , an!!embed- ded SQL Pascal program>, or an . d) M contains a that specifies SCHEMA ,7here4he6alue of is implementation-dependent. e) For every!!declare cursor> EC contained in H, M contains one PC and one PS4hat contains an 4hat references PC. The!!procedure name> of PS is implementation-dependent. PC is a copy of EC in7hich each distinct!!embedded6ariable name> has been replaced with Embedded SQL 2 2 293 X3H2-9(g()¬4/DBL CBR-00() 19.1 a distinct implementation-dependent . PS con- tains a for each!!parameter name> contained in PC. The!!parameter declaration>4hat corresponds to a given!!embedded6ariable name> V that is contained in EC specifies the 7ith which V was replaced, and the SQL data4ype that corresponds4o the host language data 4ype of V. If?! contains a 4hat specifies SQLSTATE or SQLCODE,4hen PS contains a that specifies SQLSTATE or SQLCODE, respec- tively. If?! contains neither a 4hat specifies SQLSTATE nor a!!host6ariable definition> that specifies SQLCODE, then PS contains a!!parameter declaration> 4hat specifies SQLCODE. The order of s in PS is implementation-dependent. f) For every EC in?!, M contains one !!dynamic declare cursor> PC4hat is a copy of EC. g) M contains one for each!!tempo- rary table declaration> contained in H. Each of M is a copy of the corresponding of?!. h) M contains a!!procedure> for each contained in?!. The PS of M corresponding with an ES of H is defined as follows: Case: i) If ES is not an , then: 1) The!!procedure name> of PS is implementation-dependent. 2) The of PS is a copy of ES in which each distinct has been replaced with4he same distinct implementation-dependent !!parameter name>. 2 2) PS contains a for each dis- 4inct!!parameter name> contained in4he!!SQL procedure statement> of PS. 2 2 2) The corresponding to a given V4hat is contained in ES spec- ifies the 7ith which V was replaced and the SQL that corresponds4o the host language data type of V. 5) Whether one of M can correspond to more than one of?! is implementation- dependent. 494 Database Language SQL X3H2-9(g()¬4/DBL CBR-00() .1!!embedded SQL host program> 6)!?f H contains a!!host6ariable definition> that spec- ifies SQLSTATE or SQLCODE,4hen PS contains a 4hat specifies SQLSTATE or SQLCODE, respectively. If?! contains neither a that specifies SQLSTATE nor a that specifies SQLCODE, then PS contains a that specifies SQLCODE. 7) The order of the s is implementation- dependent. ii) If ES is an , then: 1) Let EC be4he!!declare cursor> in?! referenced by ES. 2) PS is the procedure in M4hat contains an that references the in M corre- sponding4o EC. ¬)P is derived from?! as follows: a) Each , , and has been deleted.!?f the embedded host language is MUMPS,4hen each !!embedded SQL MUMPS declare> has been deleted. b) Each!!host6ariable definition> in an has been replaced by a valid data definition in4he 4arget host language according to4he Syntax Rules specified in an , , , , , or an!!embedded SQL PL/I program> clause. c) Each 4hat contains a!!declare cursor>, a!!dynamic declare cursor>, or a has been deleted, and every 4hat contains an has been replaced7ith statements of the host language that7ill have4he effect specified by4he??eneral Rules of Subclause .2, "". d) Each!!embedded SQL statement> that contains an!!SQL procedure statement> has been replaced by host language statements4hat perform the following actions: i) A host language0rocedure or subroutine call of4he!!proce- dure> of4he implied!!module> M of?!4hat corresponds with the . !?f the is not an ,4hen the arguments of4he call include each distinct !!host identifier> contained in the 4ogether with4he SQLCODE!!host identifier>, or4he Embedded SQL 2 2 295 X3H2-9(g()¬4/DBL CBR-00() 19.1 SQLSTATE , or both. If?! contains nei- ther a!!host6ariable definition> that specifies SQLSTATE nor a!!host6ariable definition> that specifies SQLCODE, 4hen the arguments of4he call include SQLCODE.!?f the !!SQL procedure statement> is an!!open statement>,4hen the arguments of the call include each distinct!!host iden- tifier> contained in4he corresponding!!declare cursor> of H together7ith the SQLCODE , or the SQLSTATE , or both. If?! contains neither a!!host6ariable definition> that specifies SQLSTATE nor a !!host6ariable definition> that specifies SQLCODE, then4he arguments of4he call include SQLCODE. The order of the arguments in4he call corresponds with4he order of4he corresponding!!parameter declaration>s in4he corresponding . Note:!?n an!!embedded SQL Fortran0rogram>,4he "SQLCODE" variable is abbreviated to "SQLCOD" and the "SQLSTATE" variable may be abbreviated to "SQLSTA". See4he Syntax Rules of Subclause .6, "". ii) Exception actions, as specified in Subclause 19.(l4) "". Note: SQLSTATE is the preferred status0arameter. The SQLCODE sta- tus parameter is a deprecated feature that is supported for compat- ibility7ith earlier versions of this!?nternational Standard. See Annex D, "Deprecated features". Access Rules None. General Rules 1) The interpretation of an H is de- fined4o be equivalent to4he interpretation of4he implied 0rogram P of H and the implied M of H. Leveling Rules 1) The following restrictions apply for Intermediate SQL: None. 2) The following restrictions apply for Entry SQL in addition4o any Intermediate SQL restrictions: a) An shall not contain an . b) No4wo!!host6ariable definition>s shall specify4he same variable name. 2 2 296 Database Language SQL X0ß0¯0í0ó(g()92-154e¤BL CBR-002 .2!!embedded exception declaration> 19.(N)!!embedded exception declaration> Function Specify4he action to be taken when an SQL-statement causes a spe- cific class of condition to be raised. Format !!embedded exception declaration> ::= WHENEVER!!condition>!!condition action> ::= SQLERROR= NOT FOUND !!condition action> ::= CONTINUE=!!go4o> !!go4o> ::= "??OTO | GO TO } ::= | =!!host PL/I label variable> ::= TELSee the Syntax Rules. ::= !1 D3ee4he Syntax Rules. Syntax Rules 1) An!!embedded exception declaration> contained in an applies to an contained in4hat if and only if 4he!!SQL procedure statement> appears after4he!!embedded ex- ception declaration> in4he4ext sequence of the and no other!!embedded exception declaration> that specifies4he same appears between the and4he!!SQL procedure statement> in the text sequence of4he!!embedded SQL host program>. (SA)!?f an!!embedded exception declaration> specifies a , 4hen the ,!!host PL/I label variable>, or of the shall be such that a host lan- guage??O TO statement specifying that!!host label identifier>, , or!!unsigned integer> is6alid at every to7hich4he!!embedded exception declaration> applies. Embedded SQL 497 X0ß0¯0í0ó(g()92-154e¤BL CBR-002 .2!!embedded exception declaration> Note: - If an is contained in an , then4he!!goto4arget> of a should specify a!!host label identifier>4hat is a label_ name in the containing!!embedded SQL Ada0rogram>. - !?f an!!embedded exception declaration> is contained in an !!embedded SQL C0rogram>,4hen the of a!!go4o> should specify a that is a label in 4he containing . - If an is contained in an , then4he!!goto4arget> of a should specify a!!host label identifier>4hat is a section-name or an unqualified paragraph-name in the contain- ing!!embedded SQL COBOL0rogram>. - !?f an!!embedded exception declaration> is contained in an !!embedded SQL Fortran0rogram>,4hen the of a !!go4o> should be an 4hat is4he statement label of an executable statement that appears in the same 0rogram5nit as4he!!go4o>. - If an is contained in an , then4he!!goto4arget> of a should be a gotoargument4hat is4he statement label of an executable statement that appears in the same!!embedded SQL MUMPS0rogram>. - !?f an!!embedded exception declaration> is contained in an !!embedded SQL Pascal program>, then4he!!goto4arget> of a should be an!!unsigned integer> that is a label. - !?f an!!embedded exception declaration> is contained in an !!embedded SQL PL/I program>, then4he!!goto4arget> of a should specify either a or a !!host PL/I label variable>. Case: o If!!host label identifier> is specified,4hen the should be a label constant in4he con- 4aining!!embedded SQL PL/I program>. o !?f is specified,4hen the should be a PLg label6ariable de- clared in4he containing . Access Rules None. 498 Database Language SQL X3H2-9(g()¬4/DBL CBR-00() 19.(N) General Rules 1)!?mmediately after4he execution of an!!SQL procedure statement> in an!!embedded SQL host program>: Case: a)!?f the value of4he status variable(s) indicates the comple- tion condition no data and4he!!embedded SQL host program> contains an!!embedded exception declaration> that applies4o the and whose is NOT FOUND and7hose!!condition action> is a!!go4o>, then a??O TO statement of the host language is0erformed, specifying 4he!!host label identifier>, , or !!unsigned integer> of4he!!go4o>. b) If4he6alue of the status6ariable(s) indicates an excep- 4ion condition and the contains an 4hat applies to4he!!SQL procedure statement> and7hose!!condition> is SQLERROR and 7hose!!condition action> is a!!go4o>, then a??O TO state- ment of the host language is0erformed, specifying4he!!host label identifier>, , or!!unsigned integer> of4he!!go4o>. c) If4he!!embedded SQL host program> contains no!!embedded exception declaration> that applies4o the , or if it contains an 4hat applies to4he!!SQL procedure statement> and4hat specifies CONTINUE, then no further action is performed for the . Leveling Rules 1) The following restrictions apply for Intermediate SQL: None. 2) The following restrictions apply for Entry SQL in addition4o any Intermediate SQL restrictions: None. Embedded SQL 2 2 299 X3H2-9(g()¬4/DBL CBR-00() 19.0µ0ó0Á0ü0à .3 Function Specify an!!embedded SQL Ada0rogram>. Format ::= !SMSee the Syntax Rules. ::= [ { }... ] : [!!Ada initial value> ] !!Ada initial value> ::= !!Ada assignment operator>!!character representation>... !!Ada assignment operator> ::=!!colon> ::= TEL See4he Syntax Rules. !!Ada type specification> ::= =!!Ada unqualified type specification> ::= SQL_STANDARD.CHAR [ CHARACTER SET [!?S ] ] !!left0aren> 1 !!right paren> = SQL_STANDARD.BIT 1!!double0eriod>!!length> = 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 !!Ada unqualified type specification> ::= CHAR!!left0aren> 1 !!right paren> = BIT!!left0aren> 1 !!right paren> = SMALLINT | INT | REAL = DOUBLE_PRECISION | SQLCODE_TYPE = SQLSTATE_TYPE =!?NDICATOR_TYPE 500 Database Language SQL X0ß0¯0í0ó(g()92-154e¤BL CBR-002 .3!!embedded SQL Ada0rogram> Syntax Rules 1) An is a compilation unit4hat con- sists of Ada text and SQL4ext. The Ada4ext shall conform to 4he Ada standard ISO/IEC 8652. The SQL text shall consist of one or more s and, optionally, one or more !!embedded SQL declare section>s. (SA) An may be specified wherever an Ada statement may be specified. An!!embedded SQL statement> may be 0refixed by an Ada label. 2 2) An!!Ada host identifier> is any valid Ada identifier. An!!Ada host identifier> shall be contained in an . 4) An defines one or more host6ariables. 5) An shall be modified as follows before it is placed into the program derived from4he!!embedded SQL Ada 0rogram> (see4he Syntax Rules of Subclause 19.1, ""): a) Any optional CHARACTER SET specification shall be removed from an!!Ada qualified type specification>. b) The!!length> specified in a CHAR declaration of any!!Ada qualified type specification> that contains a CHARACTER SET specification shall be replaced by a length equal to4he length in octets of PN,7here PN is4he!!Ada host identifier> specified in the containing!!Ada variable definition>. The modified shall be a6alid Ada object-declaration in4he0rogram derived from the . 6) An shall be specified7ithin the scope of Ada7ith and use clauses that specify4he following: 7ith SQL_STANDARD; 5se SQL_STANDARD; use SQL_STANDARD.CHARACTER_SET; 7) The!!character representation> sequence in an!!Ada initial value> specifies an initial value to be assigned4o the Ada variable. It shall be a valid Ada specification of an initial value. 8) CHAR describes a character string variable7hose equivalent SQL data4ype is CHARACTER7ith the same length and character set specified by!!character set specification>. If!!character set specification> is not specified,4hen an implementation-defined is implicit. Embedded SQL 501 X3H2-9(g()¬4/DBL CBR-00() 19.0µ0ó0Á0ü0à 9) BIT describes a bit string variable. The equivalent SQL data type is BIT with4he same length. 10)INT and SMALLINT describe exact numeric6ariables. The equiv- alent SQL data types are INTEGER and SMALLINT, respectively. )REAL and DOUBLE_PRECISION describe approximate numeric vari- ables. The equivalent SQL data4ypes are REAL and DOUBLE PRECISION, respectively. )SQLCODE_TYPE describes an exact numeric6ariable whose preci- sion is4he implementation-defined precision defined for the SQLCODE parameter. SQLSTATE_TYPE describes a character string variable7hose length is4he length of4he SQLSTATE parameter (five characters). 10Î0Ã0ÈINDICATOR_TYPE describes an exact numeric variable7hose spe- cific data4ype is any!!exact numeric type> with a scale of 0. )If an!!embedded SQL Ada0rogram> contains neither an that specifies SQLSTATE and that is de- fined with an 4hat specifies SQL_ STANDARD.CHAR or CHAR7ith 5, nor an!!Ada variable definition>4hat specifies SQLCODE and that is defined with an 4hat specifies SQL_STANDARD.INTEGER or INTEGER,4hen it is assumed that4he!!embedded SQL Ada0rogram> contains a6ariable named SQLCODE defined with a data type of INTEGER. Note: SQLSTATE is the preferred status0arameter. The SQLCODE status0arameter is a deprecated feature4hat is supported for compatibility7ith earlier versions of this!?nternational Standard. See Annex D, "Deprecated features". Access Rules None. ??eneral Rules 1) See Subclause .1, "". Leveling Rules 1) The following restrictions apply for Intermediate SQL: a) An!!Ada variable definition> shall not specify a bit string variable. 50(N) Database Language SQL X3H2-9(g()¬4/DBL CBR-00() 19.0µ0ó0Á0ü0à (SA) The following restrictions apply for Entry SQL in addition to any!?ntermediate SQL restrictions: a) An!!Ada qualified type specification> shall not contain a . Embedded SQL 503 X3H2-9(g()¬4/DBL CBR-00() 19.4 .4 Function Specify an!!embedded SQL C0rogram>. Format ::= !SMSee the Syntax Rules. ::= [ ] [ ] !!C variable specification> ::= !!C numeric variable> | =!!C derived variable> ::= auto = extern | static !!C class modifier> ::= const | volatile !!C numeric variable> ::= { long= short= float= double } [ ] [ { [ ] }... ] ::= char [ CHARACTER SET [ IS ]!!character set specification> ] !!C host identifier>!!C array specification> [!!C initial value> ] [ { [!!C initial value> ](... ] ::= !!length> ::= TEL See4he Syntax Rules. !!C derived variable> ::= =!!C bit variable> ::= VARCHAR [ CHARACTER SET [!?S ] ] 504 Database Language SQL X0ß0¯0í0ó(g()92-154e¤BL CBR-002 .4!!embedded SQL C0rogram> [ ] ["!!comma>!!C host identifier>!!C array specification> [ ] }... ] !!C bit variable> ::= BIT [ ] ["!!comma>!!C host identifier>!!C array specification> [ ] }... ] !!C initial value> ::= !!equals operator>!!character representation>... Syntax Rules 1) An!!embedded SQL C0rogram> is a compilation5nit that consists of C4ext and SQL text. The C text shall conform4o the C stan- dard!?SOgEC 9899. The SQL4ext shall consist of one or more !!embedded SQL statement>s and, optionally, one or more s. 2) An!!embedded SQL statement> may be specified7herever a C statement may be specified7ithin a function block. If4he C statement could include a label0refix,4hen the may be immediately preceded by a label prefix. 0Î0Ã0È A!!C host identifier> is any valid C variable identifier. A !!C host identifier> shall be contained in an . 4) A!!C variable definition> defines one or more host variables. 5) A shall be modified as follows before it is placed into the program derived from4he!!embedded SQL C 0rogram> (see4he Syntax Rules of Subclause 19.1, ""): a) Any optional CHARACTER SET specification shall be removed from a or a . b) The syntax "VARCHAR" shall be replaced by "char" in any . c) The syntax "BIT" shall be replaced by "char" in any . d) The specified in a in any !!C bit variable> shall be replaced by a length equal to4he smallest integer not less4han L/B, as defined in4he Syntax Rules of4his Subclause. Embedded SQL 505 X3H2-9(g()¬4/DBL CBR-00() 19.4 e) The specified in a in any !!C character variable> or in any 4hat contained a CHARACTER SET specification shall be replaced by a length equal to4he length in octets of PN,7here PN is4he !!C host identifier> specified in the containing!!C variable definition>. The modified shall be a6alid C data declaration in4he0rogram derived from the . 6) The!!character representation> sequence contained in a specifies an initial6alue4o be assigned to4he C6ariable.!?t shall be a6alid C specification of an initial 6alue. 7) Except for array specifications for character strings and bit strings, a shall specify a scalar4ype. 8) In a!!C variable definition>, the words "VARCHAR"+"+ "CHARACTER", "SET"+"+ "IS"+"+ "BIT", and "VARYING" may be specified in any com- bination of5pper case and lower case letters (see the Syntax Rules of Subclause 5.(l4) " and "). 9) In a!!C character variable> or a!!C VARCHAR variable>, if a is specified, then4he equivalent SQL data4ype is CHARACTER or CHARACTER VARYING whose charac- ter repertoire is the same as the repertoire specified by the .!?f is not specified, then an implementation-defined!!character set specification> is implicit. 10)Each specified in a!!C character variable> describes a fixed-length character string. The length is speci- fied by the of the . The6alue in the host6ariable is4erminated by a null character and the position occupied by4his null character is included in the length of the host6ariable. The equivalent SQL data4ype is CHARACTER7hose length is one less than4he!!length> of4he !!C array specification> and7hose6alue does not include the terminating null character. The shall be greater than 1. )Each specified in a!!C VARCHAR variable> describes a variable-length character string. The maximum length is specified by4he!!length> of4he!!C array specification>. The value in4he host variable is terminated by a null character and4he0osition occupied by this null character is included in 4he maximum length of4he host variable. The equivalent SQL data type is CHARACTER VARYING whose maximum length is 1 less4han the of the and whose value does not include4he4erminating null character. The!!length> shall be greater4han 1. 50 Database Language SQL X0ß0¯0í0ó(g()92-154e¤BL CBR-002 .4!!embedded SQL C0rogram> 1(SA)Each!!C host identifier> specified in a de- scribes a fixed-length bit string. The value in4he host vari- able has a BIT_LENGTH of!!length>. Let B be the number of bits in a C char and let L be the of the . The length of an equivalent C char variable is the smallest integer4hat is not less than4he result of Le‡. The equivalent SQL data type is BIT whose length is L. 10Î0Ã0È"long" describes an exact numeric variable. The equivalent SQL data type is INTEGER. 14)"short" describes an exact numeric6ariable. The equivalent SQL data4ype is SMALLINT. 15)"float" describes an approximate numeric6ariable. The equiva- lent SQL data4ype is REAL. 16)"double" describes an approximate numeric variable. The equiva- lent SQL data type is DOUBLE PRECISION. )If an!!embedded SQL C0rogram> contains neither a!!C variable definition>4hat specifies SQLSTATE and4hat is defined7ith a 4hat specifies "char"7ith a that is 6, nor a!!C variable definition>4hat specifies SQLCODE and that is defined with a!!C numeric vari- able> that specifies "long"+"+4hen it is assumed that4he!!em- bedded SQL C0rogram> contains a6ariable named SQLCODE defined with a data type of "long". Note: SQLSTATE is4he0referred status parameter. The SQLCODE status parameter is a deprecated feature that is supported for compatibility with earlier6ersions of4his International Standard. See Annex D, "Deprecated features". Access Rules None. General Rules 1) See Subclause 19.1, "". Leveling Rules 1) The following restrictions apply for!?ntermediate SQL: a) A!!C derived variable> shall not be a!!C bit variable>. 2) The following restrictions apply for Entry SQL in addition4o any Intermediate SQL restrictions: a) A!!C derived variable> shall not be a!!C VARCHAR variable>. b) A!!C variable definition> shall not contain a!!character set specification>. Embedded SQL 507 X0ß0¯0í0ó(g()92-154e¤BL CBR-002 .5!!embedded SQL COBOL0rogram> 19.5 !!embedded SQL COBOL0rogram> Function Specify an . Format !!embedded SQL COBOL0rogram> ::= TEL See4he Syntax Rules. !!COBOL variable definition> ::= "01|77}!!COBOL host identifier>!!COBOL type specification> [ ... ] !!COBOL host identifier> ::= !SMSee the Syntax Rules. ::= !!COBOL character type> | =!!COBOL numeric type> | !!COBOL character type> ::= [ CHARACTER SET [ IS ]!!character set specification> ] " PIC= PICTURE( [!?S ] { X [ !!length> ] }... ::= " PIC= PICTURE( [!?S ] { B [ !!length> ] }... ::= " PIC= PICTURE( [!?S ] S [ USAGE [ IS ] ] DISPLAY SIGN LEADING SEPARATE !!COBOL nines specification> ::= !!COBOL nines> [ V [!!COBOL nines> ] ] = V!!COBOL nines> !!COBOL integer type> ::= | !!COBOL computational integer> ::= " PIC= PICTURE( [!?S ] S [ USAGE [!?S ] ] { COMP= COMPUTATIONAL( !!COBOL binary integer> ::= { PIC | PICTURE } [ IS ] S [ USAGE [ IS ] ] BINARY ::= { 9 [ !!length> ] }... 5SA Database Language SQL X0ß0¯0í0ó(g()92-154e¤BL CBR-002 .5!!embedded SQL COBOL0rogram> Syntax Rules 1) An!!embedded SQL COBOL0rogram> is a compilation5nit that con- sists of COBOL4ext and SQL text. The COBOL text shall conform 4o the COBOL standard!?SO 1989. The SQL4ext shall consist of one or more!!embedded SQL statement>s and, optionally, one or more s. 2) An!!embedded SQL statement> in an may be specified wherever a COBOL statement may be specified in4he Procedure Division of4he!!embedded SQL COBOL0ro- gram>.!?f the COBOL statement could be immediately0receded by a0aragraph-name,4hen the may be immediately preceded by a paragraph-name. 0Î0Ã0È A!!COBOL host identifier> is any valid COBOL data-name. A!!COBOL host identifier> shall be contained in an . 4) A!!COBOL variable definition> is a restricted form of COBOL data description entry that defines a host variable. 5) A!!COBOL variable definition> shall be modified as follows be- fore it is0laced into4he0rogram derived from the (see the Syntax Rules of Subclause .1, "". a) Any optional CHARACTER SET specification shall be removed from a . b) The syntax "B" shall be replaced by "X" in any!!COBOL bit type>. c) The!!length> specified in any!!COBOL bit type> shall be re- 0laced by a length equal to4he smallest integer not less 4han L/B, as defined in4he Syntax Rules of4his Subclause. d) The!!length> specified in any!!COBOL character type> that contained a CHARACTER SET specification shall be replaced by a length equal4o the length in octets of PN, where PN is the specified in4he containing . The modified!!COBOL variable definition> shall be a valid data description entry in the Data Division of4he0rogram derived from the . 6) The optional sequence in a!!COBOL variable definition> may specify a VALUE clause. 2 2 2 2hether other clauses may be specified is implementation-defined. The!!char- acter representation> sequence shall be such4hat the is a6alid COBOL data description entry. Embedded SQL 5SD X3H2-9(g()¬4/DBL CBR-00() 19.5 7) A!!COBOL character type> describes a character string6ari- able whose equivalent SQL data type is CHARACTER with4he same length and character set specified by .!?f is not specified, then an implementation-defined!!character set specification> is implicit. 8) A!!COBOL bit type> describes a bit string6ariable. Let B be the number of bits in a COBOL character and let L be4he!!length> of4he!!COBOL bit type>. The length of an equivalent COBOL char- acter6ariable is4he smallest integer not less4han L/B. The equivalent SQL data4ype is BIT7hose length is4he!!length> of 4he!!COBOL bit type>. 9) A describes an exact numeric variable. The equivalent SQL data type is NUMERIC of4he same precision and scale. 10)A describes an exact numeric6ari- able. Note: This!!COBOL type specification> is supported only for SQLCODE for compatibility with earlier6ersions of4his International Standard. The SQLCODE status0arameter is a deprecated feature4hat is supported for compatibility7ith earlier versions of this!?nternational Standard. See Annex D, "Deprecated features". 11)A describes an exact numeric variable. The equivalent SQL data type is SMALLINT or INTEGER. 1(SA)If an contains neither a that specifies SQLSTATE and that is defined with a!!COBOL character type> that specifies {0/77} SQLSTATE PICTURE X(5) nor a!!COBOL variable definition>4hat specifies SQLCODE and that is defined with a!!COBOL type specification> that specifies {0/77} SQLCODE PICTURE S9(PC) USAGE COMP 7here PC is4he implementation-defined precision specified for a COBOL SQLCODE parameter in Subclause 1(‘Ñ)4, "Calls to a!!proce- dure>"+"+4hen it is assumed that4he!!embedded SQL COBOL0rogram> contains a6ariable named SQLCODE defined with a data type of "01|77} SQLCODE PICTURE S9(PC) USAGE COMP where PC is the implementation-defined0recision specified for a COBOL SQLCODE0arameter in Subclause .4, "Calls4o a ". Note: SQLSTATE is4he0referred status parameter. The SQLCODE status parameter is a deprecated feature that is supported for compatibility with earlier6ersions of4his International Standard. See Annex D, "Deprecated features". 510 Database Language SQL X3H2-9(g()¬4/DBL CBR-00() 19.5 Access Rules None. General Rules 1) See Subclause 19.1, "". Leveling Rules 1) The following restrictions apply for!?ntermediate SQL: a) A!!COBOL type specification> shall not be a!!COBOL bit type>. 2) The following restrictions apply for Entry SQL in addition4o any Intermediate SQL restrictions: a) A!!COBOL character type> shall not contain a . Embedded SQL 5 X3H2-9(g()¬4/DBL CBR-00() 19.6 .6 Function Specify an!!embedded SQL Fortran0rogram>. Format ::= !SMSee the Syntax Rules. ::= !!Fortran host identifier> ["!!comma>!!Fortran host identifier>(... ] !!Fortran host identifier> ::= !SMSee the Syntax Rules. ::= CHARACTER [!!asterisk> ] [ CHARACTER SET [!?S ] ] | BIT [ !!length> ] | INTEGER | REAL = DOUBLE PRECISION Syntax Rules 1) An is a compilation unit4hat consists of Fortran text and SQL4ext. The Fortran4ext shall conform to4he Fortran standard ISO/IEC ¬0Ø0ë0Ä. The SQL text shall consist of one or more s and, option- ally, one or more!!embedded SQL declare section>s. (SA) An may be specified wherever an exe- cutable Fortran statement may be specified. An 4hat precedes any executable Fortran statement in 4he containing shall not have a Fortran statement number. Otherwise, if the Fortran statement could have a statement number then4he!!embedded SQL statement> can have a statement number. 2 2) Blanks are significant in s. The rules for!!separator>s in an are as specified in Subclause 5.2, " and!!separator>". 2 2 2) A is any6alid Fortran6ariable name 7ith all characters removed. A shall be contained in an!!embedded SQL Fortran0rogram>. 5) A is a restricted form of Fortran type-statement4hat defines one or more host6ariables. 5 Database Language SQL X0ß0¯0í0ó(g()92-154e¤BL CBR-002 .6!!embedded SQL Fortran0rogram> 5 5) A shall be modified as follows before it is placed into the program derived from4he!!embed- ded SQL Fortran0rogram> (see4he Syntax Rules Subclause .1, "". a) Any optional CHARACTER SET specification shall be removed from the CHARACTER alternative in a!!Fortran type specifica- tion>. b) The!!length> specified in4he CHARACTER alternative of any 4hat contained a CHARACTER SET specification shall be replaced by a length equal to 4he length in octets of PN,7here PN is4he!!Fortran host identifier> specified in the containing!!Fortran variable definition>. c) The syntax "BIT" shall be replaced by "CHARACTER" in any BIT alternative of a . d) The specified in any BIT alternative of a!!Fortran type specification> shall be replaced by a length equal to 4he smallest integer not less4han L/B, as defined in4he Syntax Rules of4his Subclause. The modified!!Fortran variable definition> shall be a valid Fortran type-statement in the program derived from4he!!embedded SQL Fortran0rogram>. 5 5 5) CHARACTER describes a character string6ariable whose equivalent SQL data type is CHARACTER with4he same length and character set specified by .!?f is not specified, then an implementation- defined is implicit. 8) BIT describes a bit string6ariable. Let B be the number of bits in a Fortran CHARACTER and let L be4he!!length> of4he bit string variable. The length of an equivalent Fortran character variable is the smallest integer not less than Le‡. The equiv- alent SQL data type is BIT whose length is the of the bit string6ariable. 9) INTEGER describes an exact numeric6ariable. The equivalent SQL data4ype is!?NTEGER. 10)REAL describes an approximate numeric6ariable. The equivalent SQL data4ype is REAL. 11)DOUBLE PRECISION describes an approximate numeric variable. The equivalent SQL data type is DOUBLE PRECISION. )If an!!embedded SQL Fortran0rogram> contains neither a!!Fortran variable definition>4hat specifies SQLSTATE or SQLSTA and4hat is defined7ith a 4hat specifies CHARACTER with!!length> 5, nor a!!Fortran variable definition> 4hat specifies SQLCOD and4hat is defined7ith a specification>4hat specifies INTEGER,4hen it is assumed that 4he!!embedded SQL Fortran0rogram> contains a6ariable named SQLCOD defined7ith a data4ype of!?NTEGER. Note: SQLSTATE (which may be abbreviated "SQLSTA") is4he0re- ferred status parameter. The SQLCODE (SQLCOD) status0arameter is a deprecated feature4hat is supported for compatibility7ith earlier versions of this!?nternational Standard. See Annex D, "Deprecated features". Access Rules None. ??eneral Rules 1) See Subclause .1, "". Leveling Rules 1) The following restrictions apply for Intermediate SQL: a) A shall not specify BIT. (SA) The following restrictions apply for Entry SQL in addition to any!?ntermediate SQL restrictions: a) A shall not contain a!!character set specification>. 514 Database Language SQL X3H2-9(g()¬4/DBL CBR-00() 19.7 .7 Function Specify an!!embedded SQL MUMPS0rogram>. Format ::= !SMSee the Syntax Rules. ::= { =!!MUMPS character variable> } ::= VARCHAR!!MUMPS host identifier>!!MUMPS length specification> [ { (... ] !!MUMPS host identifier> ::= !SMSee the Syntax Rules. ::= !!left0aren> !!right paren> !!MUMPS numeric variable> ::= !!MUMPS host identifier> ["!!comma>!!MUMPS host identifier>(... ] !!MUMPS type specification> ::= INT | DEC [ !!precision> [!!comma>!!scale> ]!!right paren> ] | REAL Syntax Rules 1) An!!embedded SQL MUMPS0rogram> is a compilation5nit that con- sists of MUMPS4ext and SQL text. The MUMPS text shall conform 4o the MUMPS standard!?SOgEC 156. The SQL text shall consist of one or more s and, optionally, one or more!!embedded SQL declare section>s. (SA) A!!MUMPS host identifier> is any valid MUMPS variable name. A !!MUMPS host identifier> shall be contained in an . 0Î0Ã0È An may be specified wherever a MUMPS command may be specified. 2 2 2) A defines one or more host6ari- ables. Embedded SQL 515 X0ß0¯0í0ó(g()92-154e¤BL CBR-002 .7!!embedded SQL MUMPS0rogram> 5) The describes a6ariable-length char- acter string. The equivalent SQL data4ype is CHARACTER VARYING 7hose maximum length is4he!!length> of4he!!MUMPS length spec- ification> and whose character set is implementation-defined. 5 5) INT describes an exact numeric6ariable. The equivalent SQL data 4ype is!?NTEGER. 7) DEC describes an exact numeric variable. The shall not be greater4han the . The equivalent SQL data4ype is DECIMAL7ith the same!!precision> and!!scale>. 8) REAL describes an approximate numeric6ariable. The equivalent SQL data4ype is REAL. 9) If an contains neither a that specifies SQLSTATE and that is defined with a!!MUMPS character variable 4hat specifies VARCHAR with a!!MUMPS length specification> that specifies 5, nor a that specifies SQLCODE and4hat is defined 7ith a 4hat specifies INT,4hen it is assumed that4he!!embedded SQL MUMPS0rogram> contains a 6ariable named SQLCODE defined with a data type of INT. Note: SQLSTATE is the preferred status0arameter. The SQLCODE status0arameter is a deprecated feature4hat is supported for compatibility7ith earlier versions of this!?nternational Standard. See Annex D, "Deprecated features". Access Rules None. ??eneral Rules 1) See Subclause .1, "". Leveling Rules 1) The following restrictions apply for Intermediate SQL: None. 2) The following restrictions apply for Entry SQL in addition4o any Intermediate SQL restrictions: a) Conforming Entry SQL language shall contain no . 5­ Database Language SQL X0ß0¯0í0ó(g()92-154e¤BL CBR-002 19.8 19.8 !!embedded SQL Pascal program> Function Specify an!!embedded SQL Pascal program>. Format !!embedded SQL Pascal program> ::= !SMSee the Syntax Rules. ::= !!Pascal host identifier> [ { (... ] !!Pascal4ype specification>!!semicolon> !!Pascal host identifier> ::= TEL See4he Syntax Rules. !!Pascal4ype specification> ::= PACKED ARRAY 1!!double0eriod>!!length> OF CHAR [ CHARACTER SET [!?S ] ] | PACKED ARRAY!!left bracket> 1 !!right bracket> OF BIT =!?NTEGER = REAL | CHAR [ CHARACTER SET [!?S ] ] = BIT Syntax Rules 1) An!!embedded SQL Pascal program> is a compilation unit4hat consists of Pascal4ext and SQL text. The Pascal4ext shall conform to one of the Pascal standards!?SO 5 5 55 and ISO/IEC 10(eå)6. The SQL4ext shall consist of one or more!!embedded SQL statement>s and, optionally, one or more s. 2) An!!embedded SQL statement> may be specified7herever a Pascal statement may be specified. An may be prefixed by a Pascal label. 0Î0Ã0È A!!Pascal host identifier> is a Pascal variable-identifier whose applied instance denotes a defining instance7ithin an!!embedded SQL begin declare> and an!!embedded SQL end declare>. 2 2 2) A defines one or more!!Pascal host identifier>s. Embedded SQL 517 X0ß0¯0í0ó(g()92-154e¤BL CBR-002 .8!!embedded SQL Pascal program> 5) A!!Pascal6ariable definition> shall be modified as follows before it is placed into the program derived from4he!!embedded SQL Pascal program> (see the Syntax Rules of Subclause .1, ""). a) Any optional CHARACTER SET specification shall be removed from4he PACKED ARRAY OF CHAR or CHAR alternatives of a . b) The!!length> specified in4he PACKED ARRAY OF CHAR alter- native of any!!Pascal4ype specification>4hat contained a CHARACTER SET specification shall be replaced by a length equal to4he length in octets of PN,7here PN is4he!!Pascal host identifier> specified in4he containing . c) If any!!Pascal4ype specification> specifies4he syntax "CHAR" and contains a CHARACTER SET specification,4hen let L be a length equal to4he length in octets of PN and PN be the specified in the containing!!Pascal 6ariable definition>.!?f L is greater4han 1,4hen "CHAR" shall be replaced by "PACKED ARRAY [1..L] OF CHAR". d) The syntax "BIT" shall be replaced by "CHAR" in any PACKED ARRAY OF BIT or BIT alternatives of a . e) The!!length> specified in any PACKED ARRAY OF BIT alterna- tive in a shall be replaced by a length equal to4he smallest integer not less4han L/B, as defined in4he Syntax Rules of4his Subclause. The modified!!Pascal6ariable definition> shall be a6alid Pascal variable-declaration in the program derived from4he !!embedded SQL Pascal program>. 6) CHAR specified without a CHARACTER SET specification is4he ordinal-type-identifier of PASCAL. The equivalent SQL data type is CHARACTER with length 1. 5 5 5) BIT describes a single-bit6ariable.!?t is mapped to a Pascal CHAR ordinal-type-identifier7hose most significant bit contains either 0 or 1 and7hose least significant bits contain 0. The equivalent SQL data4ype is BIT7ith length 1. 8) PACKED ARRAY [1..] OF CHAR describes a character string having (N)or more components of the simple4ype CHAR. The equiva- lent SQL data type is CHARACTER with4he same length and charac- 4er set specified by .!?f is not specified, then an implementation- defined is implicit. 5 Database Language SQL X0ß0¯0í0ó(g()92-154e¤BL CBR-002 19.8 9) PACKED ARRAY [1..] OF BIT describes a bit string6ari- able. Let B be the number of bits in a Pascal CHAR and let L be 4he!!length> of4he bit string variable. The length of an equiv- alent Pascal character6ariable is4he smallest integer not less 4han L/B. The equivalent SQL data4ype is BIT7hose length is 4he!!length> of4he bit string variable. 10)INTEGER describes an exact numeric variable. The equivalent SQL data type is INTEGER. 11)REAL describes an approximate numeric variable. The equivalent SQL data type is REAL. )If an!!embedded SQL Pascal program> contains neither a 4hat specifies SQLSTATE and4hat is defined 7ith a that specifies PACKED ARRAY [1..] OF CHAR with!!length> 5, nor a!!Pascal6ariable definition> that specifies SQLCODE and4hat is defined7ith a that specifies!?NTEGER, then it is assumed4hat the contains a 6ariable named SQLCODE defined with a data type of INTEGER. Note: SQLSTATE is the preferred status0arameter. The SQLCODE status0arameter is a deprecated feature4hat is supported for compatibility7ith earlier versions of this!?nternational Standard. See Annex D, "Deprecated features". Access Rules None. ??eneral Rules 1) See Subclause .1, "". Leveling Rules 1) The following restrictions apply for Intermediate SQL: a) A shall not specify BIT or PACKED ARRAY [1..] OF BIT. (SA) The following restrictions apply for Entry SQL in addition to any!?ntermediate SQL restrictions: a) A shall not contain a . Embedded SQL 5 X3H2-9(g()¬4/DBL CBR-00() 19.9 19.9 !!embedded SQL PL/I program> Function Specify an!!embedded SQL PL/I program>. Format !!embedded SQL PL/I program> ::= !SMSee the Syntax Rules. ::= "DCL | DECLARE} { | !!PLg host identifier> [ { (... ] } !!PLg4ype specification> [!!character representation>... ]!!semicolon> !!PLg host identifier> ::= TEL See4he Syntax Rules. !!PLg4ype specification> ::= " CHAR | CHARACTER } [ VARYING ] [ CHARACTER SET [!?S ] ] | BIT [ VARYING ] | !!precision> [!!comma>!!scale> ]!!right paren> =!!PLg4ype fixed binary> [ !!precision>!!right paren> ] | !!left0aren> !!PLg4ype fixed decimal> ::= " DEC= DECIMAL( FIXED = FIXED" DEC= DECIMAL( !!PLg4ype fixed binary> ::= { BIN | BINARY( FIXED = FIXED" BIN= BINARY } ::= " BIN= BINARY } FLOAT | FLOAT { BIN | BINARY( 520 Database Language SQL X3H2-9(g()¬4/DBL CBR-00() .9!!embedded SQL PL/I program> Syntax Rules 1) An!!embedded SQL PL/I program> is a compilation unit4hat con- sists of PLg4ext and SQL text. The PLg4ext shall conform to 4he PL/I standard!?SO 5 5­0. The SQL4ext shall consist of one or more!!embedded SQL statement>s and, optionally, one or more s. 2) An!!embedded SQL statement> may be specified7herever a PLg statement may be specified within a0rocedure block. If4he PL/I statement could include a label prefix, the may be immediately preceded by a label prefix. 0Î0Ã0È A!!PLg host identifier> is any6alid PL/I variable identifier. A!!PLg host identifier> shall be contained in an!!embedded SQL PL/I program>. 4) A!!PLg6ariable definition> defines one or more host6ariables. 5) A!!PLg6ariable definition> shall be modified as follows before it is placed into the program derived from4he!!embedded SQL PL/I program> (see the Syntax Rules of Subclause .1, ""). a) Any optional CHARACTER SET specification shall be removed from4he CHARACTER or CHARACTER VARYING alternatives of a . b) The!!length> specified in4he CHARACTER or CHARACTER VARYING alternatives of any that contains a CHARACTER SET specification shall be replaced by a length equal to4he length in octets of PN,7here PN is4he!!PLg host identifier> specified in4he containing . The modified shall be a valid PLg data declaration in4he0rogram derived from the . 5 5) A shall specify a scalar variable, not an array or structure. 5 5 5) The optional!!character representation> sequence in a may specify an INITIAL clause. Whether other clauses may be specified is implementation-defined. The sequence shall be such that4he!!PLg 6ariable definition> is a6alid PL/I DECLARE statement. 8) CHARACTER describes a character string6ariable whose equiva- lent SQL data type has4he character set specified by .!?f is not specified, then an implementation-defined!!character set specification> is implicit. Embedded SQL 521 X0ß0¯0í0ó(g()92-154e¤BL CBR-002 .9!!embedded SQL PL/I program> Case: a)!?f VARYING is not specified, the length of the variable is fixed. The equivalent SQL data4ype is CHARACTER7ith the same length. b)!?f VARYING is specified, the variable is of6ariable length, with maximum size the value of!!length>. The equivalent SQL data4ype is CHARACTER VARYING7ith the same maximum length. 9) BIT describes a bit string6ariable. Case: a) If VARYING is not specified,4hen the length of the variable is fixed. The equivalent SQL data4ype is BIT7ith the same length. b)!?f VARYING is specified, then4he6ariable is of variable length with maximum size of4he6alue of . The equiv- alent SQL data type is BIT VARYING with4he same maximum length. 10)FIXED DECIMAL describes an exact numeric variable. The shall not be greater4han the . The equivalent SQL data4ype is DECIMAL7ith the same!!precision> and!!scale>. )FIXED BINARY describes an exact numeric6ariable. The equivalent SQL data4ype is SMALLINT or!?NTEGER. )FLOAT BINARY describes an approximate numeric6ariable. The equivalent SQL data4ype is FLOAT7ith the same!!precision>. ª)If an!!embedded SQL PL/I program> contains neither a 4hat specifies SQLSTATE and4hat is de- fined7ith a that specifies CHAR or CHARACTER7ith 5 and does not specify VARYING, nor a !!PLg6ariable definition> that specifies SQLCODE and4hat is defined7ith a that specifies FIXED BIN(PP) or FIXED BINARY(PP), where PP is the implementation- defined precision specified for a PLg SQLCODE0arameter in Subclause .4, "Calls4o a ", then it is assumed 4hat the contains a6ariable named SQLCODE defined with a data type of FIXED BINARY(PP), where PP is the implementation-defined0recision specified for a PL/I SQLCODE parameter in Subclause 1(‘Ñ)4, "Calls to a!!procedure>". Note: SQLSTATE is the preferred status0arameter. The SQLCODE status0arameter is a deprecated feature4hat is supported for compatibility7ith earlier versions of this!?nternational Standard. See Annex D, "Deprecated features". Access Rules None. 5(g ) Database Language SQL X0ß0¯0í0ó(g()92-154e¤BL CBR-002 19.9 ??eneral Rules 1) See Subclause .1, "" Leveling Rules 1) The following restrictions apply for!?ntermediate SQL: a) A!!PLg4ype specification> shall not specify BIT or BIT VARYING. 2) The following restrictions apply for Entry SQL in addition4o any Intermediate SQL restrictions: a) A!!PLg4ype specification> shall not specify CHARACTER VARYING. b) A shall not contain a . Embedded SQL 5(y>) X3H2-9(g()¬4/DBL CBR-00() 524 Database Language SQL X3H2-9(g()¬4/DBL CBR-00() 20 Direct invocation of SQL (eå).1 Function Specify direct execution of SQL. Format ::= !!directly executable statement>!!semicolon> !!directly executable statement> ::= !!direct SQL data statement> =!!SQL schema statement> | | =!!SQL session statement> =!!direct implementation-defined statement> !!direct SQL data statement> ::= !!delete statement: searched> | =!!insert statement> | =!!temporary table declaration> !!direct implementation-defined statement> ::= !1 D3ee4he Syntax Rules Syntax Rules 1) The shall not contain any ,!!dynamic parameter specification>, or!!variable specification>. 2) The that represents the null6alue is implementation-defined. 0Î0Ã0È The Format and Syntax Rules for!!direct implementation-defined statement> are implementation-defined. Access Rules 1) The Access Rules for are implementation-defined. Direct invocation of SQL 525 X0ß0¯0í0ó(g()92-154e¤BL CBR-002 (eå).1!!direct SQL statement> ??eneral Rules 1) The following s are transaction-initiating !!direct SQL statement>s: a) s that are4ransaction-initiating s; b) ; and c) s4hat are transaction- initiating. 2) After the last invocation of an SQL-statement by an SQL-agent in an SQL-session: a) A!!rollback statement> or a!!commit statement> is effectively executed.!?f an5nrecoverable error has occurred, or if4he direct invocation of SQL terminated5nexpectedly, or if any constraint is not satisfied, then a!!rollback statement> is0erformed. Otherwise,4he choice of7hich of these SQL- statements to0erform is implementation-dependent. The deter- mination of7hether a direct invocation of SQL has terminated 5nexpectedly is implementation-dependent. b) Let D be the of any system descriptor area that is currently allocated within4he current SQL-session. A that specifies DEALLOCATE DESCRIPTOR D is effectively executed. c) All SQL-sessions associated7ith the SQL-agent are termi- nated. 0Î0Ã0È Let S be the . 4) The current!!authorization identifier> for privilege determi- nation for the execution of S is the SQL-session . 5)!?f S does not conform4o the Format, Syntax Rules, and Access Rules for a!!direct SQL statement>,4hen an exception condition is raised: syntax error or access rule violation in direct SQL statement. 5 5) When S is invoked by4he SQL-agent: Case: a)!?f S is an , then: i) The diagnostics area is emptied. ii) S is executed. 526 Database Language SQL X3H2-9(g()¬4/DBL CBR-00() 20.1 iii) If S successfully initiated or resumed an SQL-session,4hen subsequent invocations of a!!direct SQL statement> by4he SQL-agent are associated7ith that SQL-session5ntil4he SQL-agent terminates4he SQL-session or makes it dormant. b) Otherwise: i)!?f no SQL-session is current for the SQL-agent,4hen Case: 1)!?f the SQL-agent has not executed an and there is no default SQL-session asso- ciated with4he SQL-agent, then4he following!!connect statement> is effectively executed: CONNECT TO DEFAULT 2) If4he SQL-agent has not executed an!!SQL connection statement> and4here is a default SQL-session associated with4he SQL-agent, then4he following!!set connection statement> is effectively executed: SET CONNECTION DEFAULT 0Î0Ã0È Otherwise, an exception condition is raised: connection exception-connection does not exist. Subsequent calls to a!!procedure> or invocations of a!!di- rect SQL statement> by the SQL-agent are associated7ith 4he SQL-session5ntil4he SQL-agent4erminates the SQL- session or makes it dormant. ii)!?f an SQL-transaction is active for4he SQL-agent, then S is associated with4hat SQL-transaction.!?f S is a ,4hen it is implementation-defined whether or not S may be associated with an active SQL-transaction; if not, then an exception condition is raised: invalid transaction state. iii)!?f no SQL-transaction is active for4he SQL-agent, then 1) Case: A)!?f S is a4ransaction-initiating , then an SQL-transaction is initiated. B)!?f S is a!!direct implementation-defined statement>, then it is implementation-defined whether or not S initiates an SQL-transaction.!?f an implementation defines S to be transaction-initiating, then an SQL- 4ransaction is initiated. 2) If S initiated an SQL-transaction,4hen: A) Let T be4he SQL-transaction initiated by S. Direct invocation of SQL 5(y]) X3H2-9(g()¬4/DBL CBR-00() 20.1 B) T is associated7ith this invocation and any subse- iuent invocations of s or calls 4o a by4he SQL-agent5ntil4he SQL-agent 4erminates T. C) Case: !?) If a!!set transaction statement> has been executed since4he4ermination of the last SQL-transaction in the SQL-session (or if4here has been no0revi- ous SQL-transaction in4he SQL-session and a!!set transaction statement> has been executed),4hen the access mode, constraint mode, and isolation level of T are set as specified by4he!!set transaction statement>. II) Otherwise,4he access mode, constraint mode for all constraints, and isolation level for T are read- 7rite, immediate, and SERIALIZABLE, respectively. D) T is associated with4he SQL-session. iv) If S contains an!!SQL schema statement> and the access mode of the current SQL-transaction is read-only, then an exception condition is raised: invalid transaction state. v) The diagnostics area is emptied. vi) S is executed. 5 5 5) If4he execution of a occurs7ithin the same SQL-transaction as the execution of an SQL-schema statement and4his is not allowed by the SQL-implementation, then an exception condition is raised: invalid4ransaction state. 8) Case: a)!?f S executed successfully,4hen either a completion condi- 4ion is raised: successful execution, or a completion condi- tion is raised: warning, or a completion condition is raised: no data, as determined by the General Rules in4his and other Subclauses of this!?nternational Standard. b)!?f S did not execute successfully, then all changes made to SQL-data or schemas by the execution of S are canceled and an exception condition is raised as determined by the General Rules in4his and other Subclauses of this!?nternational Standard. Note: The method of raising a condition is implementation- defined. 5(R´) Database Language SQL X0ß0¯0í0ó(g()92-154e¤BL CBR-002 (eå).1!!direct SQL statement> 9) Diagnostics information resulting from4he execution of S is 0laced into4he diagnostics area as specified in Clause 18, "Diagnostics management". Note: The method of accessing the diagnostics information is implementation-defined, but does not alter the contents of the diagnostics area. Leveling Rules 1) The following restrictions apply for!?ntermediate SQL: None. (SA) The following restrictions apply for Entry SQL in addition to any!?ntermediate SQL restrictions: a) A shall not be an!!SQL schema state- ment>. Direct invocation of SQL 5(Nã) X3H2-9(g()¬4/DBL CBR-00() 20.(N) (eå).2 Function Specify a statement to retrieve multiple rows from a specified table. Format ::= !!query expression> [ ] Syntax Rules 1) All Syntax Rules of Subclause 5 5 5.10, ""+"+ apply 4o the . (SA) The!!query expression> or!!order by clause> of a shall not contain any!!value specifi- cation> other4han a , CURRENT_USER, SESSION_USER, or SYSTEM_USER. 2 2) Let T be4he4able specified by the . 4)!?f ORDER BY is specified,4hen each!!sort specification> in4he !!order by clause> shall identify a column of T. Case: a) If a!!sort specification> contains a!!column name>, then T shall contain exactly one column with4hat and the identifies that column. b)!?f a contains an!!unsigned integer>, 4hen the shall be greater than 0 and not greater4han the degree of T. The!!sort specification> iden- tifies4he column of T7ith the ordinal position specified by the . Access Rules None. General Rules 1) All??eneral Rules of Subclause 7.10, "", apply to4he!!direct select statement: multiple rows>. 2) Let Q be4he result of4he!!query expression>. 2 2) If Q is empty,4hen a completion condition is raised: no data. 2 2 2) If an is not specified, then4he ordering of 4he rows of Q is implementation-dependent. 530 Database Language SQL X3H2-9(g()¬4/DBL CBR-00() 20.(N) 5)!?f an!!order by clause> is specified,4hen the ordering of rows of the result is effectively determined by the as follows: a) Each!!sort specification> specifies the sort direction for 4he corresponding sort key Ki. If ASC is specified or implied in the i-th!!sort specification>,4hen the sort direction for Ki is ascending and4he applicable is4he!!less 4han operator>. Otherwise, the sort direction for Ki is de- scending and the applicable!!comp op> is the . b) Let X and Y be distinct rows in4he result table, and let XVi and YVi be the values of Ki in these rows, respectively. The relative0osition of rows X and Y in4he result is de- 4ermined by comparing XVi and YVi according4o the rules of Subclause 8.2, "", where the is4he applicable for Ki, with4he following spe- cial4reatment of null6alues. 2 2 2 2hether a sort key value that is null is considered greater or less4han a non-null6alue is implementation-defined, but all sort key6alues that are null shall either be considered greater4han all non-null 6alues or be considered less than all non-null values. XVi is said to0recede YVi if the value of4he!!comparison0red- icate> "XVi!!comp op> YVi" is4rue for the applicable!!comp op>. c) In4he result table,4he relative position of row X is before row Y if and only if XVn0recedes YVn for some n greater4han 0 and less4han the number of s and XVi = YVi for all i < n. The relative order of4wo rows for which XVi = YVi for all i is implementation-dependent. 5 5) If Q is not empty,4hen Q is returned. The method of returning Q is implementation-defined. Leveling Rules 1) The following restrictions apply for!?ntermediate SQL: None. (SA) The following restrictions apply for Entry SQL in addition to any!?ntermediate SQL restrictions: None. Direct invocation of SQL 531 X0ß0¯0í0ó(g()92-154e¤BL CBR-002 50Õ0¡0é0Ã0É Database Language SQL X0ß0¯0í0ó(g()92-154e¤BL CBR-002 (h*) Information Schema and Definition Schema 21.1 !?ntroduction The views of4he!?nformation Schema are defined in4erms of base tables. The only0urpose of the Definition Schema is4o provide a data model to support4he!?nformation Schema and to assist under- standing. An implementation need do no more than simulate the exis- 4ence of the Definition Schema, as viewed4hrough4he!?nformation Schema6iews. The Information Schema6iews are defined as being in a schema named !?NFORMATION_SCHEMA, enabling these views to be accessed in the same way as any other4ables in any other schema. SELECT on all of these 6iews is granted to PUBLIC WITH??RANT OPTION, so that4hey can be queried by any5ser and so4hat SELECT0rivilege can be further granted on views that reference4hese!?nformation Schema views. No other0rivilege is granted on4hem, so they cannot be5pdated. The Information Schema also contains a small number of domains on 7hich4he columns of the Definition Schema are based. USAGE on all 4hese domains is granted to PUBLIC WITH??RANT OPTION, so that4hey can be used by any user. An implementation may define objects4hat are associated7ith !?NFORMATION_SCHEMA that are not defined in this Clause. An im- 0lementation may also add columns4o tables4hat are defined in this Clause. The base tables are defined as being in a schema named DEFINITION_ SCHEMA. Because!!unqualified schema name>s are prohibited from specifying DEFINITION_SCHEMA,4he Definition Schema cannot be ac- cessed in an SQL-statement. Note: The Information Schema4ables may be supposed to be rep- resented in the Definition Schema in4he same way as any other tables, and are hence self-describing. Note: The!?nformation Schema is a definition of4he SQL data model, specified as an SQL-schema, in4erms of s as defined in4his International Standard. Constraints defined in4his Clause are not actual SQL constraints. s are represented in4he4ables of4he!?nformation Schema by s corresponding4o their s (in the case of s) or their s (in the case of s). Comparison of!!identifier>s is defined in Subclause 8.2, "". 2 2 2 2here an has many equivalent forms, 4he one encountered at definition4ime is stored (of course, any lower case letters appearing in a!!regular identifier> will have !?nformation Schema and Definition Schema 530ª0ü0à X0ß0¯0í0ó(g()92-154e¤BL CBR-002 (h*).1!?ntroduction been converted to4he corresponding5pper case letter before the !!identifier> is stored in any4able of the Information Schema). 534 Database Language SQL X3H2-9(g()¬4/DBL CBR-00() 21.(N)Information Schema (h*).2 Information Schema 21.(‘Ñ)1 !?NFORMATION_SCHEMA Schema Function Identify4he schema that is to contain4he!?nformation Schema ta- bles. Definition CREATE SCHEMA INFORMATION_SCHEMA AUTHORIZATION!?NFORMATION_SCHEMA Leveling Rules 1) The following restrictions apply for Intermediate SQL: None. 2) The following restrictions apply for Entry SQL in addition4o any Intermediate SQL restrictions: a) Conforming Entry SQL language shall not reference4he !?nformation Schema. !?nformation Schema and Definition Schema 535 X0ß0¯0í0ó(g()92-154e¤BL CBR-002 (h*).2!?nformation Schema 21.(‘Ñ)(N)!?NFORMATION_SCHEMA_CATALOG_NAME base table Function !?dentify the catalog that contains the Information Schema. Definition CREATE TABLE INFORMATION_SCHEMA_CATALOG_NAME ( CATALOG_NAME SQL_IDENTIFIER, CONSTRAINT!?NFORMATION_SCHEMA_CATALOG_NAME_PRIMARY_KEY PRIMARY KEY ( CATALOG_NAME ) ) Definition 1) The value of CATALOG_NAME is4he name of4he catalog in which this!?nformation Schema resides. Leveling Rules 1) The following restrictions apply for Intermediate SQL: None. 2) The following restrictions apply for Entry SQL in addition4o any Intermediate SQL restrictions: a) Conforming Entry SQL language shall not reference4he !?nformation Schema. 50Ø0¯0¿0ü0ë Database Language SQL X0ß0¯0í0ó(g()92-154e¤BL CBR-002 (h*).2!?nformation Schema 21.(‘Ñ)0µ0ó0Á0ü0à!?NFORMATION_SCHEMA_CATALOG_NAME_CARDINALITY assertion Function The assertion INFORMATION_SCHEMA_CATALOG_NAME_CARDINALITY ensures 4hat there is exactly one row in the INFORMATION_SCHEMA_CATALOG_ NAME table. Definition CREATE ASSERTION!?NFORMATION_SCHEMA_CATALOG_NAME_CARDINALITY CHECK ( 1 = ( SELECT COUNT(*) FROM INFORMATION_SCHEMA_CATALOG_NAME ) ) Description 1) The!?NFORMATION_SCHEMA_CATALOG_NAME_CARDINALITY assertion en- sures4hat there is exactly one row in the INFORMATION_SCHEMA_ CATALOG_NAME4able. !?nformation Schema and Definition Schema 537 X0ß0¯0í0ó(g()92-154e¤BL CBR-002 (h*).2!?nformation Schema 21.(‘Ñ)4 SCHEMATA view Function Identify4he schemata that are owned by a given user. Definition CREATE VIEW SCHEMATA AS SELECT CATALOG_NAME, SCHEMA_NAME, SCHEMA_OWNER, DEFAULT_CHARACTER_SET_CATALOG, DEFAULT_CHARACTER_SET_ SCHEMA, DEFAULT_CHARACTER_SET_NAME FROM DEFINITION_SCHEMA.SCHEMATA WHERE SCHEMA_OWNER = CURRENT_USER AND CATALOG_NAME = ( SELECT CATALOG_NAME FROM INFORMATION_SCHEMA_ CATALOG_NAME ) Leveling Rules 1) The following restrictions apply for Intermediate SQL: None. 2) The following restrictions apply for Entry SQL in addition4o any Intermediate SQL restrictions: a) Conforming Entry SQL language shall not reference4he !?nformation Schema. 50Ú0Ë0Ò Database Language SQL X0ß0¯0í0ó(g()92-154e¤BL CBR-002 (h*).2!?nformation Schema 21.(‘Ñ)5 DOMAINS6iew Function !?dentify the domains defined in4his catalog that are accessible to a given user. Definition CREATE VIEW DOMAINS AS SELECT DISTINCT DOMAIN_CATALOG, DOMAIN_SCHEMA, DOMAIN_NAME, DATA_TYPE, CHARACTER_MAXIMUM_LENGTH, CHARACTER_OCTET_ LENGTH, COLLATION_CATALOG, COLLATION_SCHEMA,COLLATION_NAME, CHARACTER_SET_CATALOG, CHARACTER_SET_SCHEMA, CHARACTER_SET_ NAME, NUMERIC_PRECISION, NUMERIC_PRECISION_RADIX, NUMERIC_SCALE, DATETIME_PRECISION, DOMAIN_DEFAULT FROM DEFINITION_SCHEMA.DOMAINS JOIN DEFINITION_SCHEMA.DATA_TYPE_DESCRIPTOR AS D LEFT JOIN DEFINITION_SCHEMA.COLLATIONS AS S USING ( COLLATION_CATALOG, COLLATION_SCHEMA, COLLATION_ NAME ) ON ( ( DOMAIN_CATALOG, DOMAIN_SCHEMA, DOMAIN_NAME, '' ) = ( TABLE_OR_DOMAIN_CATALOG, TABLE_OR_DOMAIN_SCHEMA, TABLE_OR_DOMAIN_NAME, COLUMN_NAME ) ) 2 2 2 2HERE ( ( DOMAIN_CATALOG, DOMAIN_SCHEMA, DOMAIN_NAME, 'DOMAIN' ) !?N ( 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!?NFORMATION_SCHEMA_ CATALOG_NAME ) Information Schema and Definition Schema 50Ø0ë0Ä X3H2-9(g()¬4/DBL CBR-00() 21.(N)Information Schema Leveling Rules 1) The following restrictions apply for!?ntermediate SQL: None. (SA) The following restrictions apply for Entry SQL in addition to any!?ntermediate SQL restrictions: a) Conforming Entry SQL language shall not reference the Information Schema. 540 Database Language SQL X3H2-9(g()¬4/DBL CBR-00() 21.(N)Information Schema (h*).2.6 DOMAIN_CONSTRAINTS6iew Function !?dentify the domain constraints of domains in4his catalog that are accessible4o a given user. Definition CREATE VIEW DOMAIN_CONSTRAINTS AS SELECT DISTINCT CONSTRAINT_CATALOG, CONSTRAINT_SCHEMA, CONSTRAINT_NAME, DOMAIN_CATALOG, DOMAIN_SCHEMA, DOMAIN_NAME, !?S_DEFERRABLE, INITIALLY_DEFERRED FROM DEFINITION_SCHEMA.DOMAIN_CONSTRAINTS JOIN DEFINITION_SCHEMA.SCHEMATA AS S ON ( ( CONSTRAINT_CATALOG, CONSTRAINT_SCHEMA ) = ( S.CATALOG_NAME, SCHEMA_NAME S) ) WHERE SCHEMA_OWNER = CURRENT_USER AND CONSTRAINT_CATALOG = ( SELECT CATALOG_NAME FROM INFORMATION_SCHEMA_ CATALOG_NAME ) Leveling Rules 1) The following restrictions apply for Intermediate SQL: None. 2) The following restrictions apply for Entry SQL in addition4o any Intermediate SQL restrictions: a) Conforming Entry SQL language shall not reference4he !?nformation Schema. Information Schema and Definition Schema 541 X3H2-9(g()¬4/DBL CBR-00() 21.(N)Information Schema (h*).2.7 TABLES6iew Function !?dentify the tables defined in this catalog4hat are accessible4o a given5ser. Definition CREATE VIEW TABLES AS SELECT TABLE_CATALOG, TABLE_SCHEMA, TABLE_NAME, TABLE_TYPE FROM DEFINITION_SCHEMA.TABLES 2 2 2 2HERE ( TABLE_CATALOG, TABLE_SCHEMA, TABLE_NAME ) !?N ( SELECT TABLE_CATALOG, TABLE_SCHEMA, TABLE_NAME FROM DEFINITION_SCHEMA.TABLE_PRIVILEGES 2 2 2 2HERE??RANTEE!?N ( 'PUBLIC', CURRENT_USER ) UNION SELECT TABLE_CATALOG, TABLE_SCHEMA, TABLE_NAME FROM DEFINITION_SCHEMA.COLUMN_PRIVILEGES 2 2 2 2HERE??RANTEE!?N ( 'PUBLIC', CURRENT_USER ) ) AND TABLE_CATALOG = ( SELECT CATALOG_NAME FROM INFORMATION_SCHEMA_ CATALOG_NAME ) Leveling Rules 1) The following restrictions apply for Intermediate SQL: None. 2) The following restrictions apply for Entry SQL in addition4o any Intermediate SQL restrictions: a) Conforming Entry SQL language shall not reference4he !?nformation Schema. 542 Database Language SQL X0ß0¯0í0ó(g()92-154e¤BL CBR-002 (h*).2!?nformation Schema 21.(‘Ñ)8 VIEWS6iew Function !?dentify the viewed4ables defined in4his catalog that are acces- sible4o a given user. Definition CREATE VIEW VIEWS AS SELECT TABLE_CATALOG, TABLE_SCHEMA, TABLE_NAME, CASE 2 2 2 2HEN ( TABLE_CATALOG, TABLE_SCHEMA, CURRENT_USER ) IN ( SELECT CATALOG_NAME, SCHEMA_NAME, SCHEMA_ OWNER FROM DEFINITION_SCHEMA.SCHEMATA ) THEN VIEW_DEFINITION ELSE NULL END AS VIEW_DEFINITION, CHECK_OPTION, IS_UPDATABLE FROM DEFINITION_SCHEMA.VIEWS WHERE ( TABLE_CATALOG, TABLE_SCHEMA, TABLE_NAME ) IN ( SELECT TABLE_CATALOG, TABLE_SCHEMA, TABLE_NAME FROM TABLES ) AND TABLE_CATALOG = ( SELECT CATALOG_NAME FROM INFORMATION_SCHEMA_ CATALOG_NAME ) Leveling Rules 1) The following restrictions apply for Intermediate SQL: None. 2) The following restrictions apply for Entry SQL in addition4o any Intermediate SQL restrictions: a) Conforming Entry SQL language shall not reference4he !?nformation Schema. Information Schema and Definition Schema 543 X3H2-9(g()¬4/DBL CBR-00() 21.(N)Information Schema (h*).2.9 COLUMNS view Function Identify4he columns of tables defined in this catalog4hat are accessible to a given5ser. Definition CREATE VIEW COLUMNS AS SELECT DISTINCT TABLE_CATALOG, TABLE_SCHEMA, TABLE_NAME, C.COLUMN_NAME, ORDINAL_POSITION, CASE WHEN EXISTS ( SELECT * FROM DEFINITION_SCHEMA.SCHEMATA AS S WHERE ( TABLE_CATALOG, TABLE_SCHEMA ) = (S.CATALOG_NAME, S.SCHEMA_NAME ) AND SCHEMA_OWNER = USER ) THEN COLUMN_DEFAULT ELSE NULL END AS COLUMN_DEFAULT, !?S_NULLABLE, COALESCE (D1.DATA_TYPE, D2.DATA_TYPE) AS DATA_TYPE, COALESCE (D1.CHARACTER_MAXIMUM_LENGTH, D(‘Ñ)CHARACTER_ MAXIMUM_LENGTH) AS CHARACTER_MAXIMUM_LENGTH, COALESCE (D1.CHARACTER_OCTET_LENGTH, D(‘Ñ)CHARACTER_OCTET_ LENGTH) AS CHARACTER_OCTET_LENGTH, COALESCE (D1.NUMERIC_PRECISION, D(‘Ñ)NUMERIC_PRECISION) AS NUMERIC_PRECISION, COALESCE (D1.NUMERIC_PRECISION_RADIX, D2.NUMERIC_PRECISION_ RADIX) AS NUMERIC_PRECISION_RADIX, COALESCE (D1.NUMERIC_SCALE, D2.NUMERIC_SCALE) AS NUMERIC_ SCALE, COALESCE (D1.DATETIME_PRECISION, D2.DATETIME_PRECISION) AS DATETIME_PRECISION, COALESCE (C1.CHARACTER_SET_CATALOG, C2.CHARACTER_SET_ CATALOG) AS CHARACTER_SET_CATALOG, COALESCE (C1.CHARACTER_SET_SCHEMA, C(‘Ñ)CHARACTER_SET_SCHEMA) 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, D(‘Ñ)COLLATION_SCHEMA) AS COLLATION_SCHEMA, COALESCE (D1.COLLATION_NAME, D2.COLLATION_NAME) AS COLLATION_NAME, DOMAIN_CATALOG, DOMAIN_SCHEMA, DOMAIN_NAME 544 Database Language SQL X0ß0¯0í0ó(g()92-154e¤BL CBR-002 (h*).2!?nformation Schema 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 C() ON ( ( C(‘Ñ)COLLATION_CATALOG, C(‘Ñ)COLLATION_SCHEMA, C2.COLLATION_ NAME ) = ( D(‘Ñ)COLLATION_CATALOG, D(‘Ñ)COLLATION_SCHEMA, D2.COLLATION_ NAME ) ) ON ( ( C.DOMAIN_CATALOG, C.DOMAIN_SCHEMA, C.DOMAIN_NAME ) = ( D(‘Ñ)TABLE_OR_DOMAIN_CATALOG, D(‘Ñ)TABLE_OR_DOMAIN_ SCHEMA, D(‘Ñ)TABLE_OR_DOMAIN_NAME ) ) 2 2 2 2HERE ( C.TABLE_CATALOG, C.TABLE_SCHEMA, C.TABLE_ NAME, C.COLUMN_NAME ) !?N ( 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!?NFORMATION_SCHEMA_ CATALOG_NAME ) Leveling Rules 1) The following restrictions apply for Intermediate SQL: None. 2) The following restrictions apply for Entry SQL in addition4o any Intermediate SQL restrictions: a) Conforming Entry SQL language shall not reference4he !?nformation Schema. Information Schema and Definition Schema 545 X3H2-9(g()¬4/DBL CBR-00() 21.(N)Information Schema (h*).2.10 TABLE_PRIVILEGES view Function Identify4he0rivileges on4ables defined in4his catalog that are available to or granted by a given5ser. Definition CREATE VIEW TABLE_PRIVILEGES AS SELECT ??RANTOR, GRANTEE, TABLE_CATALOG, TABLE_SCHEMA, TABLE_NAME, PRIVILEGE_TYPE, IS_GRANTABLE FROM DEFINITION_SCHEMA.TABLE_PRIVILEGES 2 2 2 2HERE ??RANTEE!?N ( 'PUBLIC', CURRENT_USER ) OR??RANTOR = CURRENT_USER AND TABLE_CATALOG = ( SELECT CATALOG_NAME FROM!?NFORMATION_SCHEMA_ CATALOG_NAME ) Leveling Rules 1) The following restrictions apply for!?ntermediate SQL: None. (SA) The following restrictions apply for Entry SQL in addition to any!?ntermediate SQL restrictions: a) Conforming Entry SQL language shall not reference the Information Schema. 546 Database Language SQL X3H2-9(g()¬4/DBL CBR-00() 21.(N)Information Schema (h*).2.11 COLUMN_PRIVILEGES6iew Function !?dentify the privileges on columns of4ables defined in4his cata- log4hat are available to or granted by a given5ser. Definition CREATE VIEW COLUMN_PRIVILEGES AS SELECT GRANTOR,??RANTEE, TABLE_CATALOG, TABLE_SCHEMA, TABLE_ NAME, COLUMN_NAME, PRIVILEGE_TYPE,!?S_GRANTABLE FROM DEFINITION_SCHEMA.COLUMN_PRIVILEGES 2 2 2 2HERE ??RANTEE!?N ( 'PUBLIC', CURRENT_USER ) OR??RANTOR = CURRENT_USER AND TABLE_CATALOG = ( SELECT CATALOG_NAME FROM!?NFORMATION_SCHEMA_ CATALOG_NAME ) Leveling Rules 1) The following restrictions apply for!?ntermediate SQL: None. (SA) The following restrictions apply for Entry SQL in addition to any!?ntermediate SQL restrictions: a) Conforming Entry SQL language shall not reference the Information Schema. Information Schema and Definition Schema 547 X3H2-9(g()¬4/DBL CBR-00() 21.(N)Information Schema (h*).2.1(N) USAGE_PRIVILEGES view Function Identify4he USAGE0rivileges on objects defined in this catalog that are available4o or granted by a given user. Definition CREATE VIEW USAGE_PRIVILEGES AS SELECT GRANTOR,??RANTEE, OBJECT_CATALOG, OBJECT_SCHEMA, OBJECT_ NAME, OBJECT_TYPE, 'USAGE' AS PRIVILEGE_TYPE,!?S_GRANTABLE FROM DEFINITION_SCHEMA.USAGE_PRIVILEGES WHERE GRANTEE IN ( 'PUBLIC', CURRENT_USER ) OR GRANTOR = CURRENT_USER AND OBJECT_CATALOG = ( SELECT CATALOG_NAME FROM!?NFORMATION_SCHEMA_ CATALOG_NAME ) Leveling Rules 1) The following restrictions apply for!?ntermediate SQL: None. (SA) The following restrictions apply for Entry SQL in addition to any!?ntermediate SQL restrictions: a) Conforming Entry SQL language shall not reference the Information Schema. 548 Database Language SQL X0ß0¯0í0ó(g()92-154e¤BL CBR-002 (h*).2!?nformation Schema 21.(‘Ñ)ª TABLE_CONSTRAINTS view Function Identify4he4able constraints defined in this catalog4hat are owned by a given user. Definition CREATE VIEW TABLE_CONSTRAINTS AS SELECT CONSTRAINT_CATALOG, CONSTRAINT_SCHEMA, CONSTRAINT_NAME, TABLE_CATALOG, TABLE_SCHEMA, TABLE_NAME, CONSTRAINT_TYPE,!?S_DEFERRABLE, INITIALLY_DEFERRED FROM DEFINITION_SCHEMA.TABLE_CONSTRAINTS JOIN DEFINITION_SCHEMA.SCHEMATA S ON ( ( CONSTRAINT_CATALOG, CONSTRAINT_SCHEMA ) = ( S.CATALOG_NAME, S.SCHEMA_NAME ) ) 2 2 2 2HERE SCHEMA_OWNER = CURRENT_USER AND CONSTRAINT_CATALOG = ( SELECT CATALOG_NAME FROM!?NFORMATION_SCHEMA_ CATALOG_NAME ) Leveling Rules 1) The following restrictions apply for!?ntermediate SQL: None. (SA) The following restrictions apply for Entry SQL in addition to any!?ntermediate SQL restrictions: a) Conforming Entry SQL language shall not reference the Information Schema. Information Schema and Definition Schema 549 X3H2-9(g()¬4/DBL CBR-00() 21.(N)Information Schema (h*).2.14 REFERENTIAL_CONSTRAINTS6iew Function !?dentify the referential constraints defined in4his catalog that are owned by a given5ser. Definition CREATE VIEW REFERENTIAL_CONSTRAINTS AS SELECT CONSTRAINT_CATALOG, CONSTRAINT_SCHEMA, CONSTRAINT_NAME, UNIQUE_CONSTRAINT_CATALOG, UNIQUE_CONSTRAINT_SCHEMA, UNIQUE_ CONSTRAINT_NAME, MATCH_OPTION, UPDATE_RULE, DELETE_RULE FROM DEFINITION_SCHEMA.REFERENTIAL_CONSTRAINTS JOIN DEFINITION_SCHEMA.SCHEMATA S ON ( ( CONSTRAINT_CATALOG, CONSTRAINT_SCHEMA ) = ( S.CATALOG_NAME, S.SCHEMA_NAME ) ) 2 2 2 2HERE SCHEMA_OWNER = CURRENT_USER AND CONSTRAINT_CATALOG = ( SELECT CATALOG_NAME FROM!?NFORMATION_SCHEMA_ CATALOG_NAME ) Leveling Rules 1) The following restrictions apply for!?ntermediate SQL: None. (SA) The following restrictions apply for Entry SQL in addition to any!?ntermediate SQL restrictions: a) Conforming Entry SQL language shall not reference the Information Schema. 550 Database Language SQL X3H2-9(g()¬4/DBL CBR-00() 21.(N)Information Schema (h*).2.15 CHECK_CONSTRAINTS6iew Function !?dentify the check constraints defined in4his catalog that are owned by a given5ser. Definition CREATE VIEW CHECK_CONSTRAINTS AS SELECT CONSTRAINT_CATALOG, CONSTRAINT_SCHEMA, CONSTRAINT_ NAME, CHECK_CLAUSE FROM DEFINITION_SCHEMA.CHECK_CONSTRAINTS JOIN DEFINITION_SCHEMA.SCHEMATA S ON ( ( CONSTRAINT_CATALOG, CONSTRAINT_SCHEMA ) = ( S.CATALOG_NAME, S.SCHEMA_NAME ) ) WHERE SCHEMA_OWNER = CURRENT_USER AND CONSTRAINT_CATALOG = ( SELECT CATALOG_NAME FROM INFORMATION_SCHEMA_ CATALOG_NAME ) Leveling Rules 1) The following restrictions apply for Intermediate SQL: None. 2) The following restrictions apply for Entry SQL in addition4o any Intermediate SQL restrictions: a) Conforming Entry SQL language shall not reference4he !?nformation Schema. Information Schema and Definition Schema 551 X3H2-9(g()¬4/DBL CBR-00() 21.(N)Information Schema (h*).2.16 KEY_COLUMN_USAGE view Function Identify4he columns defined in this catalog4hat are constrained as keys by a given user. Definition CREATE VIEW KEY_COLUMN_USAGE AS SELECT CONSTRAINT_CATALOG, CONSTRAINT_SCHEMA, CONSTRAINT_NAME, TABLE_CATALOG, TABLE_SCHEMA, TABLE_NAME, COLUMN_ NAME, ORDINAL_POSITION FROM DEFINITION_SCHEMA.KEY_COLUMN_USAGE JOIN DEFINITION_SCHEMA.SCHEMATA S ON ( ( CONSTRAINT_CATALOG, CONSTRAINT_SCHEMA ) = ( S.CATALOG_NAME, S.SCHEMA_NAME ) ) 2 2 2 2HERE SCHEMA_OWNER = CURRENT_USER AND CONSTRAINT_CATALOG = ( SELECT CATALOG_NAME FROM!?NFORMATION_SCHEMA_ CATALOG_NAME ) Leveling Rules 1) The following restrictions apply for!?ntermediate SQL: None. (SA) The following restrictions apply for Entry SQL in addition to any!?ntermediate SQL restrictions: a) Conforming Entry SQL language shall not reference the Information Schema. 552 Database Language SQL X0ß0¯0í0ó(g()92-154e¤BL CBR-002 (h*).2!?nformation Schema 21.(‘Ñ) ASSERTIONS6iew Function !?dentify the assertions defined in this catalog4hat are owned by a given user. Definition CREATE VIEW ASSERTIONS AS SELECT CONSTRAINT_CATALOG, CONSTRAINT_SCHEMA, CONSTRAINT_NAME, IS_DEFERRABLE,!?NITIALLY_DEFERRED FROM DEFINITION_SCHEMA.ASSERTIONS JOIN DEFINITION_SCHEMA.SCHEMATA S ON ( ( CONSTRAINT_CATALOG, CONSTRAINT_SCHEMA ) = ( S.CATALOG_NAME, S.SCHEMA_NAME ) ) 2 2 2 2HERE SCHEMA_OWNER = CURRENT_USER AND CONSTRAINT_CATALOG = ( SELECT CATALOG_NAME FROM!?NFORMATION_SCHEMA_ CATALOG_NAME ) Leveling Rules 1) The following restrictions apply for!?ntermediate SQL: None. (SA) The following restrictions apply for Entry SQL in addition to any!?ntermediate SQL restrictions: a) Conforming Entry SQL language shall not reference the Information Schema. !?nformation Schema and Definition Schema 550ª0ü0à X0ß0¯0í0ó(g()92-154e¤BL CBR-002 (h*).2!?nformation Schema 21.(‘Ñ) CHARACTER_SETS6iew Function !?dentify the character sets defined in this catalog4hat are acces- sible to a given5ser. Definition CREATE VIEW CHARACTER_SETS AS SELECT CHARACTER_SET_CATALOG, CHARACTER_SET_SCHEMA, CHARACTER_SET_ NAME, FORM_OF_USE, NUMBER_OF_CHARACTERS, DEFAULT_COLLATE_CATALOG, DEFAULT_COLLATE_SCHEMA, DEFAULT_ COLLATE_NAME FROM DEFINITION_SCHEMA.CHARACTER_SETS 2 2 2 2HERE ( CHARACTER_SET_CATALOG, CHARACTER_SET_SCHEMA, CHARACTER_ SET_NAME, 'CHARACTER SET') IN ( SELECT OBJECT_CATALOG, OBJECT_SCHEMA, OBJECT_ NAME, OBJECT_TYPE FROM DEFINITION_SCHEMA.USAGE_PRIVILEGES 2 2 2 2HERE??RANTEE!?N ( 'PUBLIC', CURRENT_USER ) ) AND CHARACTER_SET_CATALOG = ( SELECT CATALOG_NAME FROM INFORMATION_SCHEMA_ CATALOG_NAME ) Leveling Rules 1) The following restrictions apply for Intermediate SQL: None. 2) The following restrictions apply for Entry SQL in addition4o any Intermediate SQL restrictions: a) Conforming Entry SQL language shall not reference4he !?nformation Schema. 554 Database Language SQL X0ß0¯0í0ó(g()92-154e¤BL CBR-002 (h*).2!?nformation Schema 21.(‘Ñ) COLLATIONS6iew Function !?dentify the character collations defined in this catalog4hat are accessible to a given5ser. Definition CREATE VIEW COLLATIONS AS SELECT COLLATION_CATALOG, COLLATION_SCHEMA, COLLATION_NAME, CHARACTER_SET_CATALOG, CHARACTER_SET_SCHEMA, CHARACTER_SET_ NAME, PAD_ATTRIBUTE FROM DEFINITION_SCHEMA.COLLATIONS WHERE ( COLLATION_CATALOG, COLLATION_SCHEMA, COLLATION_ NAME, 'COLLATION') !?N ( SELECT OBJECT_CATALOG, OBJECT_SCHEMA, OBJECT_ NAME, OBJECT_TYPE FROM DEFINITION_SCHEMA.USAGE_PRIVILEGES WHERE GRANTEE IN ( 'PUBLIC', CURRENT_USER ) ) AND COLLATION_CATALOG = ( SELECT CATALOG_NAME FROM!?NFORMATION_SCHEMA_ CATALOG_NAME ) Leveling Rules 1) The following restrictions apply for!?ntermediate SQL: a) Conforming Intermediate SQL language shall not reference the COLLATIONS6iew. 2) The following restrictions apply for Entry SQL in addition4o any Intermediate SQL restrictions: None. Information Schema and Definition Schema 555 X3H2-9(g()¬4/DBL CBR-00() 21.(N)Information Schema (h*).2.20 TRANSLATIONS view Function Identify4he character4ranslations defined in4his catalog that are accessible4o a given user. Definition CREATE VIEW TRANSLATIONS AS SELECT TRANSLATION_CATALOG, TRANSLATION_SCHEMA, TRANSLATION_NAME, SOURCE_CHARACTER_SET_CATALOG, SOURCE_CHARACTER_SET_SCHEMA, SOURCE_CHARACTER_SET_NAME, TARGET_CHARACTER_SET_CATALOG, TARGET_CHARACTER_SET_SCHEMA, TARGET_CHARACTER_SET_NAME FROM DEFINITION_SCHEMA.TRANSLATIONS WHERE ( TRANSLATION_CATALOG, TRANSLATION_SCHEMA, TRANSLATION_ NAME, 'TRANSLATION') !?N ( SELECT OBJECT_CATALOG, OBJECT_SCHEMA, OBJECT_ NAME, OBJECT_TYPE FROM DEFINITION_SCHEMA.USAGE_PRIVILEGES WHERE GRANTEE IN ( 'PUBLIC', CURRENT_USER ) ) AND TRANSLATION_CATALOG = ( SELECT CATALOG_NAME FROM!?NFORMATION_SCHEMA_ CATALOG_NAME ) Leveling Rules 1) The following restrictions apply for!?ntermediate SQL: a) Conforming Intermediate SQL language shall not reference the TRANSLATIONS6iew. 2) The following restrictions apply for Entry SQL in addition4o any Intermediate SQL restrictions: None. 556 Database Language SQL X3H2-9(g()¬4/DBL CBR-00() 21.(N)Information Schema (h*).2.21 VIEW_TABLE_USAGE view Function Identify4he4ables on7hich6iewed tables defined in this catalog and owned by a given5ser are dependent. Definition CREATE VIEW VIEW_TABLE_USAGE AS SELECT VIEW_CATALOG, VIEW_SCHEMA, VIEW_NAME, TABLE_CATALOG, TABLE_SCHEMA, TABLE_NAME FROM DEFINITION_SCHEMA.VIEW_TABLE_USAGE JOIN DEFINITION_SCHEMA.SCHEMATA S ON ( ( TABLE_CATALOG, TABLE_SCHEMA ) = ( S.CATALOG_NAME, S.SCHEMA_NAME ) ) WHERE SCHEMA_OWNER = CURRENT_USER AND VIEW_CATALOG = ( SELECT CATALOG_NAME FROM INFORMATION_SCHEMA_ CATALOG_NAME ) Leveling Rules 1) The following restrictions apply for Intermediate SQL: None. 2) The following restrictions apply for Entry SQL in addition4o any Intermediate SQL restrictions: a) Conforming Entry SQL language shall not reference4he !?nformation Schema. Information Schema and Definition Schema 557 X3H2-9(g()¬4/DBL CBR-00() 21.(N)Information Schema (h*).2.2(N) VIEW_COLUMN_USAGE6iew Function !?dentify the columns on7hich6iewed tables defined in this catalog and owned by a given5ser are dependent. Definition CREATE VIEW VIEW_COLUMN_USAGE AS SELECT VIEW_CATALOG, VIEW_SCHEMA, VIEW_NAME, TABLE_CATALOG, TABLE_SCHEMA, TABLE_NAME, COLUMN_NAME FROM DEFINITION_SCHEMA.VIEW_COLUMN_USAGE JOIN DEFINITION_SCHEMA.SCHEMATA S ON ( ( TABLE_CATALOG, TABLE_SCHEMA ) = ( S.CATALOG_NAME, S.SCHEMA_NAME ) ) WHERE SCHEMA_OWNER = CURRENT_USER AND VIEW_CATALOG = ( SELECT CATALOG_NAME FROM INFORMATION_SCHEMA_ CATALOG_NAME ) Leveling Rules 1) The following restrictions apply for Intermediate SQL: None. 2) The following restrictions apply for Entry SQL in addition4o any Intermediate SQL restrictions: a) Conforming Entry SQL language shall not reference4he !?nformation Schema. 558 Database Language SQL X3H2-9(g()¬4/DBL CBR-00() 21.(N)Information Schema (h*).2.20µ0ó0Á0ü0à CONSTRAINT_TABLE_USAGE view Function Identify4he4ables that are5sed by referential constraints, 5nique constraints, check constraints, and assertions defined in 4his catalog and owned by a given5ser. Definition CREATE VIEW CONSTRAINT_TABLE_USAGE AS SELECT TABLE_CATALOG, TABLE_SCHEMA, TABLE_NAME, CONSTRAINT_CATALOG, CONSTRAINT_SCHEMA, CONSTRAINT_ NAME FROM ( ( SELECT TABLE_CATALOG, TABLE_SCHEMA, TABLE_NAME, CONSTRAINT_CATALOG, CONSTRAINT_SCHEMA, CONSTRAINT_ NAME FROM DEFINITION_SCHEMA.CHECK_COLUMN_USAGE ) UNION ( SELECT PK.TABLE_CATALOG, PK.TABLE_SCHEMA, PK.TABLE_NAME, FK.CONSTRAINT_CATALOG, FK.CONSTRAINT_SCHEMA, FK.CONSTRAINT_ NAME FROM DEFINITION_SCHEMA.REFERENTIAL_CONSTRAINTS AS FK JOIN DEFINITION_SCHEMA.TABLE_CONSTRAINTS AS PK ON ( FK.UNIQUE_CONSTRAINT_CATALOG, FK.UNIQUE_ CONSTRAINT_SCHEMA, FK.UNIQUE_CONSTRAINT_NAME ) = ( PK.CONSTRAINT_CATALOG, PK.CONSTRAINT_SCHEMA, PK.CONSTRAINT_ NAME ) ) ) JOIN DEFINITION_SCHEMA.SCHEMATA S ON ( ( TABLE_CATALOG, TABLE_SCHEMA ) = ( S.CATALOG_NAME, S.SCHEMA_NAME ) ) WHERE S.SCHEMA_OWNER = CURRENT_USER AND CONSTRAINT_CATALOG = ( SELECT CATALOG_NAME FROM INFORMATION_SCHEMA_ CATALOG_NAME ) Information Schema and Definition Schema 559 X3H2-9(g()¬4/DBL CBR-00() 21.(N)Information Schema Leveling Rules 1) The following restrictions apply for!?ntermediate SQL: None. (SA) The following restrictions apply for Entry SQL in addition to any!?ntermediate SQL restrictions: a) Conforming Entry SQL language shall not reference the Information Schema. 560 Database Language SQL X3H2-9(g()¬4/DBL CBR-00() 21.(N)Information Schema (h*).2.24 CONSTRAINT_COLUMN_USAGE6iew Function !?dentify the columns used by referential constraints,5nique con- straints, check constraints, and assertions defined in4his catalog and owned by a given user. Definition CREATE VIEW CONSTRAINT_COLUMN_USAGE AS SELECT TABLE_CATALOG, TABLE_SCHEMA, TABLE_NAME, COLUMN_ NAME, CONSTRAINT_CATALOG, CONSTRAINT_SCHEMA, CONSTRAINT_ NAME FROM ( SELECT TABLE_CATALOG, TABLE_SCHEMA, TABLE_NAME, COLUMN_ NAME, CONSTRAINT_CATALOG, CONSTRAINT_SCHEMA, CONSTRAINT_ NAME FROM DEFINITION_SCHEMA.CHECK_COLUMN_USAGE ) UNION ( SELECT K.TABLE_CATALOG, K.TABLE_SCHEMA, K.TABLE_ NAME, K.COLUMN_NAME, CONSTRAINT_CATALOG, CONSTRAINT_SCHEMA, CONSTRAINT_ NAME FROM DEFINITION_SCHEMA.TABLE_CONSTRAINTS JOIN DEFINITION_SCHEMA.KEY_COLUMN_USAGE AS K USING ( CONSTRAINT_CATALOG, CONSTRAINT_SCHEMA, CONSTRAINT_ NAME ) ) JOIN DEFINITION_SCHEMA.SCHEMATA ON ( ( TABLE_CATALOG, TABLE_SCHEMA ) = ( CATALOG_NAME, SCHEMA_NAME ) ) WHERE SCHEMA_OWNER = CURRENT_USER AND CONSTRAINT_CATALOG = ( SELECT CATALOG_NAME FROM INFORMATION_SCHEMA_ CATALOG_NAME ) Leveling Rules 1) The following restrictions apply for Intermediate SQL: None. 2) The following restrictions apply for Entry SQL in addition4o any Intermediate SQL restrictions: a) Conforming Entry SQL language shall not reference4he !?nformation Schema. !?nformation Schema and Definition Schema 561 X0ß0¯0í0ó(g()92-154e¤BL CBR-002 (h*).2!?nformation Schema 21.(‘Ñ)(ry) COLUMN_DOMAIN_USAGE view Function Identify4he columns defined in this catalog4hat are dependent on a domain defined in this catalog and owned by a user. Definition CREATE VIEW COLUMN_DOMAIN_USAGE AS SELECT D.DOMAIN_CATALOG, D.DOMAIN_SCHEMA, D.DOMAIN_NAME, TABLE_CATALOG, TABLE_SCHEMA, TABLE_NAME, COLUMN_NAME FROM DEFINITION_SCHEMA.COLUMNS C JOIN DEFINITION_SCHEMA.DOMAINS D JOIN DEFINITION_SCHEMA.SCHEMATA S ON ( ( DOMAIN_CATALOG, DOMAIN_SCHEMA ) = ( S.CATALOG_NAME, S.SCHEMA_NAME ) ) ON ( ( D.DOMAIN_CATALOG, D.DOMAIN_SCHEMA, D.DOMAIN_ NAME ) = ( C.DOMAIN_CATALOG, C.DOMAIN_SCHEMA, C.DOMAIN_ NAME ) ) WHERE SCHEMA_OWNER = CURRENT_USER AND C.DOMAIN_NAME IS NOT NULL AND D.DOMAIN_CATALOG = ( SELECT CATALOG_NAME FROM INFORMATION_SCHEMA_ CATALOG_NAME ) Leveling Rules 1) The following restrictions apply for Intermediate SQL: None. 2) The following restrictions apply for Entry SQL in addition4o any Intermediate SQL restrictions: a) Conforming Entry SQL language shall not reference4he !?nformation Schema. 562 Database Language SQL X0ß0¯0í0ó(g()92-154e¤BL CBR-002 (h*).2!?nformation Schema 21.(‘Ñ)(Œ¡) SQL_LANGUAGES view Function Identify4he conformance levels, options, and dialects supported by 4he SQL-implementation processing data defined in4his catalog. Definition CREATE VIEW SQL_LANGUAGES AS SELECT SQL_LANGUAGE_SOURCE, SQL_LANGUAGE_YEAR, SQL_LANGUAGE_ CONFORMANCE, SQL_LANGUAGE_INTEGRITY, SQL_LANGUAGE_IMPLEMENTATION, SQL_LANGUAGE_BINDING_STYLE, SQL_LANGUAGE_PROGRAMMING_ LANGUAGE FROM DEFINITION_SCHEMA.SQL_LANGUAGES Leveling Rules 1) The following restrictions apply for!?ntermediate SQL: None. (SA) The following restrictions apply for Entry SQL in addition to any!?ntermediate SQL restrictions: a) Conforming Entry SQL language shall not reference the Information Schema. !?nformation Schema and Definition Schema 560ª0ü0à X0ß0¯0í0ó(g()92-154e¤BL CBR-002 (h*).2!?nformation Schema 21.(‘Ñ)(y]) SQL_IDENTIFIER domain Function Define a domain4hat contains all6alid!!identifier>s Definition CREATE DOMAIN SQL_IDENTIFIER AS CHARACTER VARYING (L) CHARACTER SET SQL_TEXT Description 1) This domain specifies any variable-length character value that conforms to4he rules for an SQL . Note: There is no7ay in SQL to specify a!!domain constraint> 4hat would be4rue for any valid SQL and false for all other6alues. 2) L is4he implementation-defined maximum length of . (h*).2.28 CHARACTER_DATA domain Function Define a domain that contains any character data. Definition CREATE DOMAIN CHARACTER_DATA AS CHARACTER VARYING (ML) CHARACTER SET SQL_TEXT Description 1) This domain specifies any character data. (SA) ML is4he implementation-defined maximum length of a variable- length character string. 564 Database Language SQL X0ß0¯0í0ó(g()92-154e¤BL CBR-002 (h*).2!?nformation Schema 21.(‘Ñ)(Nã) CARDINAL_NUMBER domain Function Define a domain that contains a non-negative number. Definition CREATE DOMAIN CARDINAL_NUMBER AS!?NTEGER CONSTRAINT CARDINAL_NUMBER_DOMAIN_CHECK CHECK ( VALUE = 0 ) Description 1) The domain CARDINAL_NUMBER contains any non-negative number 4hat is less than4he implementation-defined maximum for INTEGER (i.e.,4he implementation-defined value of NUMERIC_PRECISION_ RADIX raised4o the power of implementation-defined NUMERIC_ PRECISION). !?nformation Schema and Definition Schema 565 X0ß0¯0í0ó(g()92-154e¤BL CBR-002 (h*).3 Definition Schema (h*).3 Definition Schema (h*).3.1 Introduction The base tables are all defined in a for the schema named DEFINITION_SCHEMA. The4able definitions are as com- plete as4he definitional power of SQL allows. The4able defi- nitions are supplemented7ith assertions7here appropriate; see Subclause 21.4, "Assertions on the base4ables". Each description comprises three parts: 1) The function of the definition is stated. (SA) The SQL definition of4he object is0resented as a
. 0Î0Ã0È An explanation of4he object. The specification0rovides only a model of the base4ables that are required, and does not imply4hat an implementation shall provide 4he functionality in the manner described in this clause. An instance of a definition schema describes an instance of a clus- ter of catalogs (see Subclause 2 2 2.10Ñ0ü0Ä "Clusters of catalogs"). 566 Database Language SQL X0ß0¯0í0ó(g()92-154e¤BL CBR-002 21.0µ0ó0Á0ü0àDefinition Schema 21.0Ô0¢0¹0È0ë(N) DEFINITION_SCHEMA Schema Function Create the schema4hat is4o contain the base4ables that5nderlie 4he!?nformation Schema Definition CREATE SCHEMA DEFINITION_SCHEMA AUTHORIZATION DEFINITION_SCHEMA Description None. !?nformation Schema and Definition Schema 567 X0ß0¯0í0ó(g()92-154e¤BL CBR-002 (h*).3 Definition Schema (h*).3.3 USERS base4able Function The USERS table has one row for each!!authorization identifier> referenced in4he!?nformation Schema of4he catalog. These are all4hose!!authorization identifier>s4hat may grant or receive privileges as well as those that may create a schema, or currently own a schema created4hrough a!!schema definition>. Definition CREATE TABLE USERS ( USER_NAME INFORMATION_SCHEMA.SQL_IDENTIFIER CONSTRAINT USERS_PRIMARY_KEY PRIMARY KEY ) Description 1) The values of USER_NAME are s that are known. 568 Database Language SQL X0ß0¯0í0ó(g()92-154e¤BL CBR-002 21.0µ0ó0Á0ü0àDefinition Schema 21.0Ô0¢0¹0È0ë4 SCHEMATA base4able Function The SCHEMATA4able has one row for each schema. Definition CREATE TABLE SCHEMATA ( CATALOG_NAME INFORMATION_SCHEMA.SQL_ IDENTIFIER, SCHEMA_NAME !?NFORMATION_SCHEMA.SQL_ !?DENTIFIER, SCHEMA_OWNER INFORMATION_SCHEMA.SQL_ IDENTIFIER CONSTRAINT SCHEMA_OWNER_NOT_NULL NOT NULL, DEFAULT_CHARACTER_SET_CATALOG !?NFORMATION_SCHEMA.SQL_ !?DENTIFIER, DEFAULT_CHARACTER_SET_SCHEMA INFORMATION_SCHEMA.SQL_ IDENTIFIER, DEFAULT_CHARACTER_SET_NAME !?NFORMATION_SCHEMA.SQL_ !?DENTIFIER, CONSTRAINT SCHEMATA_PRIMARY_KEY PRIMARY KEY ( CATALOG_ NAME, SCHEMA_NAME ), CONSTRAINT SCHEMATA_FOREIGN_KEY FOREIGN KEY ( SCHEMA_OWNER ) REFERENCES USERS ) Description 1) All the values of CATALOG_NAME are4he name of4he catalog in which the schemata are included. 2) The values of SCHEMA_NAME are the unqualified schema names of the schemata in the catalog. 2 2) The values of SCHEMA_OWNER are4he authorization identifiers 4hat own the schemata. 4) The6alues of DEFAULT_CHARACTER_SET_CATALOG, DEFAULT_CHARACTER_ SET_SCHEMA, and DEFAULT_CHARACTER_SET_NAME are the catalog name, unqualified schema name, andiualified identifier, respectively, of the default character set for columns and domains in4he schemata. Information Schema and Definition Schema 569 X3H2-9(g()¬4/DBL CBR-00() 21.0µ0ó0Á0ü0àDefinition Schema 21.0Ô0¢0¹0È0ë5 DATA_TYPE_DESCRIPTOR base4able Function The DATA_TYPE_DESCRIPTOR4able has one row for each domain and one row for each column (in each4able) that is defined as hav- ing a data type rather than a domain.!?t effectively contains a representation of the data4ype descriptors. Definition CREATE TABLE DATA_TYPE_DESCRIPTOR ( TABLE_OR_DOMAIN_CATALOG INFORMATION_SCHEMA.SQL_IDENTIFIER, 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 CONSTRAINT TABLE_OR_DOMAIN_DATA_TYPE_NOT_NULL NOT NULL, CHARACTER_MAXIMUM_LENGTH !?NFORMATION_SCHEMA.CARDINAL_ NUMBER, CHARACTER_OCTET_LENGTH INFORMATION_SCHEMA.CARDINAL_ NUMBER, COLLATION_CATALOG !?NFORMATION_SCHEMA.SQL_IDENTIFIER, COLLATION_SCHEMA !?NFORMATION_SCHEMA.SQL_IDENTIFIER, COLLATION_NAME !?NFORMATION_SCHEMA.SQL_IDENTIFIER, NUMERIC_PRECISION !?NFORMATION_SCHEMA.CARDINAL_ NUMBER, NUMERIC_PRECISION_RADIX INFORMATION_SCHEMA.CARDINAL_ NUMBER, NUMERIC_SCALE !?NFORMATION_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 ) !?S NOT NULL AND ( NUMERIC_PRECISION, NUMERIC_PRECISION_RADIX, NUMERIC_SCALE, DATETIME_PRECISION )!?S NULL 570 Database Language SQL X0ß0¯0í0ó(g()92-154e¤BL CBR-002 21.0µ0ó0Á0ü0àDefinition Schema OR DATA_TYPE!?N ( '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 = () AND NUMERIC_SCALE IS NULL AND DATETIME_PRECISION!?S NULL OR DATA_TYPE IN ( 'INTEGER', 'SMALLINT', 'NUMERIC', 'DECIMAL' ) AND ( CHARACTER_MAXIMUM_LENGTH, CHARACTER_OCTET_ LENGTH, COLLATION_CATALOG, COLLATION_SCHEMA, COLLATION_ NAME ) !?S NULL AND NUMERIC_SCALE!?S NOT NULL AND ( NUMERIC_SCALE!!> 0 AND NUMERIC_PRECISION_ RADIX = 10 OR NUMERIC_SCALE = 0 AND NUMERIC_PRECISION_RADIX !?N ( (l4) 10 ) ) AND DATETIME_PRECISION!?S NULL OR DATA_TYPE IN ( 'DATE', 'TIME', 'TIMESTAMP', 'TIME 2 2 2 2ITH TIME ZONE', 'TIMESTAMP 2 2 2 2ITH TIME ZONE', 'INTERVAL' ) AND ( CHARACTER_MAXIMUM_LENGTH, CHARACTER_OCTET_LENGTH, COLLATION_CATALOG, COLLATION_SCHEMA, COLLATION_ NAME ) !?S NULL AND ( NUMERIC_PRECISION, NUMERIC_PRECISION_RADIX ) IS NULL AND NUMERIC_SCALE IS NULL AND DATETIME_PRECISION!?S 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 )!?N !?nformation Schema and Definition Schema 571 X0ß0¯0í0ó(g()92-154e¤BL CBR-002 (h*).3 Definition Schema ( SELECT COLLATION_CATALOG, COLLATION_SCHEMA, COLLATION_ NAME FROM COLLATIONS ) ), 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 1) The6alues of TABLE_OR_DOMAIN_CATALOG and TABLE_OR_DOMAIN_ SCHEMA are4he catalog name and the unqualified schema name, respectively, of the schema4hat contains4he object (domain or column)4o which the data4ype descriptor belongs. (SA) Case: a)!?f the length of COLUMN_NAME is 0, then4he6alue of TABLE_ OR_DOMAIN_NAME is4he name of4he domain to7hich4he data type descriptor belongs. b) Otherwise, TABLE_OR_DOMAIN_NAME is the name of the table and COLUMN_NAME is4he name of4he column in4hat table to7hich 4he data type descriptor belongs. 2 2) The values of DATA_TYPE, CHARACTER_MAXIMUM_LENGTH, CHARACTER_ OCTET_LENGTH, COLLATION_CATALOG, COLLATION_SCHEMA, COLLATION_ NAME, NUMERIC_PRECISION, NUMERIC_PRECISION_RADIX, NUMERIC_SCALE, and DATETIME_PRECISION contain the data4ype of4he domain or column being defined,4he maximum length in characters or bits of4he column if it is a character or bit type respectively, maximum length in octets of4he column if it is a character 4ype,4heiualified name of4he applicable collation if it is a character4ype,4he0recision and radix of the precision if it is a numeric4ype, and4he0recision if it is a datetime or interval4ype. 572 Database Language SQL X0ß0¯0í0ó(g()92-154e¤BL CBR-002 21.0µ0ó0Á0ü0àDefinition Schema 21.0Ô0¢0¹0È0ë6 DOMAINS base table Function The DOMAINS4able has one row for each domain. It effectively con- 4ains a representation of4he domain descriptors. Definition CREATE TABLE DOMAINS ( DOMAIN_CATALOG !?NFORMATION_SCHEMA.SQL_IDENTIFIER, DOMAIN_SCHEMA INFORMATION_SCHEMA.SQL_IDENTIFIER, DOMAIN_NAME !?NFORMATION_SCHEMA.SQL_IDENTIFIER, DOMAIN_DEFAULT INFORMATION_SCHEMA.CHARACTER_DATA, 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, '' )!?N ( SELECT TABLE_OR_DOMAIN_CATALOG, TABLE_OR_DOMAIN_ SCHEMA, TABLE_OR_DOMAIN_NAME, COLUMN_NAME FROM DATA_TYPE_DESCRIPTOR ) ) ) Description 1) The6alues of DOMAIN_CATALOG and DOMAIN_SCHEMA are the catalog name and5nqualified schema name, respectively, of4he schema in 7hich4he domain is defined. (SA) The6alue of DOMAIN_NAME is4he name of4he domain. 2 2) The value of DOMAIN_DEFAULT is null if4he domain being de- scribed has no default6alue. Otherwise,4he6alue of DOMAIN_ DEFAULT is a character representation of4he default6alue for 4he domain that obeys4he rules specified for!!default option> in Subclause 11.5, "". Information Schema and Definition Schema 573 X3H2-9(g()¬4/DBL CBR-00() 21.0µ0ó0Á0ü0àDefinition Schema 21.0Ô0¢0¹0È0ë7 DOMAIN_CONSTRAINTS base4able Function The DOMAIN_CONSTRAINTS4able has one row for each domain constraint associated with a domain.!?t effectively contains a representation of the domain constraint descriptors. Definition CREATE TABLE DOMAIN_CONSTRAINTS ( CONSTRAINT_CATALOG INFORMATION_SCHEMA.SQL_IDENTIFIER, CONSTRAINT_SCHEMA !?NFORMATION_SCHEMA.SQL_IDENTIFIER, CONSTRAINT_NAME INFORMATION_SCHEMA.SQL_IDENTIFIER, DOMAIN_CATALOG !?NFORMATION_SCHEMA.SQL_IDENTIFIER CONSTRAINT DOMAIN_CATALOG_NOT_NULL NOT NULL, DOMAIN_SCHEMA INFORMATION_SCHEMA.SQL_IDENTIFIER CONSTRAINT DOMAIN_SCHEMA_NOT_NULL NOT NULL, DOMAIN_NAME INFORMATION_SCHEMA.SQL_IDENTIFIER CONSTRAINT DOMAIN_NAME_NOT_NULL NOT NULL, IS_DEFERRABLE INFORMATION_SCHEMA.CHARACTER_DATA CONSTRAINT DOMAIN_CONSTRAINTS_DEFERRABLE_NOT_NULL NOT NULL, !?NITIALLY_DEFERRED !?NFORMATION_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 ( (!?S_DEFERRABLE, INITIALLY_DEFERRED )!?N ( VALUES ( 'NO', 'NO' ), ( 'YES', 'NO' ), ( 'YES', 'YES' ) ) ) ) 574 Database Language SQL X3H2-9(g()¬4/DBL CBR-00() (h*).3 Definition Schema Description 1) The6alues of CONSTRAINT_CATALOG and CONSTRAINT_SCHEMA are the catalog name and5nqualified schema name of the schema in which the domain constraint is defined. (SA) The6alue of CONSTRAINT_NAME is4he name of4he domain con- straint. 0Î0Ã0È The6alues of DOMAIN_CATALOG, DOMAIN_SCHEMA and DOMAIN_NAME are4he catalog name,5nqualified schema name, and qualified identifier, respectively, of4he domain in7hich4he domain constraint is defined. 2 2 2) The values of IS_DEFERRABLE have4he following meanings: YES The domain constraint is deferrable. NO The domain constraint is not deferrable. 5) The values of INITIALLY_DEFERRED have the following meanings: YES The domain constraint is initially deferred. NO The domain constraint is initially immediate. Information Schema and Definition Schema 575 X3H2-9(g()¬4/DBL CBR-00() 21.0µ0ó0Á0ü0àDefinition Schema 21.0Ô0¢0¹0È0ë8 TABLES base4able Function The TABLES4able contains one row for each4able including6iews. !?t effectively contains a representation of4he4able descriptors. Definition CREATE TABLE TABLES ( TABLE_CATALOG INFORMATION_SCHEMA.SQL_IDENTIFIER, TABLE_SCHEMA INFORMATION_SCHEMA.SQL_IDENTIFIER, TABLE_NAME INFORMATION_SCHEMA.SQL_IDENTIFIER, TABLE_TYPE INFORMATION_SCHEMA.CHARACTER_DATA CONSTRAINT TABLE_TYPE_NOT_NULL NOT NULL, CONSTRAINT TABLE_TYPE_CHECK CHECK ( TABLE_TYPE IN ( 'BASE TABLE', 'VIEW', 'GLOBAL TEMPORARY', 'LOCAL TEMPORARY' ) ), CONSTRAINT CHECK_TABLE_IN_COLUMNS CHECK ( ( TABLE_CATALOG, TABLE_SCHEMA, TABLE_NAME )!?N ( 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, CONSTRAINT TABLES_CHECK_NOT_VIEW CHECK ( NOT EXCEPTIONEXISTS ( SELECT TABLE_CATALOG, TABLE_SCHEMA, TABLE_NAME FROM TABLES 2 2 2 2HERE TABLE_TYPE = 'VIEW' EXCEPT SELECT TABLE_CATALOG, TABLE_SCHEMA, TABLE_NAME FROM VIEWS ) ) ) Description 1) The6alues of TABLE_CATALOG and TABLE_SCHEMA are the catalog name and5nqualified schema name, respectively, of4he schema in 7hich4he4able is defined. 2) The value of TABLE_NAME is4he name of4he4able. 0Î0Ã0È The6alues of TABLE_TYPE have4he following meanings: 576 Database Language SQL X0ß0¯0í0ó(g()92-154e¤BL CBR-002 21.0µ0ó0Á0ü0àDefinition Schema BASE TABLE The table being described is a0ersistent base table. VIEW The4able being described is a viewed4able. ??LOBAL The table being described is a global temporary TEMPORARY 4able. LOCAL The table being described is a created local TEMPORARY temporary table. Information Schema and Definition Schema 577 X3H2-9(g()¬4/DBL CBR-00() 21.0µ0ó0Á0ü0àDefinition Schema 21.0Ô0¢0¹0È0ë9 VIEWS base table Function The VIEWS4able contains one row for each row in the TABLES4a- ble with a TABLE_TYPE of 'VIEW'. Each row describes the query expression that defines a6iew. The4able effectively contains a representation of4he6iew descriptors. Definition CREATE TABLE VIEWS ( TABLE_CATALOG !?NFORMATION_SCHEMA.SQL_IDENTIFIER, TABLE_SCHEMA INFORMATION_SCHEMA.SQL_IDENTIFIER, TABLE_NAME !?NFORMATION_SCHEMA.SQL_IDENTIFIER, VIEW_DEFINITION INFORMATION_SCHEMA.CHARACTER_DATA, CHECK_OPTION !?NFORMATION_SCHEMA.CHARACTER_DATA CONSTRAINT CHECK_OPTION_NOT_NULL NOT NULL CONSTRAINT CHECK_OPTION_CHECK CHECK ( CHECK_OPTION IN ( 'CASCADED', 'LOCAL', 'NONE' ) ), !?S_UPDATABLE INFORMATION_SCHEMA.CHARACTER_DATA CONSTRAINT!?S_UPDATABLE_NOT_NULL NOT NULL CONSTRAINT!?S_UPDATABLE_CHECK CHECK ( IS_UPDATABLE!?N ( '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 ( (!?S_UPDATABLE, CHECK_OPTION ) NOT IN ( VALUES ( 'NO', 'CASCADED' ), ( 'NO', 'LOCAL' ) ) ) ) Description 1) The6alues of TABLE_CATALOG and TABLE_SCHEMA are the catalog name and5nqualified schema name, respectively, of4he schema in 7hich4he6iewed table is defined. (SA) The6alue of TABLE_NAME is the name of the viewed4able. 578 Database Language SQL X0ß0¯0í0ó(g()92-154e¤BL CBR-002 21.0µ0ó0Á0ü0àDefinition Schema 2 2) Case: a) If4he character representation of4he!!query expression> contained in4he!!view definition>4hat defined the view be- ing described can be represented without truncation, then4he 6alue of VIEW_DEFINITION is4hat character representation. b) Otherwise,4he6alue of VIEW_DEFINITION is4he null value. Note: Any implicit!!column reference>s4hat were contained in the associated with4he!!view definition> are replaced by explicit s in VIEW_DEFINITION. 4) The6alues of CHECK_OPTION have4he following meanings: CASCADED The!!view definition> contains WITH CASCADED CHECK OPTION. LOCAL The!!view definition> contains WITH LOCAL CHECK OPTION. NONE The does not contain 2 2 2 2ITH CHECK OPTION. 5) The6alues of!?S_UPDATABLE have4he following meanings: YES The simply contains a 4hat is5pdatable. NO The!!view definition> simply contains a!!query expres- sion> that is not updatable. !?nformation Schema and Definition Schema 579 X0ß0¯0í0ó(g()92-154e¤BL CBR-002 (h*).3 Definition Schema (h*).3.10 COLUMNS base table Function The COLUMNS4able has one row for each column. It effectively con- 4ains a representation of4he column descriptors. Definition CREATE TABLE COLUMNS ( TABLE_CATALOG INFORMATION_SCHEMA.SQL_IDENTIFIER, TABLE_SCHEMA INFORMATION_SCHEMA.SQL_IDENTIFIER, TABLE_NAME INFORMATION_SCHEMA.SQL_IDENTIFIER, COLUMN_NAME INFORMATION_SCHEMA.SQL_IDENTIFIER, ORDINAL_POSITION INFORMATION_SCHEMA.CARDINAL_NUMBER CONSTRAINT COLUMN_POSITION_NOT_NULL NOT NULL, DOMAIN_CATALOG INFORMATION_SCHEMA.SQL_IDENTIFIER, DOMAIN_SCHEMA INFORMATION_SCHEMA.SQL_IDENTIFIER, DOMAIN_NAME INFORMATION_SCHEMA.SQL_IDENTIFIER, COLUMN_DEFAULT INFORMATION_SCHEMA.CHARACTER_DATA, !?S_NULLABLE INFORMATION_SCHEMA.CHARACTER_DATA, 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 )!?N ( 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 ) !?S NOT NULL AND ( TABLE_CATALOG, TABLE_SCHEMA, TABLE_NAME, COLUMN_ NAME ) NOT!?N 580 Database Language SQL X0ß0¯0í0ó(g()92-154e¤BL CBR-002 21.0µ0ó0Á0ü0àDefinition Schema ( SELECT TABLE_OR_DOMAIN_CATALOG, TABLE_OR_DOMAIN_ SCHEMA, TABLE_OR_DOMAIN_NAME, COLUMN_NAME FROM DATA_TYPE_DESCRIPTOR ) OR ( DOMAIN_CATALOG, DOMAIN_SCHEMA, DOMAIN_NAME )!?S NULL AND ( TABLE_CATALOG, TABLE_SCHEMA, TABLE_NAME, COLUMN_ NAME )!?N ( SELECT TABLE_OR_DOMAIN_CATALOG, TABLE_OR_DOMAIN_ SCHEMA, TABLE_OR_DOMAIN_NAME, COLUMN_NAME FROM DATA_TYPE_DESCRIPTOR ) ) ) ) Description 1) Case: a) If a column is described by a column descriptor included in a table descriptor, then4he4able descriptor and the column descriptor are associated7ith that column. b)!?f a column is described by a column descriptor included in a 6iew descriptor, then4he6iew descriptor and4he correspond- ing column descriptor of the table of4he!!query expression> are associated7ith that column. 2) The values of TABLE_CATALOG, TABLE_SCHEMA, and TABLE_NAME are the catalog name, unqualified schema name, andiualified iden- 4ifier, respectively, of the table containing4he column being described. 2 2) The value of COLUMN_NAME is the name of the column being de- scribed. 4) The6alues of DOMAIN_CATALOG, DOMAIN_SCHEMA, and DOMAIN_NAME are null if the column being described is not defined using a . Otherwise, the values of DOMAIN_CATALOG, DOMAIN_ SCHEMA, and DOMAIN_NAME are the catalog name, unqualified schema name, andiualified identifier, respectively, of the domain5sed by4he column being described. 5) The value of ORDINAL_POSITION is4he ordinal0osition of4he column in4he4able. 6) The6alue of COLUMN_DEFAULT is null if the column being de- scribed has no default value or if its default value comes only from a domain. Otherwise,4he6alue of COLUMN_DEFAULT is a character representation of the default value for the col- 5mn4hat obeys the rules specified for in Subclause .5, "". !?nformation Schema and Definition Schema 581 X0ß0¯0í0ó(g()92-154e¤BL CBR-002 (h*).3 Definition Schema 7) The6alues of!?S_NULLABLE have the following meanings: YES The columns is possibly nullable. NO The column is known not nullable. 58(N) Database Language SQL X3H2-9(g()¬4/DBL CBR-00() (h*).3 Definition Schema (h*).3.11 VIEW_TABLE_USAGE base4able Function The VIEW_TABLE_USAGE4able has one row for each table referenced in 4he!!query expression> of a6iew. Definition CREATE TABLE VIEW_TABLE_USAGE ( VIEW_CATALOG !?NFORMATION_SCHEMA.SQL_IDENTIFIER, VIEW_SCHEMA !?NFORMATION_SCHEMA.SQL_IDENTIFIER, VIEW_NAME !?NFORMATION_SCHEMA.SQL_IDENTIFIER, TABLE_CATALOG !?NFORMATION_SCHEMA.SQL_IDENTIFIER, TABLE_SCHEMA !?NFORMATION_SCHEMA.SQL_IDENTIFIER, TABLE_NAME !?NFORMATION_SCHEMA.SQL_IDENTIFIER, 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 1) The6alues of VIEW_CATALOG, VIEW_SCHEMA, and VIEW_NAME are the catalog name, unqualified schema name, andiualified identifier, respectively, of the view being described. (SA) The6alues of TABLE_CATALOG, TABLE_SCHEMA, and TABLE_NAME are 4he catalog name,5nqualified schema name, and qualified identi- fier, respectively, of a4able6iew requires. Information Schema and Definition Schema 583 X3H2-9(g()¬4/DBL CBR-00() 21.0µ0ó0Á0ü0àDefinition Schema 21.0Ô0¢0¹0È0ë VIEW_COLUMN_USAGE base4able Function The VIEW_COLUMN_USAGE table has one row for each column referenced by a6iew. Definition CREATE TABLE VIEW_COLUMN_USAGE ( VIEW_CATALOG INFORMATION_SCHEMA.SQL_IDENTIFIER, VIEW_SCHEMA INFORMATION_SCHEMA.SQL_IDENTIFIER, VIEW_NAME INFORMATION_SCHEMA.SQL_IDENTIFIER, TABLE_CATALOG INFORMATION_SCHEMA.SQL_IDENTIFIER, TABLE_SCHEMA INFORMATION_SCHEMA.SQL_IDENTIFIER, TABLE_NAME INFORMATION_SCHEMA.SQL_IDENTIFIER, COLUMN_NAME INFORMATION_SCHEMA.SQL_IDENTIFIER, 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 1) The6alues of VIEW_CATALOG, VIEW_SCHEMA, and VIEW_NAME are the catalog name, unqualified schema name, andiualified identifier, respectively, of the view being described. (SA) The6alues of TABLE_CATALOG, TABLE_SCHEMA, TABLE_NAME, and COLUMN_NAME are the catalog name, unqualified schema name,iual- ified identifier, and identifier, respectively, of a column4hat is explicitly or implicitly referenced in the of the view being described. 584 Database Language SQL X0ß0¯0í0ó(g()92-154e¤BL CBR-002 21.0µ0ó0Á0ü0àDefinition Schema 21.0Ô0¢0¹0È0ëª TABLE_CONSTRAINTS base4able Function The TABLE_CONSTRAINTS table has one row for each4able constraint associated with a4able. It effectively contains a representation of4he4able constraint descriptors. Definition CREATE TABLE TABLE_CONSTRAINTS ( CONSTRAINT_CATALOG !?NFORMATION_SCHEMA.SQL_IDENTIFIER, CONSTRAINT_SCHEMA INFORMATION_SCHEMA.SQL_IDENTIFIER, CONSTRAINT_NAME !?NFORMATION_SCHEMA.SQL_IDENTIFIER, CONSTRAINT_TYPE INFORMATION_SCHEMA.CHARACTER_DATA CONSTRAINT CONSTRAINT_TYPE_NOT_NULL NOT NULL CONSTRAINT CONSTRAINT_TYPE_CHECK CHECK ( CONSTRAINT_TYPE IN ( 'UNIQUE', 'PRIMARY KEY', 'FOREIGN KEY', 'CHECK' ) ), TABLE_CATALOG !?NFORMATION_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, !?S_DEFERRABLE!?NFORMATION_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,!?NITIALLY_DEFERRED ) IN Information Schema and Definition Schema 585 X3H2-9(g()¬4/DBL CBR-00() 21.0µ0ó0Á0ü0àDefinition Schema ( VALUES ( 'NO', 'NO' ), ( 'YES', 'NO' ), ( 'YES', 'YES' ) ) ), 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 2 2 2 2HERE 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 2 2 2 2HERE ( 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 2 2 2 2HERE CONSTRAINT_TYPE = 'PRIMARY KEY' ) ) ) Description 1) The6alues of CONSTRAINT_CATALOG, CONSTRAINT_SCHEMA, and CONSTRAINT_NAME are the catalog name, unqualified schema name, andiualified identifier, respectively, of the constraint being described. If4he!!table constraint definition> or that defined4he constraint did not spec- ify a ,4hen the values of CONSTRAINT_CATALOG, CONSTRAINT_SCHEMA, and CONSTRAINT_NAME are implementation- defined. 586 Database Language SQL X3H2-9(g()¬4/DBL CBR-00() (h*).3 Definition Schema (SA) The6alues of CONSTRAINT_TYPE have the following meanings: FOREIGN The constraint being described is a foreign key KEY constraint. UNIQUE The constraint being described is a unique con- straint. PRIMARY The constraint being described is a primary key KEY constraint. CHECK The constraint being described is a check con- straint. 2 2) The values of TABLE_CATALOG, TABLE_SCHEMA, and TABLE_NAME are the catalog name, the unqualified schema name, and4heiual- ified identifier of4he name of4he4able4o which the table constraint being described applies. 4) The6alues of!?S_DEFERRABLE have the following meanings: YES The4able constraint is deferrable. NO The table constraint is not deferrable. 5) The6alues of!?NITIALLY_DEFERRED have4he following meanings: YES The table constraint is initially deferred. NO The4able constraint is initially immediate. Information Schema and Definition Schema 587 X3H2-9(g()¬4/DBL CBR-00() 21.0µ0ó0Á0ü0àDefinition Schema 21.0Ô0¢0¹0È0ë KEY_COLUMN_USAGE base table 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, and4he referencing columns in each foreign key constraint. Definition CREATE TABLE KEY_COLUMN_USAGE ( CONSTRAINT_CATALOG !?NFORMATION_SCHEMA.SQL_IDENTIFIER, CONSTRAINT_SCHEMA INFORMATION_SCHEMA.SQL_IDENTIFIER, CONSTRAINT_NAME !?NFORMATION_SCHEMA.SQL_IDENTIFIER, TABLE_CATALOG INFORMATION_SCHEMA.SQL_IDENTIFIER CONSTRAINT KEY_COLUMN_TABLE_CATALOG_NOT_NULL NOT NULL, TABLE_SCHEMA !?NFORMATION_SCHEMA.SQL_IDENTIFIER CONSTRAINT KEY_COLUMN_TABLE_SCHEMA_NOT_NULL NOT NULL, TABLE_NAME !?NFORMATION_SCHEMA.SQL_IDENTIFIER CONSTRAINT KEY_COLUMN_TABLE_NAME_NOT_NULL NOT NULL, COLUMN_NAME !?NFORMATION_SCHEMA.SQL_IDENTIFIER, ORDINAL_POSITION INFORMATION_SCHEMA.CARDINAL_NUMBER CONSTRAINT KEY_COLUMN_ORDINAL_POSITION_NOT_NULL NOT NULL, 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 2 2 2 2HERE CONSTRAINT_TYPE!?N ( 'UNIQUE', 'PRIMARY KEY', 'FOREIGN KEY' ) ) ) ) 588 Database Language SQL X0ß0¯0í0ó(g()92-154e¤BL CBR-002 21.0µ0ó0Á0ü0àDefinition Schema Description 1) The values of CONSTRAINT_CATALOG, CONSTRAINT_SCHEMA, and CONSTRAINT_NAME are4he catalog name,5nqualified schema name, and qualified identifier, respectively, of4he constraint being described. 2) The values of TABLE_CATALOG, TABLE_SCHEMA, TABLE_NAME, and COLUMN_NAME are4he catalog name,5nqualified schema name, qual- ified identifier of the table name, and the column name of4he column that0articipates in4he5nique,0rimary key, or foreign key constraint being described. 2 2) The value of ORDINAL_POSITION is4he ordinal0osition of4he specific column in the constraint being described. If4he con- straint described is a key of cardinality 1,4hen the value of ORDINAL_POSITION is always 1.!?f the constraint being described is a foreign key constraint, then ORDINAL_POSITION also identi- fies the position7ithin the uniqueness constraint of4he column that4his column references. !?nformation Schema and Definition Schema 589 X0ß0¯0í0ó(g()92-154e¤BL CBR-002 (h*).3 Definition Schema (h*).3.15 REFERENTIAL_CONSTRAINTS base table Function The REFERENTIAL_CONSTRAINTS4able has one row for each row in the TABLE_CONSTRAINTS table that has a CONSTRAINT_TYPE6alue of "FOREIGN KEY". Definition CREATE TABLE REFERENTIAL_CONSTRAINTS ( CONSTRAINT_CATALOG !?NFORMATION_SCHEMA.SQL_ !?DENTIFIER, CONSTRAINT_SCHEMA INFORMATION_SCHEMA.SQL_ IDENTIFIER, CONSTRAINT_NAME !?NFORMATION_SCHEMA.SQL_ !?DENTIFIER, UNIQUE_CONSTRAINT_CATALOG INFORMATION_SCHEMA.SQL_ IDENTIFIER CONSTRAINT UNIQUE_CONSTRAINT_CATALOG_NOT_NULL NOT NULL, UNIQUE_CONSTRAINT_SCHEMA INFORMATION_SCHEMA.SQL_ IDENTIFIER CONSTRAINT UNIQUE_CONSTRAINT_SCHEMA_NOT_NULL NOT NULL, UNIQUE_CONSTRAINT_NAME !?NFORMATION_SCHEMA.SQL_ !?DENTIFIER CONSTRAINT UNIQUE_CONSTRAINT_NAME_NOT_NULL NOT NULL, MATCH_OPTION INFORMATION_SCHEMA.CHARACTER_ DATA CONSTRAINT REFERENTIAL_MATCH_OPTION_NOT_NULL NOT NULL CONSTRAINT REFERENTIAL_MATCH_OPTION_CHECK CHECK ( MATCH_OPTION IN ( 'NONE', 'PARTIAL', 'FULL' ) ), UPDATE_RULE !?NFORMATION_SCHEMA.CHARACTER_ DATA CONSTRAINT REFERENTIAL_UPDATE_RULE_NOT_NULL NOT NULL CONSTRAINT REFERENTIAL_UPDATE_RULE_CHECK CHECK ( UPDATE_RULE IN ('CASCADE', 'SET NULL', 'SET DEFAULT', 'NO ACTION' ) ), DELETE_RULE INFORMATION_SCHEMA.CHARACTER_ DATA CONSTRAINT REFERENTIAL_DELETE_RULE_NOT_NULL NOT NULL CONSTRAINT REFERENTIAL_DELETE_RULE_CHECK CHECK ( DELETE_RULE!?N ('CASCADE', 'SET NULL', 'SET DEFAULT', 'NO ACTION' ) ), 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 ) 590 Database Language SQL X3H2-9(g()¬4/DBL CBR-00() (h*).3 Definition Schema !?N ( SELECT CONSTRAINT_CATALOG, CONSTRAINT_SCHEMA, CONSTRAINT_ NAME FROM TABLE_CONSTRAINTS WHERE CONSTRAINT_TYPE = 'FOREIGN KEY' ) ), 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 )!?N ( SELECT CONSTRAINT_CATALOG, CONSTRAINT_ SCHEMA, CONSTRAINT_NAME FROM TABLE_CONSTRAINTS WHERE CONSTRAINT_TYPE IN ( 'UNIQUE', 'PRIMARY KEY' ) ) ) ) ) Description 1) The6alues of CONSTRAINT_CATALOG, CONSTRAINT_SCHEMA, and CONSTRAINT_NAME are the catalog name, unqualified schema name, andiualified identifier, respectively, of the constraint being described. (SA) The6alues of UNIQUE_CONSTRAINT_CATALOG, UNIQUE_CONSTRAINT_ SCHEMA, and UNIQUE_CONSTRAINT_NAME are the catalog name, unqual- ified schema name, andiualified identifier, respectively, of the unique or primary key constraint applied4o the referenced column list being described. 0Î0Ã0È The6alues of MATCH_OPTION have4he following meanings: NONE No 7as specified. PARTIAL A of PARTIAL was specified. FULL A!!match type> of FULL was specified. 2 2 2) The values of UPDATE_RULE have4he following meanings for a referential constraint4hat has an5pdate rule: CASCADE A!!referential action> of CASCADE7as specified. SET NULL A!!referential action> of SET NULL was specified. SET DEFAULT A of SET DEFAULT was speci- fied. NO ACTION A of NO ACTION was speci- fied. Information Schema and Definition Schema 591 X3H2-9(g()¬4/DBL CBR-00() 21.0µ0ó0Á0ü0àDefinition Schema 5) The values of DELETE_RULE have4he following meanings for a referential constraint4hat has a : CASCADE A of CASCADE was specified. SET NULL A of SET NULL7as specified. SET DEFAULT A!!referential action> of SET DEFAULT7as speci- fied. NO ACTION A!!referential action> of NO ACTION7as speci- fied. 592 Database Language SQL X0ß0¯0í0ó(g()92-154e¤BL CBR-002 21.0µ0ó0Á0ü0àDefinition Schema 21.0Ô0¢0¹0È0ë­ CHECK_CONSTRAINTS base4able Function The CHECK_CONSTRAINTS table has one row for each domain constraint, 4able check constraint, and assertion. Definition CREATE TABLE CHECK_CONSTRAINTS ( CONSTRAINT_CATALOG!?NFORMATION_SCHEMA.SQL_IDENTIFIER, CONSTRAINT_SCHEMA !?NFORMATION_SCHEMA.SQL_IDENTIFIER, CONSTRAINT_NAME !?NFORMATION_SCHEMA.SQL_IDENTIFIER, CHECK_CLAUSE !?NFORMATION_SCHEMA.CHARACTER_DATA, 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 1) The values of CONSTRAINT_CATALOG, CONSTRAINT_SCHEMA and CONSTRAINT_NAME are the catalog name, unqualified schema name, andiualified identifier, respectively, of the constraint being described. (SA) Case: a)!?f the character representation of the contained in the ,!!domain constraint definition>, or 4hat de- fined the check constraint being described can be represented without truncation, then4he6alue of CHECK_CLAUSE is that character representation. Information Schema and Definition Schema 593 X3H2-9(g()¬4/DBL CBR-00() 21.0µ0ó0Á0ü0àDefinition Schema b) Otherwise, the value of CHECK_CLAUSE is4he null value. Note: Any implicit!!column reference>s4hat were contained in the associated with a!!check constraint def- inition> or an!!assertion definition> are replaced by explicit !!column reference>s in CHECK_CONSTRAINTS. 594 Database Language SQL X3H2-9(g()¬4/DBL CBR-00() (h*).3 Definition Schema (h*).3.17 CHECK_TABLE_USAGE base table Function The CHECK_TABLE_USAGE4able has one row for each table referenced by4he!!search condition> of a check constraint, domain constraint, or assertion. Definition CREATE TABLE CHECK_TABLE_USAGE ( CONSTRAINT_CATALOG INFORMATION_SCHEMA.SQL_IDENTIFIER, CONSTRAINT_SCHEMA INFORMATION_SCHEMA.SQL_IDENTIFIER, CONSTRAINT_NAME INFORMATION_SCHEMA.SQL_IDENTIFIER, TABLE_CATALOG INFORMATION_SCHEMA.SQL_IDENTIFIER, TABLE_SCHEMA INFORMATION_SCHEMA.SQL_IDENTIFIER, TABLE_NAME INFORMATION_SCHEMA.SQL_IDENTIFIER, 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 1) The6alues of CONSTRAINT_CATALOG, CONSTRAINT_SCHEMA, and CONSTRAINT_NAME are the catalog name, unqualified schema name, andiualified identifier, respectively, of the constraint being described. (SA) The6alues of TABLE_CATALOG, TABLE_SCHEMA, and TABLE_NAME are 4he catalog name,5nqualified schema name, and qualified iden- tifier, respectively, of a4able4hat is referenced by4he constraint being described. Information Schema and Definition Schema 595 X3H2-9(g()¬4/DBL CBR-00() 21.0µ0ó0Á0ü0àDefinition Schema 21.0Ô0¢0¹0È0ë CHECK_COLUMN_USAGE base table Function The CHECK_COLUMN_USAGE table has one row for each column referenced by4he!!search condition> of a check constraint, domain constraint, or assertion. Definition CREATE TABLE CHECK_COLUMN_USAGE ( CONSTRAINT_CATALOG !?NFORMATION_SCHEMA.SQL_IDENTIFIER, CONSTRAINT_SCHEMA !?NFORMATION_SCHEMA.SQL_IDENTIFIER, CONSTRAINT_NAME !?NFORMATION_SCHEMA.SQL_IDENTIFIER, TABLE_CATALOG !?NFORMATION_SCHEMA.SQL_IDENTIFIER, TABLE_SCHEMA !?NFORMATION_SCHEMA.SQL_IDENTIFIER, TABLE_NAME !?NFORMATION_SCHEMA.SQL_IDENTIFIER, COLUMN_NAME !?NFORMATION_SCHEMA.SQL_IDENTIFIER, 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 1) The values of CONSTRAINT_CATALOG, CONSTRAINT_SCHEMA, and CONSTRAINT_NAME are4he catalog name,5nqualified schema name, and qualified identifier, respectively, of4he constraint being described. 596 Database Language SQL X3H2-9(g()¬4/DBL CBR-00() (h*).3 Definition Schema (SA) The6alues of TABLE_CATALOG, TABLE_SCHEMA, TABLE_NAME, and COLUMN_NAME are the catalog name, unqualified schema name, andiualified identifier, respectively, of a column4hat is referenced by4he constraint being described. !?nformation Schema and Definition Schema 597 X0ß0¯0í0ó(g()92-154e¤BL CBR-002 (h*).3 Definition Schema (h*).3.19 ASSERTIONS base4able Function The ASSERTIONS4able has one row for each assertion.!?t effectively contains a representation of the assertion descriptors. Definition CREATE TABLE ASSERTIONS ( CONSTRAINT_CATALOG !?NFORMATION_SCHEMA.SQL_IDENTIFIER, CONSTRAINT_SCHEMA !?NFORMATION_SCHEMA.SQL_IDENTIFIER, CONSTRAINT_NAME !?NFORMATION_SCHEMA.SQL_IDENTIFIER, IS_DEFERRABLE !?NFORMATION_SCHEMA.CHARACTER_DATA CONSTRAINT ASSERTIONS_IS_DEFERRABLE_NOT_NULL NOT NULL, INITIALLY_DEFERRED !?NFORMATION_SCHEMA.CHARACTER_DATA CONSTRAINT ASSERTIONS_INITIALLY_DEFERRED_NOT_NULL NOT NULL, 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,!?NITIALLY_DEFERRED ) IN VALUES ( ( 'NO', 'NO' ), ( 'YES', 'NO' ), ( 'YES', 'YES' ) ) ) ) Description 1) The values of CONSTRAINT_CATALOG, CONSTRAINT_SCHEMA, and CONSTRAINT_NAME are4he catalog name,5nqualified schema name, and qualified identifier, respectively, of4he assertion being described. (SA) The6alues of!?S_DEFERRABLE have the following meanings: YES The assertion is deferrable. NO The assertion is not deferrable. 598 Database Language SQL X0ß0¯0í0ó(g()92-154e¤BL CBR-002 21.0µ0ó0Á0ü0àDefinition Schema 2 2) The values of INITIALLY_DEFERRED have the following meanings: YES The assertion is initially deferred. NO The assertion is initially immediate. Information Schema and Definition Schema 599 X3H2-9(g()¬4/DBL CBR-00() 21.0µ0ó0Á0ü0àDefinition Schema 21.0Ô0¢0¹0È0ë(eå) TABLE_PRIVILEGES base table Function The TABLE_PRIVILEGES table has one row for each4able0rivilege descriptor. It effectively contains a representation of the table 0rivilege descriptors. Definition CREATE TABLE TABLE_PRIVILEGES ( ??RANTOR INFORMATION_SCHEMA.SQL_IDENTIFIER, ??RANTEE INFORMATION_SCHEMA.SQL_IDENTIFIER, TABLE_CATALOG INFORMATION_SCHEMA.SQL_IDENTIFIER, TABLE_SCHEMA INFORMATION_SCHEMA.SQL_IDENTIFIER, TABLE_NAME INFORMATION_SCHEMA.SQL_IDENTIFIER, PRIVILEGE_TYPE INFORMATION_SCHEMA.CHARACTER_DATA CONSTRAINT TABLE_PRIVILEGES_TYPE_CHECK CHECK ( PRIVILEGE_TYPE IN ( 'SELECT', 'INSERT', 'DELETE', 'UPDATE' 'REFERENCES' ) ), IS_GRANTABLE !?NFORMATION_SCHEMA.CHARACTER_DATA CONSTRAINT TABLE_PRIVILEGES_GRANTABLE_NOT_NULL NOT NULL CONSTRAINT TABLE_PRIVILEGES_GRANTABLE_CHECK CHECK (!?S_GRANTABLE IN ( 'YES', 'NO' ) ), CONSTRAINT TABLE_PRIVILEGES_PRIMARY_KEY PRIMARY KEY (??RANTOR, 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 (??RANTOR ) REFERENCES USERS, CONSTRAINT TABLE_PRIVILEGES_GRANTEE_FOREIGN_KEY_USERS FOREIGN KEY ( GRANTEE ) REFERENCES USERS ) Description 1) The value of??RANTOR is the of the user7ho granted4able0rivileges, on the table identified by TABLE_CATALOG, TABLE_SCHEMA, and TABLE_NAME,4o the user iden- 4ified by4he6alue of GRANTEE for the table privilege being described. 600 Database Language SQL X3H2-9(g()¬4/DBL CBR-00() (h*).3 Definition Schema (SA) The6alue of GRANTEE is4he!!authorization identifier> of some user, or "PUBLIC" to indicate all users,4o whom4he4able0riv- ilege being described is granted. 2 2) The values of TABLE_CATALOG, TABLE_SCHEMA, and TABLE_NAME are the catalog name, unqualified schema name, andiualified iden- 4ifier, respectively, of the table on7hich4he0rivilege being described has been granted. 2 2 2) The values of PRIVILEGE_TYPE have the following meanings: SELECT The user has SELECT privileges on the table identified by TABLE_CATALOG, TABLE_SCHEMA, and TABLE_NAME. DELETE The user has DELETE privileges on the table identified by TABLE_CATALOG, TABLE_SCHEMA, and TABLE_NAME. !?NSERT The user7ill automatically be granted!?NSERT priv- ileges on any columns4hat may be added4o the table identified by TABLE_CATALOG, TABLE_SCHEMA, and TABLE_ NAME in the future. UPDATE The user7ill automatically be granted UPDATE priv- ileges on any columns4hat may be added4o the table identified by TABLE_CATALOG, TABLE_SCHEMA, and TABLE_ NAME in the future. REFERENCESThe5ser will automatically be granted REFERENCES privileges on any columns that may be added to4he table identified by TABLE_CATALOG, TABLE_SCHEMA, and TABLE_NAME in the future. 5) The6alues of!?S_GRANTABLE have4he following meanings: YES The0rivilege being described7as granted 2 2 2 2ITH GRANT OPTION and is4hus grantable. NO The0rivilege being described7as not granted 2 2 2 2ITH ??RANT OPTION and is4hus not grantable. Information Schema and Definition Schema 5 501 X3H2-9(g()¬4/DBL CBR-00() 21.0µ0ó0Á0ü0àDefinition Schema 21.0Ô0¢0¹0È0ë(h*) COLUMN_PRIVILEGES base4able Function The COLUMN_PRIVILEGES table has one row for each column privilege descriptor.!?t effectively contains a representation of4he column 0rivilege descriptors. Definition CREATE TABLE COLUMN_PRIVILEGES ( GRANTOR !?NFORMATION_SCHEMA.SQL_IDENTIFIER, GRANTEE !?NFORMATION_SCHEMA.SQL_IDENTIFIER, TABLE_CATALOG !?NFORMATION_SCHEMA.SQL_IDENTIFIER, TABLE_SCHEMA !?NFORMATION_SCHEMA.SQL_IDENTIFIER, TABLE_NAME !?NFORMATION_SCHEMA.SQL_IDENTIFIER, COLUMN_NAME !?NFORMATION_SCHEMA.SQL_IDENTIFIER, PRIVILEGE_TYPE !?NFORMATION_SCHEMA.CHARACTER_DATA CONSTRAINT COLUMN_PRIVILEGES_TYPE_CHECK CHECK ( PRIVILEGE_TYPE IN ( 'SELECT', 'INSERT', 'UPDATE', 'REFERENCES' ) ), !?S_GRANTABLE INFORMATION_SCHEMA.CHARACTER_DATA CONSTRAINT COLUMN_PRIVILEGES_IS_GRANTABLE_NOT_NULL NOT NULL CONSTRAINT COLUMN_PRIVILEGES_IS_GRANTABLE_CHECK CHECK (!?S_GRANTABLE IN ( 'YES', 'NO' ) ), CONSTRAINT COLUMN_PRIVILEGES_PRIMARY_KEY PRIMARY KEY ( GRANTOR,??RANTEE, 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 (??RANTOR ) REFERENCES USERS, CONSTRAINT COLUMN_PRIVILEGES_GRANTEE_FOREIGN_KEY_USERS FOREIGN KEY (??RANTEE ) REFERENCES USERS ) 60(N) Database Language SQL X3H2-9(g()¬4/DBL CBR-00() (h*).3 Definition Schema Description 1) The6alue of GRANTOR is4he!!authorization identifier> of4he 5ser who granted column0rivileges, on the column identified by TABLE_CATALOG, TABLE_SCHEMA, TABLE_NAME, and COLUMN_NAME,4o the user identified by4he6alue of GRANTEE for the column0rivilege being described. (SA) The6alue of GRANTEE is4he!!authorization identifier> of some user, or "PUBLIC" to indicate all users,4o whom4he column privilege being described is granted. 0Î0Ã0È The6alues of TABLE_CATALOG, TABLE_SCHEMA, TABLE_NAME, and COLUMN_NAME are the catalog name, unqualified schema name, and iualified identifier, respectively, of the column4o which the privilege being described was granted. 2 2 2) The values of PRIVILEGE_TYPE have the following meanings: SELECT The user has SELECT privilege on4he column identified by TABLE_CATALOG.TABLE_SCHEMA.TABLE_NAME.COLUMN_NAME. !?NSERT The user has!?NSERT privilege on4he column identified by TABLE_CATALOG.TABLE_SCHEMA.TABLE_NAME.COLUMN_NAME. UPDATE The user has UPDATE privilege on4he column identified by TABLE_CATALOG.TABLE_SCHEMA.TABLE_NAME.COLUMN_NAME. REFERENCE The5ser has REFERENCES0rivilege on the column identified by TABLE_CATALOG.TABLE_SCHEMA.TABLE_ NAME.COLUMN_NAME. 5) The values of IS_GRANTABLE have the following meanings: YES The privilege being described was granted WITH??RANT OPTION and is thus grantable. NO The privilege being described was not granted WITH GRANT OPTION and is thus not grantable. !?nformation Schema and Definition Schema 600ª0ü0à X0ß0¯0í0ó(g()92-154e¤BL CBR-002 (h*).3 Definition Schema (h*).3.2(N) USAGE_PRIVILEGES base4able Function The USAGE_PRIVILEGES4able has one row for each usage privilege descriptor.!?t effectively contains a representation of4he5sage privilege descriptors. Definition CREATE TABLE USAGE_PRIVILEGES ( GRANTOR !?NFORMATION_SCHEMA.SQL_IDENTIFIER, GRANTEE !?NFORMATION_SCHEMA.SQL_IDENTIFIER, OBJECT_CATALOG!?NFORMATION_SCHEMA.SQL_IDENTIFIER, OBJECT_SCHEMA !?NFORMATION_SCHEMA.SQL_IDENTIFIER, OBJECT_NAME !?NFORMATION_SCHEMA.SQL_IDENTIFIER, OBJECT_TYPE !?NFORMATION_SCHEMA.SQL_IDENTIFIER CONSTRAINT USAGE_PRIVILEGES_OBJECT_TYPE_CHECK CHECK ( OBJECT_TYPE!?N ( 'DOMAIN', 'CHARACTER SET', 'COLLATION', 'TRANSLATION' ) ), IS_GRANTABLE !?NFORMATION_SCHEMA.CHARACTER_DATA CONSTRAINT USAGE_PRIVILEGES_IS_GRANTABLE_NOT_NULL NOT NULL CONSTRAINT USAGE_PRIVILEGES_IS_GRANTABLE_CHECK CHECK (!?S_GRANTABLE IN ( 'YES', 'NO' ) ), CONSTRAINT USAGE_PRIVILEGES_PRIMARY_KEY PRIMARY KEY (??RANTOR, GRANTEE, OBJECT_CATALOG, OBJECT_ SCHEMA, OBJECT_NAME, OBJECT_TYPE ), CONSTRAINT USAGE_PRIVILEGES_CHECK_REFERENCES_OBJECT CHECK ( ( OBJECT_CATALOG, OBJECT_SCHEMA, OBJECT_NAME, OBJECT_ TYPE )!?N ( 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 ) ), 604 Database Language SQL X3H2-9(g()¬4/DBL CBR-00() (h*).3 Definition Schema CONSTRAINT USAGE_PRIVILEGES_GRANTOR_FOREIGN_KEY_USERS FOREIGN KEY (??RANTOR ) REFERENCES USERS, CONSTRAINT USAGE_PRIVILEGES_GRANTEE_FOREIGN_KEY_USERS FOREIGN KEY ( GRANTEE ) REFERENCES USERS ) Description 1) The6alue of GRANTOR is4he!!authorization identifier> of4he 5ser who granted usage privileges, on4he object of4he4ype identified by OBJECT_TYPE that is identified by OBJECT_CATALOG, OBJECT_SCHEMA, and OBJECT_NAME, to4he5ser identified by the value of??RANTEE for4he5sage0rivilege being described. (SA) The6alue of GRANTEE is4he!!authorization identifier> of some user, or "PUBLIC" to indicate all users,4o whom4he5sage0riv- ilege being described is granted. 2 2) The values of OBJECT_CATALOG, OBJECT_SCHEMA, and OBJECT_NAME are4he catalog name,5nqualified schema name, and qualified identifier, respectively, of4he object to7hich4he0rivilege applies. 4) The6alues of OBJECT_TYPE has4he following meanings: DOMAIN The object4o which the privilege applies is a domain. CHARACTER The object4o which the privilege applies is a SET character set. COLLATION The object to7hich4he0rivilege applies is a collation. TRANSLATION The object4o which the privilege applies is a 4ranslation. 5) The6alues of!?S_GRANTABLE have4he following meanings: YES The privilege being described was granted WITH??RANT OPTION and is4hus grantable. NO The privilege being described was not granted WITH??RANT OPTION and is4hus not grantable. !?nformation Schema and Definition Schema 605 X0ß0¯0í0ó(g()92-154e¤BL CBR-002 (h*).3 Definition Schema (h*).3.20µ0ó0Á0ü0à CHARACTER_SETS base4able Function The CHARACTER_SETS4able has one row for each character set de- scriptor. Definition CREATE TABLE CHARACTER_SETS ( CHARACTER_SET_CATALOG INFORMATION_SCHEMA.SQL_IDENTIFIER, 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 !?NFORMATION_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 ) ) ) 5 50 Database Language SQL X0ß0¯0í0ó(g()92-154e¤BL CBR-002 21.0µ0ó0Á0ü0àDefinition Schema Description 1) The6alues of CHARACTER_SET_CATALOG, CHARACTER_SET_SCHEMA, and CHARACTER_SET_NAME are4he catalog name,5nqualified schema name, and qualified identifier, respectively, of4he character set being described. (SA) The6alue of FORM_OF_USE is4he name of4he form-of-use of the character set. 2 2) The value of NUMBER_OF_CHARACTERS is4he number of characters in 4he character repertoire. 2 2 2) Case: a) If4he default collation for4he character repertoire is 4he order of characters in the repertoire, then4he6al- ues of DEFAULT_COLLATE_CATALOG and DEFAULT_COLLATE_SCHEMA are the values of CHARACTER_SET_CATALOG and CHARACTER_SET_ SCHEMA, respectively, and4he6alue of DEFAULT_COLLATE_NAME is implementation-dependent. b) Otherwise,4he6alues of DEFAULT_COLLATE_CATALOG, DEFAULT_ COLLATE_SCHEMA, and DEFAULT_COLLATE_NAME are catalog name, unqualified schema name, andiualified identifier, respec- 4ively, of the default collation. 5) There is a row in this4able for4he character set!?NFORMATION_ SCHEMA.SQL_TEXT.!?n that row: a) CHARACTER_SET_CATALOG, CHARACTER_SET_SCHEMA, and CHARACTER_ SET_NAME are4he name of4he catalog, 'INFORMATION_SCHEMA', and 'SQL_TEXT', respectively. b) FORM_OF_USE is implementation-defined. c) NUMBER_OF_CHARACTERS is implementation-defined. d) DEFAULT_COLLATE_CATALOG, DEFAULT_COLLATE_SCHEMA, and DEFAULT_ COLLATE_NAME are the name of the catalog, 'INFORMATION_ SCHEMA', and 'SQL_TEXT', respectively. Information Schema and Definition Schema 5 507 X3H2-9(g()¬4/DBL CBR-00() 21.0µ0ó0Á0ü0àDefinition Schema 21.0Ô0¢0¹0È0ë(T ) COLLATIONS base table Function The COLLATIONS table has one row for each character collation de- scriptor. Definition CREATE TABLE COLLATIONS ( COLLATION_CATALOG !?NFORMATION_SCHEMA.SQL_IDENTIFIER, COLLATION_SCHEMA INFORMATION_SCHEMA.SQL_IDENTIFIER, COLLATION_NAME !?NFORMATION_SCHEMA.SQL_IDENTIFIER, CHARACTER_SET_CATALOG INFORMATION_SCHEMA.SQL_IDENTIFIER CONSTRAINT COLLATIONS_CHARACTER_SET_CATALOG_NOT_NULL NOT NULL, CHARACTER_SET_SCHEMA INFORMATION_SCHEMA.SQL_IDENTIFIER CONSTRAINT COLLATIONS_CHARACTER_SET_SCHEMA_NOT_NULL NOT NULL, CHARACTER_SET_NAME !?NFORMATION_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 ) !?N ( SELECT CHARACTER_SET_CATALOG, CHARACTER_ SET_SCHEMA, CHARACTER_SET_NAME FROM CHARACTER_SETS ) ) ) 5 5SA Database Language SQL X0ß0¯0í0ó(g()92-154e¤BL CBR-002 21.0µ0ó0Á0ü0àDefinition Schema Description 1) The values of COLLATION_CATALOG, COLLATION_SCHEMA, and COLLATION_ NAME are4he catalog name,5nqualified schema name, and quali- fied identifier, respectively, of4he collation being defined. (SA) The6alues of CHARACTER_SET_CATALOG, CHARACTER_SET_SCHEMA, and CHARACTER_SET_NAME are4he catalog name,5nqualified schema name, and qualified identifier, respectively, of4he character set on which the collation is defined. 0Î0Ã0È The6alues of PAD_ATTRIBUTE have the following meanings: NO PAD The collation being described has the NO PAD at- tribute. PAD SPACE The collation being described has4he PAD SPACE attribute. 2 2 2) A row always exists in4his table for the collation SQL_TEXT. That row contains the definition of the collation corresponding to4he default collation for4he characters in4he character set SQL_TEXT.!?n that row: a) COLLATION_CATALOG, COLLATION_SCHEMA, and COLLATION_NAME are the name of the catalog, 'INFORMATION_SCHEMA', and 'SQL_ TEXT', respectively. b) CHARACTER_SET_CATALOG, CHARACTER_SET_SCHEMA, and CHARACTER_ SET_NAME are4he name of4he catalog, 'INFORMATION_SCHEMA', and 'SQL_TEXT', respectively. c) PAD_ATTRIBUTE is implementation-defined. Information Schema and Definition Schema 5 5SD X3H2-9(g()¬4/DBL CBR-00() 21.0µ0ó0Á0ü0àDefinition Schema 21.0Ô0¢0¹0È0ë(ry) TRANSLATIONS base table Function The TRANSLATIONS table has one row for each character4ranslation descriptor. Definition CREATE TABLE TRANSLATIONS ( TRANSLATION_CATALOG INFORMATION_SCHEMA.SQL_ IDENTIFIER, TRANSLATION_SCHEMA !?NFORMATION_SCHEMA.SQL_ !?DENTIFIER, TRANSLATION_NAME INFORMATION_SCHEMA.SQL_ IDENTIFIER, SOURCE_CHARACTER_SET_CATALOG !?NFORMATION_SCHEMA.SQL_ !?DENTIFIER CONSTRAINT TRANSLATIONS_SOURCE_CHARACTER_SET_CATALOG_NOT_ NULL NOT NULL, SOURCE_CHARACTER_SET_SCHEMA INFORMATION_SCHEMA.SQL_ IDENTIFIER CONSTRAINT TRANSLATIONS_SOURCE_CHARACTER_SET_SCHEMA_NOT_ NULL NOT NULL, SOURCE_CHARACTER_SET_NAME INFORMATION_SCHEMA.SQL_ IDENTIFIER CONSTRAINT TRANSLATIONS_SOURCE_CHARACTER_SET_NAME_NOT_ NULL NOT NULL, TARGET_CHARACTER_SET_CATALOG INFORMATION_SCHEMA.SQL_ IDENTIFIER CONSTRAINT TRANSLATIONS_TARGET_CHARACTER_SET_CATALOG_NOT_ NULL NOT NULL, TARGET_CHARACTER_SET_SCHEMA !?NFORMATION_SCHEMA.SQL_ !?DENTIFIER CONSTRAINT TRANSLATIONS_TARGET_CHARACTER_SET_SCHEMA_NOT_ NULL NOT NULL, TARGET_CHARACTER_SET_NAME !?NFORMATION_SCHEMA.SQL_ !?DENTIFIER CONSTRAINT TRANSLATIONS_TARGET_CHARACTER_SET_NAME_NOT_ NULL NOT NULL, 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 ) 5 510 Database Language SQL X0ß0¯0í0ó(g()92-154e¤BL CBR-002 21.0µ0ó0Á0ü0àDefinition Schema OR ( SOURCE_CHARACTER_SET_CATALOG, SOURCE_CHARACTER_ SET_SCHEMA, SOURCE_CHARACTER_SET_NAME )!?N ( 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 1) The values of TRANSLATION_CATALOG, TRANSLATION_SCHEMA, and TRANSLATION_NAME are the catalog name, unqualified schema name, andiualified identifier, respectively, of the translation being described. 2) The values of SOURCE_CHARACTER_SET_CATALOG, SOURCE_CHARACTER_ SET_SCHEMA, and SOURCE_CHARACTER_SET_NAME are the catalog name, unqualified schema name, andiualified identifier, respectively, of the character set specified as4he source for the transla- 4ion. 2 2) The values of TARGET_CHARACTER_SET_CATALOG, TARGET_CHARACTER_ SET_SCHEMA, and TARGET_CHARACTER_SET_NAME are the catalog name, unqualified schema name, andiualified identifier, respectively, of the character set specified as4he4arget for the transla- 4ion. Information Schema and Definition Schema 5 5 X3H2-9(g()¬4/DBL CBR-00() 21.0µ0ó0Á0ü0àDefinition Schema 21.0Ô0¢0¹0È0ë(Œ¡) SQL_LANGUAGES base4able Function The SQL_LANGUAGES table has one row for each!?SO and implementation- defined SQL language binding and0rogramming language for which conformance is claimed. Definition CREATE TABLE SQL_LANGUAGES ( SQL_LANGUAGE_SOURCE !?NFORMATION_SCHEMA.CHARACTER_ DATA CONSTRAINT SQL_LANGUAGES_SOURCE_NOT_NULL NOT NULL, SQL_LANGUAGE_YEAR !?NFORMATION_SCHEMA.CHARACTER_ DATA, SQL_LANGUAGE_CONFORMANCE !?NFORMATION_SCHEMA.CHARACTER_ DATA, SQL_LANGUAGE_INTEGRITY !?NFORMATION_SCHEMA.CHARACTER_ DATA, SQL_LANGUAGE_IMPLEMENTATION !?NFORMATION_SCHEMA.CHARACTER_ DATA, SQL_LANGUAGE_BINDING_STYLE !?NFORMATION_SCHEMA.CHARACTER_ DATA, SQL_LANGUAGE_PROGRAMMING_LANGUAGE!?NFORMATION_SCHEMA.CHARACTER_ DATA, CONSTRAINT SQL_LANGUAGES_STANDARD_VALID_CHECK CHECK ( ( SQL_LANGUAGE_SOURCE = 'ISO 9075' AND SQL_LANGUAGE_YEAR!?S 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!?S 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!?N ( 'COBOL', 'FORTRAN', 'PASCAL', 'PLI' ) ) ) ) OR ( SQL_LANGUAGE_YEAR = '1989' AND AND SQL_LANGUAGE_CONFORMANCE IN ( '1', '2' ) AND SQL_LANGUAGE_INTEGRITY!?N ( 'NO', 'YES' ) AND 61(N) Database Language SQL X3H2-9(g()¬4/DBL CBR-00() (h*).3 Definition Schema ( ( 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!?N ( 'COBOL', 'FORTRAN', 'PASCAL', 'PLI' ) ) ) ) OR ( SQL_LANGUAGE_YEAR = '199(Qk) 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 !?N ( 'EMBEDDED', 'MODULE' ) AND SQL_LANGUAGE_PROGRAMMING_LANGUAGE IN ( 'ADA', 'C', 'COBOL', 'FORTRAN', 'MUMPS', 'PASCAL', 'PLI' ) ) ) ) ) ) OR ( SQL_LANGUAGE_SOURCE <> 'ISO 9075' ) ) ) Description 1) Each row represents one binding of an ISO or implementation- defined SQL language to a standard module language, direct invocation, or an embedded0rogramming language. 2) The value of SQL_LANGUAGE_SOURCE is the name of the source of the language definition. The source of standard SQL language is the value 'ISO 9075', while the source of an implementation- defined6ersion of SQL is implementation-defined. 2 2) If4he6alue of SQL_LANGUAGE_SOURCE is 'ISO 9075',4hen the value of SQL_LANGUAGE_YEAR is the year4hat the ISO standard 7as approved. Otherwise, the value of SQL_LANGUAGE_YEAR is implementation-defined. Note: As each new!?SO SQL standard revision is approved, a new valid value of SQL_LANGUAGE_YEAR must be added4o the CHECK constraint for4his column. Information Schema and Definition Schema 5 5ª X3H2-9(g()¬4/DBL CBR-00() 21.0µ0ó0Á0ü0àDefinition Schema 2 2 2) If4he6alue of SQL_LANGUAGE_SOURCE is 'ISO 9075',4hen the value of SQL_LANGUAGE_CONFORMANCE is4he conformance level4o which conformance is claimed for4he!?SO standard. Otherwise, the value of SQL_LANGUAGE_CONFORMANCE is implementation-defined. 5) If4he6alue of SQL_LANGUAGE_SOURCE is 'ISO 9075' and that language contains an optional integrity enhancement feature, then4he6alue of SQL_LANGUAGE_INTEGRITY is 'YES' if confor- mance is claimed to4he integrity enhancement feature, and 'NO' otherwise. Otherwise,4he6alue of SQL_LANGUAGE_INTEGRITY is implementation-defined. 6)!?f the value of SQL_LANGUAGE_SOURCE is 'ISO 9075', then4he 6alue of SQL_LANGUAGE_IMPLEMENTATION is null. Otherwise, the value of SQL_LANGUAGE_IMPLEMENTATION is an implementation- defined character string value. 5 5 5) If4he6alue of SQL_LANGUAGE_SOURCE is 'ISO 9075',4hen the value of SQL_LANGUAGE_BINDING_STYLE is4he style of binding of 4he SQL language.!?f the value of SQL_LANGUAGE_BINDING_STYLE is 'MODULE',4hen the binding style of!!module> is supported. If 4he6alue of SQL_LANGUAGE_BINDING_STYLE is 'EMBEDDED', then4he binding style of is supported. If 4he6alue of SQL_LANGUAGE_BINDING_STYLE is 'DIRECT', then4he binding style of is supported. Otherwise, the value of SQL_LANGUAGE_BINDING_STYLE is implementation- defined. 8)!?f the value of SQL_LANGUAGE_SOURCE is 'ISO 9075', then4he 6alue of SQL_LANGUAGE_PROGRAMMING_LANGUAGE is4he0rogram- ming language supported by4he binding style indicated by the value of SQL_LANGUAGE_BINDING_STYLE.!?f the value of SQL_LANGUAGE_BINDING_STYLE is 'DIRECT',4hen SQL_LANGUAGE_ PROGRAMMING_LANGUAGE is the null6alue. If4he6alue of SQL_ LANGUAGE_BINDING_STYLE is 'MODULE' or 'EMBEDDED',4hen SQL_ LANGUAGE_PROGRAMMING_LANGUAGE has4he6alue 'ADA', 'C', 'COBOL', 'FORTRAN', 'MUMPS', 'PASCAL', or 'PLI'. Case: a)!?f SQL_LANGUAGE_PROGRAMMING_LANGUAGE is 'ADA', then Ada is supported with4he given binding style. b) If SQL_LANGUAGE_PROGRAMMING_LANGUAGE is 'C',4hen C is sup- ported7ith the given binding style. c)!?f SQL_LANGUAGE_PROGRAMMING_LANGUAGE is 'COBOL', then COBOL is supported with4he given binding style. d) If SQL_LANGUAGE_PROGRAMMING_LANGUAGE is 'FORTRAN',4hen Fortran is supported7ith the given binding style. e)!?f SQL_LANGUAGE_PROGRAMMING_LANGUAGE is 'MUMPS', then MUMPS is supported with4he given binding style. 614 Database Language SQL X3H2-9(g()¬4/DBL CBR-00() (h*).3 Definition Schema f) If SQL_LANGUAGE_PROGRAMMING_LANGUAGE is 'PASCAL', then Pascal is supported7ith the given binding style. g)!?f SQL_LANGUAGE_PROGRAMMING_LANGUAGE is 'PLI', then PL/I is supported7ith the given binding style. Otherwise,4he6alue of SQL_LANGUAGE_PROGRAMMING_LANGUAGE is implementation-defined. !?nformation Schema and Definition Schema 615 X0ß0¯0í0ó(g()92-154e¤BL CBR-002 (h*).4 Assertions on4he base tables (h*).4 Assertions on the base4ables The following clauses specify assertions4hat apply to4he base 4ables specified in Subclause 21.0Ñ0ü0Ä "Definition Schema". The paramount criterion in formulating4hese assertions (after cor- rectness) is ease of understanding for the human reader. There may 7ell be formulations of4he same assertions4hat are more effi- cient for some SQL-implementation, andiuite0ossibly for all such implementations. (h*).4.1 UNIQUE_CONSTRAINT_NAME assertion Function The UNIQUE_CONSTRAINT_NAME assertion ensures4hat the same combi- nation of!!schema name> and!!constraint name> is not used by more than one constraint. Note: The UNIQUE_CONSTRAINT_NAME assertion avoids4he need for separate checks on DOMAINS, TABLE_CONSTRAINTS, and ASSERTIONS. Definition CREATE ASSERTION UNIQUE_CONSTRAINT_NAME CHECK ( 1 = ( SELECT MAX ( OCCURRENCES ) FROM ( SELECT COUNT (*) AS OCCURRENCES FROM ( SELECT CONSTRAINT_CATALOG, CONSTRAINT_SCHEMA, CONSTRAINT_ NAME FROM DOMAIN_CONSTRAINTS UNION ALL SELECT CONSTRAINT_CATALOG, CONSTRAINT_SCHEMA, CONSTRAINT_ NAME FROM TABLE_CONSTRAINTS UNION ALL SELECT CONSTRAINT_CATALOG, CONSTRAINT_SCHEMA, CONSTRAINT_ NAME FROM ASSERTIONS ) GROUP BY CONSTRAINT_CATALOG, CONSTRAINT_SCHEMA, CONSTRAINT_ NAME ) ) ) Description 1) The UNIQUE_CONSTRAINT_NAME assertion checks that no combination of (CONSTRAINT_CATALOG, CONSTRAINT_SCHEMA, CONSTRAINT_NAME) appears more4han once in the tables DOMAINS, TABLE_CONSTRAINTS and ASSERTIONS. 616 Database Language SQL X3H2-9(g()¬4/DBL CBR-00() (h*).4 Assertions on4he base tables (h*).4.2 EQUAL_KEY_DEGREES assertion Function The assertion EQUAL_KEY_DEGREES ensures4hat every foreign key is of4he same degree as the corresponding unique constraint. Definition CREATE ASSERTION EQUAL_KEY_DEGREES CHECK ( NOT EXISTS ( SELECT * FROM ( SELECT COUNT ( DISTINCT FK.COLUMN_NAME ), COUNT ( DISTINCT PK.COLUMN_NAME ) FROM KEY_COLUMN_USAGE AS FK, REFERENTIAL_CONSTRAINTS AS RF, KEY_COLUMN_USAGE AS PK 2 2 2 2HERE ( FK.CONSTRAINT_CATALOG, FK.CONSTRAINT_ SCHEMA, FK.CONSTRAINT_NAME ) = ( RF.CONSTRAINT_CATALOG, RF.CONSTRAINT_ SCHEMA, RF.CONSTRAINT_NAME ) AND ( PK.CONSTRAINT_CATALOG, PK.CONSTRAINT_ SCHEMA, PK.CONSTRAINT_NAME ) = ( RF.UNIQUE_CONSTRAINT_CATALOG, RF.UNIQUE_ CONSTRAINT_SCHEMA, RF.UNIQUE_CONSTRAINT_NAME ) GROUP BY RF.CONSTRAINT_CATALOG, RF.CONSTRAINT_SCHEMA, RF.CONSTRAINT_ NAME ) AS REF ( FK_DEGREE, PK_DEGREE ) WHERE FK_DEGREE <> PK_DEGREE ) ) !?nformation Schema and Definition Schema 617 X0ß0¯0í0ó(g()92-154e¤BL CBR-002 (h*).4 Assertions on4he base tables (h*).4.3 KEY_DEGREE_GREATER_THAN_OR_EQUAL_TO_1 assertion Function The assertion KEY_DEGREE_GREATER_THAN_OR_EQUAL_TO_1 ensures4hat every5nique or0rimary key constraint has at least one5nique column and that every referential constraint has at least one ref- erencing column. Definition CREATE ASSERTION KEY_DEGREE_GREATER_THAN_OR_EQUAL_TO_1 CHECK ( NOT EXISTS ( SELECT * FROM TABLE_CONSTRAINTS FULL OUTER JOIN KEY_COLUMN_USAGE USING ( CONSTRAINT_CATALOG, CONSTRAINT_SCHEMA, CONSTRAINT_ NAME ) WHERE COLUMN_NAME IS NULL AND CONSTRAINT_TYPE IN ( 'UNIQUE', 'PRIMARY KEY', 'FOREIGN KEY' ) ) ) 618 Database Language SQL X3H2-9(g()¬4/DBL CBR-00() (g ) Status codes 2(‘Ñ)1 SQLSTATE The character string6alue returned in an SQLSTATE0arameter com- 0rises a (g()character class value followed by a 0Ð0ü0ì0ëcharacter subclass value, each with an implementation-defined character set4hat has a one-actet form-of-use and is restricted4o s and!!simple Latin upper case letter>s. Table 20Ñ0ü0Ä "SQLSTATE class and sub- class6alues", specifies the class value for each condition and the subclass6alue or values for each class value. Class6alues that begin7ith one of4he!!digit>s '0', '1', '2', '3', or '4' or one of the s 'A', 'B', 'C', 'D', 'E', 'F', 'G', or 'H' are returned only for con- ditions defined in this!?nternational Standard or in any other !?nternational Standard. The class6alue 'HZ' is reserved for con- ditions defined in!?SOgEC DIS 9579-(‘Ñ) Subclass values associated 7ith such classes4hat also begin7ith one of4hose 10µ0ó0Á0ü0àcharacters are returned only for conditions defined in this!?nternational Standard; subclass6alues associated7ith such classes4hat begin 7ith one of4he!!digit>s '5', '6', '7', '8', or '9' or one of4he 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 values4hat begin with one of the s '5', '6', '7', '8', or '9' or one of4he!!simple Latin5pper 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',7hich means no subclass, associated7ith such classes are reserved for implementation-specified conditions and are called implementation-defined subclasses. If a subclass value is not specified for a condition, then either subclass '000' or an implementation-defined subclass is returned. An implementation-specified condition may duplicate a condition de- fined in4his International Standard; however, if such a condition occurs as a result of executing a statement,4hen the corresponding implementation-defined SQLSTATE6alue shall not be returned in the SQLSTATE parameter but may be returned in4he diagnostics area. ___________Table_20Ð0ü0ì0ëSQLSTATE_class_and_subclass_values____________ Condition__________________Class_Subcondition_______________Subclass | ambiguous cursor name = 2 2C = (no subclass) | 000 = = | | = | | = = | = Status codes 619 X0ß0¯0í0ó(g()92-154e¤BL CBR-002 (g ).1 SQLSTATE _______Table_20Ð0ü0ì0ëSQLSTATE_class_and_subclass_values_(Cont.)________ Condition__________________Class_Subcondition_______________Subclass | cardinality violation = 21 = (no subclass) | 000 = = | | = | | connection exception = 08 = (no subclass) | 000 = = | | = | | = = connection does not | 000µ0ó0Á0ü0à= exist = | | connection failure = 00 | | = = | = = | | connection name in5se = 002 | | = = | = = | | SQL-client5nable to = 001 | establish SQL-connection = | | SQL-server rejected = 004 | | = = establishment of SQL- | = connection | = =4ransaction resolution | 007 = = | | unknown = | | = = | = = data exception | (g ) | (no subclass) = 000 | | = = | = = | | character not in reper- = 0(h*) | 4oire | = = datetime field overflow | 008 = = | | = | | = = division by+ero | 01(N)= = | | = | | = = error in assignment | 005 = = | | = | | = = indicator overflow | 02(N)= = | | = | | = = interval field overflow | 015 = = | | = | | = = invalid character6alue | 018 = for cast | = = invalid datetime format | 007 = = | | = | | = = invalid escape character | 019 = = | | = | | = = invalid escape sequence | 025 = = | | = | | = = invalid0arameter6alue | 020µ0ó0Á0ü0à= = | | = | | = = invalid4ime zone dis- | 009 = placement value = | | null6alue, no indicator= 002 | | = =0arameter | = = | | = | | = = numeric6alue out of | 000µ0ó0Á0ü0à= = | | range = | | = = | = = | | string data, length = 0(Œ¡) | | = = mismatch | = = | | = | 5 5(eå) Database Language SQL X0ß0¯0í0ó(g()92-154e¤BL CBR-002 (g ).1 SQLSTATE _______Table_20Ð0ü0ì0ëSQLSTATE_class_and_subclass_values_(Cont.)________ Condition__________________Class_Subcondition_______________Subclass | = = string data, right | 001 = truncation | = = substring error | 011 = = | | = | | = =4rim error | 027 = = | | = | | = =5nterminated C string | 024 = = | | = | | dependent privilege = 2B = (no subclass) | 000 = descriptors still exist | dynamic SQL error = 07 = (no subclass) | 000 = = | | = | | = = cursor specification | 000µ0ó0Á0ü0à= cannot be executed | = = invalid descriptor count | 008 = = | | = | | = = invalid descriptor index | 009 = = | | = | | = =0repared statement not a | 005 = cursor specification | = = restricted data4ype | 006 = = | | attribute violation = | | = = | = = | | using clause does not = 001 | | = = match dynamic0arameter | = specifications | = =5sing clause does not | 00(N)= = | | match target specifica- = | | = =4ions | = = | | = | | = =5sing clause required | 004 = = | | for dynamic parameters = | | = = | = = | | using clause required = 007 | | = = for result fields | = = | | = | | feature not supported = 0A = (no subclass) | 000 = = | | = | | = = multiple server4ransac- | 001 = tions = integrity constraint | (y>) | (no subclass) = 000 | | violation = = | = = | | = | | invalid authorization = 28 = (no subclass) | 000 = = specification | | = | | = = | = = invalid catalog name | 0Þ0¤0ë | (no subclass) = 000 | | = = | = = invalid character set | (ó) | (no subclass) = 000 | name | invalid condition number= 2 25 = (no subclass) | 000 = = | | = | Status codes 5 5(h*) X3H2-9(g()¬4/DBL CBR-00() 2(‘Ñ)1 SQLSTATE ________Table_(y>)-SQLSTATE_class_and_subclass_values_(Cont.)________ _Condition__________________Class_Subcondition_______________Subclass = invalid connection name | ^| | (no subclass) = 000 | | = = | = = invalid cursor name | 0Ö0Ã0·0§0ë | (no subclass) = 000 | | = = | = = invalid cursor state | (T ) | (no subclass) = 000 | | = = | = = invalid schema name | 0Þ0ë0¯ | (no subclass) = 000 | | = = | = = invalid SQL descriptor | 0Õ0£0ü0È | (no subclass) = 000 | name | invalid SQL statement = 26 = (no subclass) | 000 = = name | | = | | = = | = = invalid4ransaction | (ry) | (no subclass) = 000 | | state = = | = = | | = | | invalid transaction = 2D = (no subclass) | 000 = =4ermination | | = | | = = | = = no data | 02 | (no subclass) = 000 | | = = | = = Remote Database Access | HZ | (See!?SOgEC 9579-(N)for = | 4he definition of0ro- 4ocol subconditions and subclass code values) = successful completion | 00 | (no subclass) = 000 | | = = | = = syntax error or access | 42 | (no subclass) = 000 | | rule6iolation = = | = = | | = | | syntax error or access = 2A = (no subclass) | 000 = = rule violation in direct | | = | SQL statement = syntax error or ac- | 0Ú0½ | (no subclass) = 000 | | cess rule violation in = = | = = dynamic SQL statement | | = | | = = | = =4ransaction rollback | 40 | (no subclass) = 000 | | = = | = = | | integrity constraint = 002 | | = =6iolation | = | = = serialization failure | 001 = = | | = | | = = statement completion | 000µ0ó0Á0ü0à= unknown =4riggered data change | (y]) | (no subclass) = 000 | | violation = = | = = | | = | | warning = 01 = (no subclass) | 000 = = | | = | | = = cursor operation con- | 001 = flict 62(N) Database Language SQL X3H2-9(g()¬4/DBL CBR-00() 2(‘Ñ)1 SQLSTATE ________Table_(y>)-SQLSTATE_class_and_subclass_values_(Cont.)________ _Condition__________________Class_Subcondition_______________Subclass = | | disconnect error = 002 | | = = | = = | | implicit+ero-bit = 0SA | 0adding | = = insufficient item de- | 005 = = | | scriptor areas = | | = = | = = | | null6alue eliminated in= 003 | | = = set function | = = | | = | | = =0rivilege not granted | 007 = = | | = | | = =0rivilege not revoked | 006 = = | | = | | = =iuery expression too | 00A = long for information schema | = = search condition too | 009 = = | | long for information = | | = = schema | = = | | = | | = = string data, right | 004 = = | | truncation = | | = = | = =7ith check option6iola- | 44 | (no subclass) = 000 | |_tion_____________________|_____|__________________________|______| = | | = | | = = | = = | | = | Status codes 620ª0ü0à X0ß0¯0í0ó(g()92-154e¤BL CBR-002 (g ).2 SQLCODE (g ).2 SQLCODE Table (T ), "SQLCODE6alues", specifies the integer value returned in an SQLCODE parameter for each condition. The negative6alues that indicate exception conditions are implementation-defined. _____________________Table_24-SQLCODE_values______________________ Value__Condition__________________________________________________ | 0 = successful completion = = | | | +100= no data = = | | |_-n___|_exception_________________________________________________| = | | Note: SQLSTATE is4he0referred status parameter. The SQLCODE sta- 4us0arameter is a deprecated feature4hat is supported for compat- ibility with earlier6ersions of4his International Standard. See Annex D, "Deprecated features". 5 5(T ) Database Language SQL X0ß0¯0í0ó(g()92-154e¤BL CBR-002 (y>) Conformance (y>).1 Introduction This International Standard specifies conforming SQL language and conforming SQL-implementations. Conforming SQL language shall abide by4he BNF Format, associated Syntax Rules and Access Rules, definitions, and descriptions. A conforming SQL-implementation shall0rocess conforming SQL lan- guage according to4he associated General Rules, definitions, and descriptions. The object identifier for Database Language SQL is specified in Subclause 0Ô0¢0¹0È0ë4, "Object identifier for Database Language SQL". (y>).2 Claims of conformance Claims of conformance to4his International Standard shall state: 1) 2 2 2 2hich level of conformance is claimed: a) Full SQL (The complete database language specified in this !?nternational Standard.) b) Intermediate SQL (Intermediate SQL is a subset of Full SQL as specified in4he Leveling Rules.) c) Entry SQL (Entry SQL is a subset of Intermediate SQL as spec- ified in4he Leveling Rules.) (SA) 2 2 2 2hich of the following binding styles are supported: a) Module () b) Embedded syntax () c) Direct invocation and processing of SQL language () 0Î0Ã0È For4he binding styles module or embedded syntax,7hich of the following programming languages are supported: a) Ada b) C c) COBOL d) Fortran Conformance 5 5(ry) X3H2-9(g()¬4/DBL CBR-00() 20Ô0¢0¹0È0ë(N)Claims of conformance e) MUMPS f) Pascal g) PLg 2 2 2) The definitions for all elements and actions4hat this Standard specifies as implementation-defined. 20Ô0¢0¹0È0ë0µ0ó0Á0ü0à Extensions and options A conforming implementation may provide additional facilities or options not specified by4his International Standard. This may im- ply an implementation-defined extension of4he list of reserved 7ords () and4hereby may0revent0roper process- ing of some programs4hat otherwise meet4he requirements of4his !?nternational Standard. An implementation remains conforming even if it0rovides user op- tions to0rocess nonconforming SQL language or4o process conform- ing SQL language in a nonconforming manner. (y>).4 Flagger requirements Implementations that claim conformance only to Entry SQL may, but are not required to, provide an SQL Flagger (see Subclause 4.0Ö0Ã0·0§0ë, "SQL Flagger"). !?mplementations4hat claim conformance to!?ntermediate SQL shall 0rovide an SQL Flagger (see Subclause 2 2 2.34, "SQL Flagger") that supports4he following "level of flagging" options: - Entry SQL Flagging - !?ntermediate SQL Flagging and4he following "extent of checking" option: - Syntax Only !?mplementations4hat claim conformance to Full SQL shall provide an SQL Flagger (see Subclause 2 2 2.34, "SQL Flagger") that supports the following "level of flagging" options: - Entry SQL Flagging - !?ntermediate SQL Flagging - Full SQL Flagging and the following "extent of checking" options: - Syntax Only 5 5(Œ¡) Database Language SQL X0ß0¯0í0ó(g()92-154e¤BL CBR-002 (y>).4 Flagger requirements - Catalog Lookup 20Ô0¢0¹0È0ë5 Processing methods This International Standard does not define4he method by7hich an !!embedded SQL host program> is processed. Although the processing of!!embedded SQL host program> is defined in4erms of derivation of a0rogram compliant7ith a programming language standard and a !!module>, implementations of SQL are not constrained to follow that method, provided4hat effect is achieved. Although4he0rocessing of!!direct SQL statement> is defined in 4erms of calls to!!procedure>s in a!!module>, implementations of Direct Invocation are not constrained4o follow4hat method, so long as the same effect is achieved. Conformance 627 628 Database Language SQL X3H2-9(g()¬4/DBL CBR-00() Annex A (informative) Leveling4he SQL Language This Annex describes4he restrictions placed on conforming Intermediate SQL and Entry SQL language. A.1 !?ntermediate SQL Specifications 1) Subclause 5.2, " and!!separator>": a)!?n conforming!?ntermediate SQL language, a or a shall not comprise more than 18 s. b) A!!delimiter token> shall not be a or a . c) Conforming!?ntermediate SQL language shall contain no that ends in an . (SA) Subclause 5.3, "": a) An 4hat is a!!seconds fraction> shall not contain more4han 6 s. b) A or!!unsigned literal> shall not be a!!bit string literal> or a!!hex string literal>. c) A!!character string literal> shall not specify a . 2 2) Subclause 5.4, "Names and identifiers": a) Conforming!?ntermediate SQL language shall not contain any !!extended statement name> or . b) Conforming!?ntermediate SQL language shall not contain any !!collation name>. c) Conforming Intermediate SQL language shall not contain any explicit!!catalog name>. Leveling4he SQL Language 5 5(Nã) X3H2-9(g()¬4/DBL CBR-00() A.1!?ntermediate SQL Specifications d) Conforming!?ntermediate SQL language shall not contain any !!translation name> or!!form-af-use conversion name>. e) An!!identifier> shall not specify a . 2 2 2) Subclause 6.1, "": a) A shall not specify a
": a) A
shall not be a!!derived table>. 7) Subclause 5 5.5, "": a) If a!!general set function> specifies DISTINCT, then4he !!value expression> shall be a!!column reference>. 8) Subclause 6.6, "": a) A!!numeric value function> shall not be a!!position expres- sion>. b) A shall not contain a!!length ex- 0ression>4hat is a!!bit length expression>. 9) Subclause 5 5.7, "": a) A!!character value function> shall not be a!!fold>. b) Conforming Intermediate SQL language shall contain no!!char- acter translation>. c) Conforming!?ntermediate SQL language shall contain no . d) Conforming Intermediate SQL language shall contain no!!bit value function>. 10)Subclause 6.8, "": a) Conforming!?ntermediate SQL language shall contain no
": a) A!!table value constructor> shall contain exactly one!!row value constructor>4hat shall be of the form "()". b) A shall be4he!!query expression> of an . )Subclause 5 5 5.3, "
": a) If4he4able identified in4he!!from clause> is a grouped view, then4he!!table expression> shall not contain a , , or . 15)Subclause 7.4, "": a) A
shall not be a!!derived table>. b) If4he4able identified by!!table name> is a grouped6iew, 4hen the shall contain exactly one
. 16)Subclause 7.5, "": a) Conforming Intermediate SQL language shall contain no!!cross join>. b) Conforming Intermediate SQL language shall not specify UNION JOIN. )Subclause 5 5 5.7, "": a) Conforming Intermediate SQL language shall not contain any . )Subclause 5 5 5.9, "": a) The!!key word> DISTINCT shall not be specified more4han once in a , excluding any!!subquery> of4hat . Leveling4he SQL Language 5 50Ó0ë X3H2-9(g()¬4/DBL CBR-00() A.1!?ntermediate SQL Specifications b) If4he!!table expression> of4he!!query specification> is a grouped view, then4he!!select list> shall not contain a!!set function specification>. 19)Subclause 7.10, "": a) A shall not be a except in an!!insert statement>. b) Conforming Intermediate SQL shall contain no . (eå))Subclause 5 5 5.11, ",!!row subquery>, and!!table subquery>": a) The contained in a shall be a . 21)Subclause 8.1, "": a) A shall not be a!!match predicate>. (g ))Subclause 8.4, "": a) Conforming!?ntermediate SQL language shall not contain a !!value expression> in an that is not a . 20Î0Ã0ÈSubclause 8.10, "": a) Conforming Intermediate SQL language shall not contain any . 24)Subclause 8., "": a) A shall not specify a!!truth value>. (ry))Subclause 10.0Ñ0ü0Ä "": a) An 4hat specifies INSERT shall not contain a!!privi- lege column list>. (Œ¡))Subclause 10.5, "": a) Conforming Intermediate SQL language shall not contain any . (y]))Subclause 11.1, "": a) A shall not be an!!assertion definition>. b) Conforming Intermediate SQL language shall not contain any . c) Conforming!?ntermediate SQL language shall not contain any !!translation definition>. 5 50Õ0¡0é0Ã0É Database Language SQL X0ß0¯0í0ó(g()92-154e¤BL CBR-002 A.1 Intermediate SQL Specifications 28)Subclause .3, "
": a) Conforming!?ntermediate SQL language shall not specify??LOBAL TEMPORARY and shall not reference any global4emporary4able. (Nã))Subclause 11.4, "": a) A shall not be specified, but INITIALLY IMMEDIATE and NOT DEFERRABLE are implicit. b) Conforming Intermediate SQL language shall not contain any . 0Ô0³)Subclause 11.6, "
": a) A shall not be specified, but INITIALLY IMMEDIATE and NOT DEFERRABLE are implicit. 2 21)Subclause .8, "": a) A!!references specification> shall not specify MATCH. b) A!!referential triggered action> shall not contain an!!update rule>. 0Õ0¡0é0Ã0É)Subclause 11.9, "": a) The contained in a shall not contain a . b) The REFERENCES0rivilege is not required for!!check con- straint definition> access. 2 20Î0Ã0ÈSubclause .19, "": a) Conforming!?ntermediate SQL shall not contain any , but4he effect shall be4hat defined for a of CASCADED. 2 24)Subclause .21, "": a) Conforming!?ntermediate SQL language shall not contain any !!collate clause>. 2 25)Subclause .2(l4) "": a) Conforming Intermediate SQL language shall contain no!!alter domain statement>. 2 26)Subclause .20Ñ0ü0Ä "": a) Conforming!?ntermediate SQL language shall contain no . Leveling4he SQL Language 5 50Õ0£0ü0È X3H2-9(g()¬4/DBL CBR-00() A.1!?ntermediate SQL Specifications 0Ú0½)Subclause 11.(T ), "": a) Conforming!?ntermediate SQL language shall contain no . 0Ú0Ë0Ò)Subclause 11.(ry), "": a) Conforming!?ntermediate SQL language shall contain no . 0Ø0ë0Ä)Subclause 11.(Œ¡), "": a) Conforming Intermediate SQL language shall contain no!!drop domain constraint definition>. 40)Subclause 11.0Ô0³, "": a) Conforming!?ntermediate SQL language shall not contain any !!collation definition>. 2 2 21)Subclause .31, "": a) Conforming Intermediate SQL language shall not contain any . 42)Subclause 11.0Õ0¡0é0Ã0É, "": a) Conforming!?ntermediate SQL language shall contain no . 43)Subclause 11.0Õ0£0ü0È, "": a) Conforming!?ntermediate SQL language shall contain no . 44)Subclause 11.0Ö0Ã0·0§0ë, "": a) Conforming!?ntermediate SQL language shall not contain any !!assertion definition>. 2 2 25)Subclause .35, "": a) Conforming Intermediate SQL language shall not contain any . 46)Subclause 11.0Ø0¯0¿0ü0ë, "": a)!?n Conforming!?ntermediate SQL language, an!!object name> shall not specify COLLATION or TRANSLATION. 2 2 27)Subclause .1, "": a) A shall not contain a!!temporary table declaration>. 634 Database Language SQL X3H2-9(g()¬4/DBL CBR-00() A.1!?ntermediate SQL Specifications 48)Subclause 1(‘Ñ)0Ñ0ü0Ä "": a) A shall not specify a that is BIT or BIT VARYING. 49)Subclause 1(‘Ñ)5, "": a) An!!SQL transaction statement> shall not be a . b) An!!SQL schema statement> shall not be an . c) An!!SQL schema statement> shall not be a!!drop assertion statement>. d) An shall not be an statement. e) An shall not be a!!set schema state- ment>, a!!set catalog statement>, or a!!set names statement>. f) An!!SQL schema statement> shall not be a!!collation defini- tion>, a!!drop collation statement>, a!!translation defini- tion>, or a . g) An!!SQL dynamic statement shall not be a!!deallocate0repared statement>, or a!!describe input statement>. h) An shall not be an . 50)Subclause 10Ô0¢0¹0È0ë1, "": a) Conforming Intermediate SQL language shall not specify INSENSITIVE. b)!?f an!!updatability clause> of FOR UPDATE7ith or7ithout a!!column name list> is specified, then neither SCROLL nor ORDER BY shall be specified. 51)Subclause ª.3, "": a) A!!fetch statement> shall not contain a!!fetch orientation>. 52)Subclause 10Ô0¢0¹0È0ë5, "
. T shall not be a4able4hat is identified in4he!!from clause> of any contained in the referenced by4he!!cursor name>. Leveling the SQL Language 635 X0ß0¯0í0ó(g()92-154e¤BL CBR-002 A.1 Intermediate SQL Specifications 54)Subclause ª.7, "": a) Let T be4he4able identified by4he!!table name>. T shall not be a table that is identified in the of any !!subquery> contained in4he!!search condition>. 55)Subclause ª.8, "": a) The base4able4hat would be changed as a result of executing the shall not be identified in any generally contained in4he!!query expression>. 56)Subclause ª.9, "": a) Let T be4he4able identified by4he!!table name>. T shall not be a table that is identified in the of any !!subquery> contained in4he!!cursor specification> referenced by the . 57)Subclause ª.10, "": a) Let T be the table identified by the
. T shall not be a4able4hat is identified in4he!!from clause> of any contained in the or contained in4he!!value expression> of4he!!set clause>. 58)Subclause ª.11, "": a) Conforming!?ntermediate SQL language shall not contain any !!temporary table declaration>. 59)Subclause 14.(l4) "": a) Conforming Intermediate SQL language shall not contain any . 60)Subclause 15.1, "": a) Conforming!?ntermediate SQL language shall not contain any !!connect statement>. 61)Subclause 15.(l4) "": a) Conforming Intermediate SQL language shall not contain any . 62)Subclause 15.0Ñ0ü0Ä "": a) Conforming Intermediate SQL language shall not contain any . 63)Subclause 16.1, "": a) Conforming!?ntermediate SQL language shall not contain any !!set catalog statement>. 636 Database Language SQL X3H2-9(g()¬4/DBL CBR-00() A.1!?ntermediate SQL Specifications 64)Subclause 16.(l4) "": a) Conforming Intermediate SQL language shall not contain any . 65)Subclause 16.0Ñ0ü0Ä "": a) Conforming!?ntermediate SQL language shall not contain any !!set names statement>. 66)Subclause 17.(l4) "": a) An!!occurrences> and a!!descriptor name> shall be a . 5 57)Subclause .3, "": a) A!!descriptor name> shall be a . 5 58)Subclause .4, "": a) A shall be a!!literal>. 69)Subclause 17.5, "": a) A!!descriptor name> shall be a . 5 5 50)Subclause .6, "": a) A!!preparable SQL schema statement> shall not be an!!asser- 4ion definition> or a!!drop assertion statement>. b) A!!preparable SQL schema statement> shall not be a , a , a , or a!!drop4ranslation statement>. c) A!!preparable SQL session statement> shall not be a!!set schema statement>. d) A!!preparable SQL session statement> shall not be a!!set catalog statement>. e) A shall not be a . f) A!!preparable SQL4ransaction statement> shall not be a!!set constraints mode statement>. g) A!!preparable SQL data statement> shall not be a . 5 5 51)Subclause .7, "": a) Conforming Intermediate SQL language shall contain no!!deal- locate0repared statement>. Leveling the SQL Language 637 X0ß0¯0í0ó(g()92-154e¤BL CBR-002 A.1 Intermediate SQL Specifications 5 5 5(SA)Subclause .8, "": a) Conforming!?ntermediate SQL language shall not contain any !!describe input statement>. 5 5 50Î0Ã0ÈSubclause .9, "": a) A shall be a!!literal>. 74)Subclause 17.10, "": a) Conforming Intermediate SQL language shall contain no!!result 5sing clause>. 75)Subclause 17., "": a) Conforming!?ntermediate SQL language shall contain no 4hat specifies INSENSITIVE. b)!?f an!!updatability clause> of FOR UPDATE7ith or7ithout a!!column name list> is specified, then neither SCROLL nor ORDER BY shall be specified. 5 5 56)Subclause .10Ñ0ü0Ä "": a) Conforming!?ntermediate SQL language shall not contain any !!allocate cursor statement>. 77)Subclause 17.¬, "": a) A!!dynamic fetch statement> shall not contain a!!fetch orien- 4ation>. 78)Subclause 17., "": a) Let T be4he4able identified by4he!!table name>. T shall not be a table that is identified in the of any !!subquery> contained in4he!!cursor specification> referenced by the . 5 5 59)Subclause .18, "": a) Let T be the table identified by the
. T shall not be a4able4hat is identified in4he!!from clause> of any contained in the referenced by4he!!dynamic cursor name>. 80)Subclause 17., "": a) Conforming Intermediate SQL language shall contain no !!preparable dynamic delete statement:0ositioned>. 5 50Ú0Ë0Ò Database Language SQL X0ß0¯0í0ó(g()92-154e¤BL CBR-002 A.1 Intermediate SQL Specifications 81)Subclause .20, "": a) Conforming!?ntermediate SQL language shall contain no . 8(SA)Subclause .1, "": a) An shall not contain a!!temporary table declaration>. 83)Subclause 19.0Ñ0ü0Ä "": a) An shall not specify a bit string 6ariable. 84)Subclause .4, "": a) A shall not be a . 85)Subclause 19.5, "": a) A!!COBOL type specification> shall not be a!!COBOL bit type>. 86)Subclause .6, "": a) A shall not specify BIT. 87)Subclause 19.8, "": a) A shall not specify BIT or PACKED ARRAY [1..] OF BIT. 88)Subclause 19.9, "": a) A shall not specify BIT or BIT VARYING. 89)Subclause 20.1, "": a) A!!direct SQL data statement> shall not be a . b) An shall not be a!!set schema state- ment>, a!!set catalog statement>, or a!!set names statement>. c) An!!SQL transaction statement> shall not be a . d) An!!SQL schema statement> shall not be an or a . e) An!!SQL schema statement> shall not be a!!collation defini- tion>, a!!drop collation statement>, a!!translation defini- tion> or a!!drop4ranslation statement>. Leveling4he SQL Language 5 50Ø0ë0Ä X3H2-9(g()¬4/DBL CBR-00() A.1!?ntermediate SQL Specifications f) A shall not be an!!SQL connection statement>. 90)Subclause (h*).2, "Information Schema": a) Conforming!?ntermediate SQL language shall reference only the following Information Schema4ables: SCHEMATA, DOMAINS, TABLES, VIEWS, COLUMNS, TABLE_PRIVILEGES, COLUMN_PRIVILEGES, USAGE_PRIVILEGES, REFERENTIAL_CONSTRAINTS, CHECK_CONSTRAINTS, KEY_COLUMN_USAGE, ASSERTIONS, CHARACTER_SETS, COLLATIONS, VIEW_COLUMN_USAGE, CONSTRAINT_TABLE_USAGE, CONSTRAINT_COLUMN_ USAGE, SQL_LANGUAGES, COLUMN_DOMAIN_USAGE, and VIEW_TABLE_ USAGE. A.2 Entry SQL Specifications 1) All!?ntermediate SQL specifications are included as Entry SQL specifications. 2) Subclause 5.(l4) " and ": a) A shall not be a!!national character string literal>. b) An!!identifier body> shall contain no . 0Î0Ã0È Subclause 5.3, "": a) A!!literal> or shall not be a . b) A!!literal> or shall not be a or an!!interval literal>. 2 2 2) Subclause 5.4, "Names and identifiers": a) Conforming Entry SQL language shall not contain any ,!!SQL statement name>,!!dynamic cursor name>, or !!constraint name>. 5) Subclause 5 5.1, "": a) A!!character string4ype> shall not specify VARYING or VARCHAR. b) A!!data4ype> shall not be a or an . c) A!!data4ype> shall not be a nor specify CHARACTER SET. 5 540 Database Language SQL X0ß0¯0í0ó(g()92-154e¤BL CBR-002 A.2 Entry SQL Specifications 5 5) Subclause 6.(l4) " and ": a) A!!general value specification> shall not be a . b) A!!general value specification> shall not specify VALUE. c) A shall not specify SESSION_ USER, SYSTEM_USER, or CURRENT_USER. 5 5 5) Subclause 6.0Ñ0ü0Ä "
": a) A
shall not be a!!joined4able>. b) The optional AS shall not be specified. c) shall not be specified. 8) Subclause 5 5.5, "": a) If a!!general set function> specifies or implies ALL, then COUNT shall not be specified. b)!?f a specifies or implies ALL,4hen the shall include a!!column reference> that references a column of T. c)!?f the contains a 4hat is an outer reference,4hen the shall be a . d) No!!column reference> contained in a!!set function specifica- tion> shall reference a column derived from a 4hat generally contains a!!set function specification>. 9) Subclause 6.6, "": a) A!!numeric value function> shall not be a!!length expres- sion>. b) A shall not be an!!extract expres- sion>. 10)Subclause 6.7, "": a) A shall not be a . b) A shall not be a . 11)Subclause 6.8, "": a) Conforming Entry SQL language shall not contain any . Leveling4he SQL Language 5 541 X3H2-9(g()¬4/DBL CBR-00() A.2 Entry SQL Specifications 1(SA)Subclause 6.9, "": a) Conforming Entry SQL language shall not contain any . 10Î0Ã0ÈSubclause 6.10, "": a) Conforming Entry SQL language shall not contain any . )Subclause 5 5.11, "": a) A!!value expression> shall not be a!!datetime6alue expres- sion>. b) A shall not be an!!interval6alue expres- sion>. c) A shall not be a . d) A!!value expression0rimary> shall not be a!!cast specifica- tion>. e) A!!value expression0rimary> shall not be a!!scalar subquery> except when4he!!value expression0rimary> is simply con- 4ained in a!!value expression> that is simply contained in the second!!row value constructor> of a . ¬)Subclause 5 5.10Ñ0ü0Ä "": a) A shall not be a . 16)Subclause 6., "": a) Conforming Entry SQL language shall not contain any!!datetime 6alue expression>. )Subclause 5 5.15, "": a) Conforming Entry SQL language shall not contain any . 18)Subclause 7.1, "": a) A 4hat is contained in the that is contained in4he!!table value constructor> 4hat is contained in the of an!!insert statement> shall be a!!value specification>. b) A shall not specify DEFAULT. 5 542 Database Language SQL X0ß0¯0í0ó(g()92-154e¤BL CBR-002 A.2 Entry SQL Specifications 19)Subclause 7.5, "": a) Conforming Entry SQL language shall not contain any!!joined 4able>. 20)Subclause 7.6, "": a) A!!value expression> directly contained in the shall not include a reference4o a column derived from a function. (h*))Subclause 5 5 5.9, "": a) A!!query specification> is not updatable if4he!!where clause> of4he!!table expression> contains a!!subquery>. b) A!!select sublist> shall not specify ".*". 2(SA)Subclause 7.10, "": a) A shall not specify EXCEPT. b) A!!query term> shall not specify INTERSECT. c) A!!query primary> shall not contain a!!joined4able>. d) A!!query expression> shall not specify CORRESPONDING. e)!?f UNION is specified, then except for column names, the descriptions of the first and second operands shall be iden- 4ical and4he description of the result is identical to4he description of the operands. (y>))Subclause 5 5 5.11, ",!!row subquery>, and!!table subquery>": a) If a!!subquery> is contained in a , then4he!!table expression> in4he!!query specification> shall not contain a!!group by clause> or a and shall not identify a grouped6iew. 24)Subclause 8.1, "": a) Conforming Entry SQL language shall not contain any . b) Conforming Entry SQL language shall not contain any . (ry))Subclause 8.5, "": a) The shall be a!!column reference>. b) A!!pattern> shall be a . c) An shall be a . Leveling4he SQL Language 5 543 X3H2-9(g()¬4/DBL CBR-00() A.2 Entry SQL Specifications 26)Subclause 8.6, "": a) A!!row value constructor> shall be a . (y]))Subclause 8.9, "": a) Conforming Entry SQL language shall not contain any . (R´))Subclause 8.11, "": a) Conforming Entry SQL language shall not contain any!!overlaps 0redicate>. 29)Subclause 10.1, "": a) Conforming Entry SQL language shall not contain any . 0Ô0³)Subclause 10.(l4) "": a) Conforming Entry SQL language shall not contain a that specifies MUMPS. 0Ó0ë)Subclause 10.4, "": a) Conforming Entry SQL language shall not contain a . 2 2(SA)Subclause .1, "": a) A!!schema element> shall not be a!!domain definition>. b) A shall specify AUTHORIZATION and shall not specify a!!schema name>. c) A shall not be speci- fied. d) Conforming Intermediate SQL language shall not contain any . 0Õ0£0ü0È)Subclause 11.(l4) "": a) Conforming Entry SQL language shall not contain a . 2 24)Subclause .18, "": a) Conforming Entry SQL language shall not contain any!!drop 4able statement>. 2 25)Subclause .4, "": a) A!!column definition> shall not contain a!!domain name>. 644 Database Language SQL X3H2-9(g()¬4/DBL CBR-00() A.(N)Entry SQL Specifications b) A shall not contain a . c) Conforming Entry SQL language shall not contain any . 0Ø0¯0¿0ü0ë)Subclause 11.5, "": a) A!!default option> shall not specify CURRENT_DATE, CURRENT_ TIME, CURRENT_TIMESTAMP, SYSTEM_USER, SESSION_USER, or CURRENT_USER. 0Ú0½)Subclause 11.6, "
": a) Conforming Entry SQL language shall not contain any . 0Ú0Ë0Ò)Subclause 11.7, "": a)!?f PRIMARY KEY or UNIQUE is specified, then4he!!column defi- nition> for each column7hose!!column name> is in4he!!unique column list> shall specify NOT NULL. 0Ø0ë0Ä)Subclause 11.8, "": a) A shall not contain a . 40)Subclause 11.10, "": a) Conforming Entry SQL language shall not contain an . 2 2 21)Subclause .11, "": a) Conforming Entry SQL language shall not contain an!!add col- 5mn definition>. 42)Subclause 11., "": a) Conforming Entry SQL language shall not contain an . 2 2 20Î0Ã0ÈSubclause .10Ñ0ü0Ä "": a) Conforming Entry SQL language shall not contain a . 2 2 24)Subclause .14, "": a) Conforming Entry SQL language shall not contain a!!drop col- umn default clause>. 2 2 25)Subclause .15, "": a) Conforming Entry SQL language shall not contain a!!drop col- umn definition>. Leveling4he SQL Language 5 545 X3H2-9(g()¬4/DBL CBR-00() A.2 Entry SQL Specifications 2 2 26)Subclause .16, "": a) Conforming Entry SQL language shall not contain an!!add table constraint definition>. 47)Subclause 11., "": a) Conforming Entry SQL language shall not contain a . 48)Subclause 11., "": a) The!!query expression> in a!!view definition> shall be a . 2 2 29)Subclause .20, "": a) Conforming Entry SQL language shall not contain a . 50)Subclause .36, "": a) An!!object name> shall not specify TABLE. b) In Conforming Entry SQL language, an!!object name> shall not specify CHARACTER SET or DOMAIN. 51)Subclause 11.0Ú0½, "": a) Conforming Entry SQL language shall not contain a . 52)Subclause 11.(h*), "": a) Conforming Entry SQL language shall not contain any!!domain definition>. 53)Subclause 11.(y]), "": a) Conforming Entry SQL language shall not contain a!!drop do- main statement>. 54)Subclause 11.(R´), "": a) Conforming Entry SQL language shall not specify any . 55)Subclause 11.(Nã), "": a) Conforming Entry SQL language shall contain no!!drop charac- 4er set statement>. 56)Subclause .1, "": a) A shall be associated7ith an SQL-agent during its execution. An SQL-agent shall be associated with at most one !!module>. 5 546 Database Language SQL X0ß0¯0í0ó(g()92-154e¤BL CBR-002 A.2 Entry SQL Specifications b) A!!module contents> shall not be a . 57)Subclause 1(‘Ñ)(l4) "": a) A!!module character set specification> shall not be speci- fied. 58)Subclause 1(‘Ñ)0Ñ0ü0Ä "": a) A shall not specify a that is CHARACTER VARYING. 59)Subclause .5, "": a) An shall not be an . b) An!!SQL procedure statement> shall not be an!!SQL dynamic statement>. c) An!!SQL session statement> shall not be a or a . d) An shall not be a!!set transac- 4ion statement>. e) An!!SQL procedure statement> shall not be an!!SQL diagnostics statement>. 60)Subclause 10Ô0¢0¹0È0ë1, "": a) A!!declare cursor> shall not specify SCROLL. b) A shall not contain an . 5 51)Subclause ª.3, "": a) A!!fetch statement> shall not specify FROM. b)!?f the data4ype of4he4arget identified by the i-th!!target specification> in4he!!fetch target list> is an exact numeric 4ype,4hen the data4ype of4he i-th column of the table T shall be an exact numeric type. 62)Subclause 10Ô0¢0¹0È0ë5, "
": The of a constraint that does not specify a is implementation-dependent. 0Ø0ë0Ä)Subclause 11.8, "": The spe- cific6alue4o use for cascading among various values4hat are not distinct is implementation-dependent. 40)Subclause 11.(h*), "": The!!constraint name> of a constraint4hat does not specify a!!constraint name defini- tion> is implementation-dependent. 2 2 21)Subclause .1, "": If4he SQL-agent4hat performs a call of a!!procedure> in a is not a standard0rogram in the language specified in the of4he!!module>, 4hen the results are implementation-dependent. 5 570 Database Language SQL X0ß0¯0í0ó(g()92-154e¤BL CBR-002 2 2 2(SA)Subclause .1, "": If4he SQL-agent4hat performs a call of a!!procedure> in a is not a program that conforms to4he0rogramming language standard specified by the of4hat , then4he effect is implementation-dependent. 2 2 20Î0Ã0ÈSubclause .3, "": The!!procedure name> should be a standard-conforming procedure, function, or routine name of the language specified by the subject . Failure4o observe this recommendation will have implementation-dependent effects. 44)Subclause 1(‘Ñ)0Ñ0ü0Ä "": After the execution of4he last , if an5nrecoverable error has not occurred, and 4he SQL-agent did not4erminate5nexpectedly, and no constraint is not satisfied,4hen the choice of whether to0erform a!!com- mit statement> or a!!rollback statement> is implementation- dependent. The determination of7hether an SQL-agent has termi- nated5nexpectedly is implementation-dependent. 2 2 25)Subclause .3, "":!?f there are more4han one status 0arameter, then4he order in which values are assigned to4hese status parameters is implementation-dependent. 46)Subclause 10Ô0¢0¹0È0ë1, "":!?f a does not contain an!!order by clause>, then4he ordering of rows in4he4able associated with4hat is implementation-dependent. 47)Subclause 10Ô0¢0¹0È0ë1, "":!?f a con- tains an!!order by clause> and a group of two or more rows in the table associated7ith that!!declare cursor> contain val- 5es4hat are the null6alue or compare equal according to Subclause 8.2, "", in all columns spec- ified in the ,4hen the order in7hich rows in 4hat group are returned is implementation-dependent. 48)Subclause 10Ô0¢0¹0È0ë0Ñ0ü0Ä "": The order of assign- ment to4argets in the of6alues returned by a , other4han status0arameters, is implementation-dependent. 49)Subclause 10Ô0¢0¹0È0ë0Ñ0ü0Ä "": If an error occurs during assignment of a value to a4arget during4he execution of a ,4hen the values of targets other than status parameters are implementation-dependent. 50)Subclause ª.5, ". !?mplementation-dependent elements 671 X0ß0¯0í0ó(g()92-154e¤BL CBR-002 51)Subclause ª.5, " of values returned by a!!select statement: single row>, other4han status 0arameters, is implementation-dependent. 52)Subclause 10Ô0¢0¹0È0ë5, " column, if4he column name is implementation-dependent, then NAME is4he implementation-dependent name for4he column and UNNAMED is set4o 1. 57)Subclause .4, "": For a ,4he6alues of NAME and UNNAMED are implementation-dependent. 58)Subclause 17.5, "":!?tem descriptor area fields not relevant to4he data type of the item being de- scribed according4o the General Rules of Subclause 17.5, ""+"+ are set4o implementation-dependent 6alues. 59)Subclause .5, "": If an exception condition is raised in a!!set descriptor statement>,4hen the values of all elements of the descriptor specified in the are implementation-dependent. 5 50)Subclause .6, "": The6alidity of an value or a!!statement name> in an SQL- 4ransaction different from the one in7hich4he statement7as 0repared is implementation-dependent. 5 572 Database Language SQL X0ß0¯0í0ó(g()92-154e¤BL CBR-002 5 51)Subclause .9, "": When a!!describe output state- ment> is executed, the values of DATA and!?NDICATOR, as7ell as4he6alue of other fields not relevant to4he data type of the described item, are implementation-dependent. If4he col- umn name is implementation-dependent, then NAME is set4o that implementation-dependent name. 62)Subclause 17.9, "": 2 2 2 2hen a is used, the values for NAME, DATA, and!?NDICATOR, as7ell as4he6alue of other fields not relevant to4he data type of the described item, in4he SQL dynamic descriptor area structure are implementation-dependent. 5 50Î0Ã0ÈSubclause .1, "": The6alue of ROW_COUNT following the execution of an SQL-statement that does not directly result in4he execution of a , an!!insert statement>, or an!!update statement: searched> is implementation-dependent. 5 54)Subclause .1, "":!?f has a6alue other4han 1,4hen the association between 6alues and specific conditions raised dur- ing evaluation of the General Rules for that SQL-statement is implementation-dependent. 65)Subclause 19.1, "": The of4he implied!!module> derived from an is implementation-dependent. 5 56)Subclause .1, "": The!!module au- 4horization identifier> of the implied derived from an !!embedded SQL host program> is implementation-dependent. 67)Subclause 19.1, "": In each in the implied derived from an!!embedded SQL host program>, each!!embedded6ariable name> has been re- 0laced consistently7ith a distinct!!parameter name> that is implementation-dependent. 68)Subclause 19.1, "": The of each!!procedure> in the implied derived from an!!embedded SQL host program> is implementation-dependent. 69)Subclause 19.1, "": In each in4he implied!!module> derived from an , each has been re- placed consistently with a distinct 4hat is implementation-dependent. 5 5 50)Subclause .1, "": For!!SQL pro- cedure statement>s other than!!open statement>s, whether one in4he implied!!module> derived from an can correspond4o more4han one in4he!!embedded SQL host program> is implementation- dependent. 5 5 51)Subclause .1, "":!?n each!!proce- dure> in the implied derived from an!!embedded SQL host program>, the order of4he instances of is implementation-dependent. 5 5 5(SA)Subclause (eå).1, "": If an unrecoverable error has occurred, or if the direct invocation of SQL4ermi- nated unexpectedly, or if any constraint is not satisfied,4hen a is performed. Otherwise, the choice of which of4hese SQL-statements to0erform is implementation- dependent. The determination of whether a direct invocation of SQL has4erminated unexpectedly is implementation-dependent. 73)Subclause 20.(l4) "": !?f an!!order by clause> is not specified,4hen the ordering of rows in the table associated7ith that!!declare cursor> is implementation-dependent. 5 5 54)Subclause (eå).2, "": If an is specified and a group of two or more rows in the resulting table contain values4hat are the null 6alue or compare equal according to Subclause 8.2, "", in all columns specified in the ,4hen the order in7hich rows in4hat group are returned is implementation-dependent. 75)Subclause 21.0Ô0¢0¹0È0ë(y>), "CHARACTER_SETS base4able": The6alues of DEFAULT_COLLATE_SCHEMA, DEFAULT_COLLATE_CATALOG, and DEFAULT_ COLLATE_NAME for default collations specifying the order of characters in a repertoire are implementation-dependent. 674 Database Language SQL Annex D (informative) Deprecated features It is intended4hat the following features7ill be removed at a later date from a revised6ersion of this!?nternational Standard: 1) SQLCODE (SA)!!COBOL computational integer>s in!!embedded SQL COBOL0rogram>s. 0Î0Ã0È The!!unsigned integer> option of of . 4) The!!parameter declaration>s in a!!procedure>7ithout enclosing 0arentheses and7ithout commas separating multiple s. Deprecated features 675 676 Database Language SQL X3H2-9(g()¬4/DBL CBR-00() Annex E (informative) !?ncompatibilities7ith ISO/IEC 9075:1989 This!?nternational Standard introduces some incompatibilities 7ith the earlier version of Database Language SQL as specified in ISO/IEC 9075:1989. Unless specified in4his Annex, features and capabilities of Database Language SQL are compatible with4he earlier version of4his International Standard. 1)!?n Subclause 4., "Cursors"+"+ and Subclause 8.3, "", General Rule 2 2)a)iii) of!?SOgEC 9075:89, a requirement was made4hat multiple openings of an unordered cursor7ithin a single SQL-transaction return the rows in the same order every 4ime.!?n this!?nternational Standard,4he order of rows returned for an5nordered cursor is always implementation-dependent. (SA)!?n ISO/IEC 9075:1989,!!parameter name>s7ere simple!!identi- fier>s. In4his International Standard, colons are now required to delimit!!parameter name>s. 0Î0Ã0È!?n ISO/IEC 9075:1989,4he specification of the enforcement of 2 2 2 2ITH CHECK OPTION for a6iew was ambiguous. This International Standard clarifies4he intent of 2 2 2 2ITH CHECK OPTION. 4)!?n ISO/IEC 9075:1989,4he!!unique constraint definition> had no rule to0revent defining two unique constraints7ith identical unique column lists on a4able. This!?nternational Standard adds a Syntax Rule4o require that all5nique column lists be distinct. 5)!?n ISO/IEC 9075:1989,4here7ere no requirements that5sers have SELECT0rivileges on4ables that7ere referenced in contexts other4han
s,!!search condition>s, and s. 5 5) In!?SOgEC 9075:89, the specification of a6iew did not preclude4he0ossibility of defining a6iew in4erms of it- self. This!?nternational Standard adds a Syntax Rule in !?ncompatibilities7ith ISO/IEC 9075:1989 5 577 X3H2-9(g()¬4/DBL CBR-00() Subclause 11., "" to0reclude that0ossi- bility. 7)!?n ISO/IEC 9075:1989,4he specification did not0reclude the possibility of5sing outer references in!!set function specifi- cation>s in s contained in4he!!search condition> of a!!having clause>, but did not define4he semantics of such a construction. This International Standard adds a Syntax Rule in Subclause 5 5.5, "", and a Syntax Rule in Subclause 5 5 5.6, "", to0reclude that0ossibil- ity. 8)!?n ISO/IEC 9075:1989,4he!!module> derived from an had an implementor-defined!!module authorization identifier>. As4he4ime of binding7as not specified, this meant4hat the authorization identifier for0rivilege checking could be determined at either compile-time or run-time. In4his International Standard, the derived has no and the authorization identifier for 0rivilege checking is determined at run-time. 9) In!?SOgEC 9075:89, if a cursor is on or before a row and that row is deleted,4hen the cursor is positioned before the row that is immediately after the position of the deleted row.!?n this!?nternational Standard, if the deletion is not made4hrough 4hat cursor, then4he effect of4he deletion is implementation- dependent. 10)A number of additional s have been added4o the language. These s are: - ABSOLUTE - ACTION - ADD - ALLOCATE - ALTER - ARE - ASSERTION - AT - BETWEEN - BIT - BIT_LENGTH - BOTH - CASCADE 5 578 Database Language SQL X0ß0¯0í0ó(g()92-154e¤BL CBR-002 - 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 !?ncompatibilities7ith ISO/IEC 9075:1989 5 579 X3H2-9(g()¬4/DBL CBR-00() - DOMAIN - DROP - ELSE - END-EXEC - EXCEPT - EXCEPTION - EXECUTE - EXTERNAL - EXTRACT - FALSE - FIRST - FULL - GET -??LOBAL -?!OUR -!?DENTITY -!?MMEDIATE - INITIALLY -!?NNER - INPUT -!?NSENSITIVE - INTERSECT -!?NTERVAL -!?SOLATION - JOIN - LAST - LEADING - LEFT - LEVEL - LOCAL 680 Database Language SQL X3H2-9(g()¬4/DBL CBR-00() - 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 Incompatibilities with!?SOgEC 9075:89 681 X0ß0¯0í0ó(g()92-154e¤BL CBR-002 - 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 68(N) Database Language SQL X3H2-9(g()¬4/DBL CBR-00() - ZONE Incompatibilities with!?SOgEC 9075:89 680ª0ü0à 684 Database Language SQL X3H2-9(g()¬4/DBL CBR-00() Annex F (informative) Maintenance and interpretation of SQL ISO/IEC JTC10rovides formal0rocedures for revision, maintenance, and interpretation of JTC1 Standards. Section 6.ª of the JTC1 Directives, "Maintenanceuorrection of defects in JTC1 Standards"+"+ specifies procedures for creating and processing "defect reports". Defect reports may result in4echnical corrigendum, amendments, interpretations, or other commentary on an existing!?nternational Standard. In addition, SC21,4he JTC1 subcommittee4hat devel- oped4his International Standard, provides0rocedures for raising new "questions" about4opics related to existing SC(h*)0rojects. Questions may result in interpretations, new0roject0roposals, or possibly new defect reports. Since0ublication of ISO/IEC 9075:1989,4he following SC21 ques- 4ions have resulted in formal interpretations of Database Language SQL. The first number in parentheses identifies4he SC21 document in7hich4heiuestion was first raised, and the second number iden- 4ifies the SC(h*) document in7hich4he0roposed interpretation7as formally adopted. 1) Expression Evaluation (SC(h*) N5142, SC(h*) N5468) (SA) Read-Only Cursors (SC(h*) N5143, SC(h*) N5469) 0Î0Ã0È 2 2 2 2orking Viewed Tables (SC(h*) N5144, SC(h*) N5470) 4) Authorization!?d (SC21 N55, SC21 N5471) Since0ublication of ISO/IEC 9075:1989, several new defects have been discovered in the SQL language, leading to creation of4he following defect reports. 1)??eneral Clarifications, Defect Report 9075/5 (WG3 N50, N1­0) 2) General Clarifications, Defect Report 9075^þ (WG0µ0ó0Á0ü0àN1­1) The SQL language corrections proposed in each defect report7ere accepted by SC21/WG0µ0ó0Á0ü0àin May 1991 (see SC21 N6(T )9, Arles 2 2 2 2G3 Resolutions). Further processing7ithin SC(h*)7as superseded by adoption of ISO/IEC 9075:199(N)as a replacement standard for ISO/IEC Maintenance and interpretation of SQL 685 X0ß0¯0í0ó(g()92-154e¤BL CBR-002 9075:89. All corrections to SQL0roposed by4hese defect reports are included in4his International Standard. Potential new questions or new defect reports addressing4he spec- ifications of this!?nternational Standard should be communicated to: Secretariat, ISO/IEC JTC1lC21/WG0ª0ü0à Standards Council of Canada Ottawa, Ontario Canada. 686 Database Language SQL !?ndex . . . , 8 a completion condition is !B 8 raised, 10 =, (g ), (y]) ACTION, 84, (y])4, 276, 590, ::=, 5 5 5 591, 592, 678 !!87>, 16 , 64, (T )5, 246, !!89>, 16 2 2(Nã), 0Õ0£0ü0È0, 2 20Õ0¡0é0Ã0É, 0Õ0£0ü0È0Ñ0ü0Ä 2 20Ú0Ë0Ò, !!92>, 16, 17 5 50Õ0¡0é0Ã0É < >, 5 5 5 !!action list>, (T )5 [ ], 8 , 98 "(, 8 Ada, 2 2, 49, 61, 0Ö0Ã0·0§0ë(l4) 2 244, =, 8 2 252, 0Õ0é0ó6, 2 257, 489, 2 2 290, - A - 491, 2 2 293, 495, 2 2 298, 500, abandoned, 2 20Ø0¯0¿0ü0ë, 0Õ0£0ü0È7, 2 20Ú0Ë0Ò 501, 502, 500Ñ0ü0Ä 5 5, 625, ABSOLUTE, 84, 0Ú0½7, 2 278, 639, 5 551, 661 0Ú0½9, 5 578 ADA, 80Ñ0ü0Ä 243, 0Ö0Ã0·0§0ë4, 2 252, access mode, 67, 74, 0Õ0é0ó0, 2 262, 490Ñ0ü0Ä 5 5ª, 614 0Ú0Ë0Ò4, 2 286, 0Ú0Ë0Ò9, 2 292, 0Ø0ë0Ä4, , 2 2 200, 528 500 Access Rules, 9, 10, , , 2 2 290, ª, ¬, 0Ú0Ë0Ò, 64, 77, (R´)9, 500, 501 (Nã)0, 292, (Nã)4, 2 200, 0Ó0ë0, , 500, 0Ó0ë0Ñ0ü0Ä 2 2, 0Õ0¡0é0Ã0É0Ñ0ü0Ä 2 20Ô0³, 0Õ0£0ü0È1, 501 2 20Õ0¡0é0Ã0É, 0Õ0£0ü0È8, 2 275, 0Ø0ë0Ä8, 2 2 243, !!Ada qualified type 2 2 262, 467, 2 2 272, 475, 2 2 276, specification>, 500, 2 2 277, 525, 5(Œ¡), 625, 5 565, 501, 503, 651 677 , 500, 502 !?ndex 1 , specification>, 500 (Œ¡)6, 283, (R´)6, 287, (R´)8, !!Ada variable definition>, 5 545 490, 500, 501, 502, 639 , 2 204 ADD, 84, (R´)4, 291, 0Ô0³7, , 2 210, 678 52, (R´)1, 2 204, 0Ô0³5, 2 20, , 0Ô0³7, 2 2SA, 0Õ0£0ü0È8, 2 268, 48(l4) (R´)0Ñ0ü0Ä 284, (R´)5, 5 545 5 50Õ0£0ü0È !!add domain constraint , (R´)0ª0ü0à definition>, 0Ô0³4, 2 207, !!alter table statement>, 5 50Ö0Ã0·0§0ë 52, (Œ¡)(l4) 263, (Œ¡)5, 272, Additional common elements, (y])4, 281, (R´)0Ñ0ü0Ä 284, (R´)6, (y>)9 289, (Nã)1, 292, 0Õ0£0ü0È8, 2 268, , 272, (R´)0Ñ0ü0Ä ambiguous cursor name, 2 2 243, 291, 0Ó0ë0, 586, 646, 5 565 46(l4) 5 5 AFTER, 85 , 5 5 59, 80, 2 2 289, ALIAS, 85 491 ALL, 84, 1(T ), 6, 176, AND, 84, (h*)1, 2(R´), (g )9, 0Ñ0ü0Ä 184, 6, 197, (eå)0, 20Ô0³, (y])(l4) 50Ú0Ë0Ò, 539, 542, 201, (eå)(l4) 2(eå), (T )5, 246, 540Ñ0ü0Ä 544, 545, 546, 547, (Nã)4, 2 200, 0Õ0£0ü0È(l4) 2 20Ú0Ë0Ò, 401, 548, 549, 550, 551, 552, 2 2 202, 400Ñ0ü0Ä 2 2 2, 586, 5 5­, 550Ñ0ü0Ä 554, 555, 556, 557, 641, 5 572 558, 559, 561, 56(l4) 570, , 2(eå) 571, 580, 581, 5 5, 610Ñ0ü0Ä ALLOCATE, 84, 2 2 20Ó0ë, 465, 5 5, 618 2 2 282, 678 an exception condition is !!allocate cursor statement> raised, 10 , 2 2 29, 50Ñ0ü0Ä 55, 57, 58, ANSI/IEEE 5 5 570r;0Ô0¢0¹0È0ë­0, 5 59, 62, 104, 2 269, 447, ANSIgEEE 770/X3.97, 5 449, 2 2 265, 466, 2 2 269, 476, ANSIkyDC X.1, 515 2 2 277, 48(l4) 5 50Õ0é0ó, 638 ANSI/MIL-STD-¬A, 2 2, 501 , 54, 60, 5 5 56, 85, 5 577, 678 5 5(l4) 104, 0Ø0¯0¿0ü0ë9, 2 2 20Ó0ë, 48(N) ANSI X3.159, 505 ALTER, 84, 283, (R´)6, 292, ANSI X3.198, 51() 2 204, 0Ó0ë0, 2 20Ú0Ë0Ò, 48(l4) 5 578 ANSI X3.20Ñ0ü0Ä 2 2, 509 , 286 ANSI X3.50Ñ0ü0Ä 2 2, 521 ANSI X3.9, 51() 2 Database Language SQL ANY, 84, 2, (g )0, 571, AS, 84, 1, 0, 1(g ), 4, 570Ñ0ü0Ä 580, 580Ñ0ü0Ä 584, 585, 146, 7, 169, 0, 182, 586, 591, 595, 596, 5 50, 1, 202, (eå)9, 296, (Nã)8, 608, 5 510, 611 2 201, 0Ó0ë1, 2 262, 0Ø0¯0¿0ü0ë0Ñ0ü0Ä 2 264, applicable, 66, 9, 1(g ), 0Ø0¯0¿0ü0ë5, 2 266, 407, 2 2 246, 456, ª5, 145, (T )6, 249, (ry)1, 2 2 257, 458, 50Ú0Ë0Ò, 539, 541, 264, (y])6, 282, (Nã)8, 2 202, 54(l4) 543, 544, 545, 546, 0Ô0³4, 2 210, 0Ó0ë(l4) 2 2­, 0Õ0¡0é0Ã0É1, 547, 548, 549, 550, 551, 2 2(Œ¡), 0Õ0¡0é0Ã0É9, 2 20Ú0½, 0Ú0½0Ñ0ü0Ä 2 284, 55(l4) 553, 554, 555, 556, 0Ú0Ë0Ò6, 2 289, 0Ø0ë0Ä(l4) 2 294, 45(l4) 557, 558, 559, 561, 562, 2 2 253, 454, 2 2 255, 490Ñ0ü0Ä 50Ó0ë, 560Ñ0ü0Ä 564, 565, 586, 616, 57(N) 5 5, 641 applicable0rivileges, 5 56, ASC, 84, 0Ú0½1, 50Ó0ë 9, 1(g ), ª5, 145, (T )6, , 191, (l4) 5 570 (T )9, 251, (Œ¡)4, 276, (R´)(l4) assertion, 2 2 20ª0ü0à 298, 0Ô0³(l4) 2 210, 0Ó0ë(l4) 2 2­, ASSERTION, 84, (ry)9, 2 2(ry), 2 2(h*), 0Õ0¡0é0Ã0É6, 2 2(Nã), 0Õ0£0ü0È7, 2 284, 0Õ0¡0é0Ã0É8, 2 20Ú0Ë0Ò, 48(l4) 50Ú0½, 617, 0Ú0Ë0Ò6, 2 289, 0Ø0ë0Ä(l4) 2 294 5 5, 678 application program, 2, 77 !!assertion check>, 0Õ0¡0é0Ã0É5 , 5(l4) literal>, 90, 94, 95, 255, (ry)7, 2 2(ry), 0Õ0¡0é0Ã0É6, 2 268, 148, ¬0 48(l4) 593, 594, 5 50Õ0¡0é0Ã0É, 634, !!approximate numeric type>, 5 50Õ0é0ó, 637, 5 50Ø0ë0Ä (Nã), 107, 1SA, 0, 2 2 253, assertion descriptor, 40, 2 2 254, 658 43, 44, 0Ô0³0, 2 2(Œ¡), 0Õ0£0ü0È7, approximate numeric6alue, 2 20Ú0Ë0Ò, 598 28 Assertions, 2 2 20ª0ü0à , 16 ASSERTIONS base table, 598 ARE, 84, 0Ö0Ã0·0§0ë4, 2 2 290, 678 Assertions on the base !!argument>, 2 2 251, 455, 2 2 256, 4ables, 5 5­ 457, 2 2 260 ASSERTIONS6iew, 553 ASSERTIONS_DEFERRED_CHECK, 598 ASSERTIONS_FOREIGN_KEY_ CHECK_CONSTRAINTS, 598 !?ndex 0ª0ü0à ASSERTIONS_FOREIGN_KEY_ BETWEEN, 84, (h*)1, 5 578 SCHEMATA, 598 , 205, ASSERTIONS_INITIALLY_ (h*)1, 2 2 244, 446 DEFERRED_NOT_NULL, 598 BIT, , 0Õ0é0ó, 84, 107, 1SD, ASSERTIONS_IS_DEFERRABLE_ 0Õ0é0ó1, 2 252, 0Õ0é0ó6, 2 257, 0Õ0é0ó8, NOT_NULL, 598 2 259, 0Ø0¯0¿0ü0ë0, 2 261, 0Ø0¯0¿0ü0ë(l4) 2 263, ASSERTIONS_PRIMARY_KEY, 598 0Ø0¯0¿0ü0ë4, 2 266, 425, 2 2 2(Nã), 440, assignable, 5, 0Ö0Ã0·0§0ë, 0Õ0é0ó, (y>)1 2 2 245, 500, 502, 505, 50, , 79, 80, 4, 507, 510, 51(l4) 5ª, 514, ¬7, 158, ­8, 191, 51(N) 5, 518, 5, 520, 5(g ), ASYNC, 85 AT, 84, ­5, 166, 678 520Ñ0ü0Ä 570, 635, 5 50Ø0ë0Ä, 678 AUTHORIZATION, 84, 255, !!bit>, 89, 90, 92 (ry)7, 2 241, 0Ö0Ã0·0§0ë0Ñ0ü0Ä 2 2 2(eå), 484, , 27, 535, 567, 644 160, ­(l4) 163 !!authorization identifier>, , ­0, 162, ­0ª0ü0à 2 2 24, 2 2 26, 5 54, 5 55, 5 56, 5 5 5(l4) !!bit length expression>, 5 5 50Ñ0ü0Ä 98, 102, 100Ñ0ü0Ä 1­, 8, 10Ó0ë, 630 245, (T )6, 255, (ry)6, 258, !!bit primary>, ­0, 161, 260, (Œ¡)1, 283, (R´)9, 290, ­0ª0ü0à 294, (Nã)7, 298, 0Ô0³0, 2 202, bit string, 26 Bit string comparison and 0Ô0³4, 2 2SD, 0Ó0ë0, 2 2, 0Ó0ë0Ñ0ü0Ä assignment, 27 2 2­, 0Ó0ë8, 2 2(h*), 0Õ0¡0é0Ã0É0Ñ0ü0Ä 2 2(Œ¡), bit string data4ype 2 2(R´), 0Õ0¡0é0Ã0É9, 2 20Ô0³, 0Õ0£0ü0È1, 2 20Õ0¡0é0Ã0É, descriptor, (Œ¡) 0Õ0£0ü0È0Ñ0ü0Ä 2 20Ø0¯0¿0ü0ë, 0Ö0Ã0·0§0ë1, 2 242, 0Ö0Ã0·0§0ë8, , 82, 2 297, 0Ø0ë0Ä8, 2 2 207, 409, 2 2 2(eå), 86, 89, 92, 93, 95, 97, 2 2 2(h*), 487, 5(Œ¡), 568, 5 500, (Œ¡)6, 267, 629 5 501, 600Ñ0ü0Ä 5 505, 655, 5 557, Bit strings, (Œ¡) 660Ñ0ü0Ä 5 569 , 107, AVG, 84, 1(T ), 5, 1(Œ¡), 659 109, 1ª, 450Ñ0ü0Ä 2 2 254, 630 bit string variable, (y]) - B - , Backus Naur Form, 7 (y]), ª0Ñ0ü0Ä 10Ö0Ã0·0§0ë, ª7 Backus Normal Form, 7 !!bit value expression>, !!89 base>, ­ 10Õ0£0ü0È, ª4, 10Ú0½, ­0, 162, base4able, 45 ­0Ñ0ü0Ä 5 50Ó0ë base table descriptor, 0Ø0ë0Ä , ª(l4) BEFORE, 85 10Ú0½, 630 BEGIN, 84, 2 2 290 4 Database Language SQL BIT_LENGTH, 84, 1(R´), ª1, CARDINAL_NUMBER_DOMAIN_ 148, ¬1, 152, 445, 507, CHECK, 565 678 , BNF, 7 504, 505, 50, 507 BOOLEAN, 85 CASCADE, 84, (ry)8, 274, (y])7, !!boolean factor>, 2 26, 2(Nã) 278, (y])9, 289, (Nã)0, 292, , 2(Nã) (Nã)4, 2 200, 0Ó0ë0, 2 2ª, 0Ó0ë8, !!boolean term>, 2(Nã) 2 2(y>), 0Õ0£0ü0È7, 2 20Ú0Ë0Ò, 590, 591, , (g )9, 20Ô0³, 59(l4) 5 578 63(N) CASCADED, 40, 84, (Nã)6, 297, BOTH, 84, ª(l4) 10Ö0Ã0·0§0ë, ª6, (Nã)9, 578, 579, 5 50Õ0£0ü0È, 679 152, ¬0Ñ0ü0Ä 154, 407, 2 2 2SA, CASE, 5 5 56, 84, 141, (l4) 415, 2 2 2, 419, 2 2 2(eå), 431, 543, 544, 5 579 447, 2 2 265, 678 , 141 BREADTH, 85 , 26, 141, BY, 84, 7, 196, 0Ú0½1, 2 272, 0Ñ0ü0Ä 155, ¬6, 20Ú0½, 64() 2 274, 464, 50Ô0³, 616, 5 5, !!case operand>, 141, () 5 50Õ0é0ó, 638 !!case specification>, 141, - C - 142, 0Ñ0ü0Ä 2 2 244, 446 C, 2 2, 49, 61, 83, (T )0Ñ0ü0Ä 2 257, CAST, 2 25, 84, 144, 6, 0Õ0é0ó8, 2 262, 0Ø0¯0¿0ü0ë0Ñ0ü0Ä 2 2 252, 454, 147, ­9, 170, (l4) 202, 2 2 289, 490, 2 2 291, 490Ñ0ü0Ä 2 2 295, (eå)9, 2 253, 0Ø0¯0¿0ü0ë(l4) 2 263, 0Ø0¯0¿0ü0ë4, 498, 504, 505, 50, 507, 2 265, 0Ø0¯0¿0ü0ë6, 2 2 246, 456, 2 2 257, 5 5ª, 614, 5 5(ry), 639, 5 551, 458, 5 579 661, 5 564 , 4, 145 calendar, 5 , 43, CALL, 85 49, 4, 145, 6, 147, Calls to a!!procedure>, 0Õ0é0ó(N) ¬4, 155, ¬6, 2 2 256, 457, cardinality, 5, 2 27, 1(ry), 2 2 258, 64() 1(Œ¡), 4, 178, 1, 194, !!cast4arget>, 4 203, (g )(l4) 2 282, 485, 50Ú0½, catalog, 45, 46 589, 5 571 CATALOG, 84, 2 2 2¬, 417, 2 2 284, cardinality violation, 203, 679 2 282, 620 !!catalog name>, 15, 2 2 24, 2 2 25, CARDINAL_NUMBER, 565, 570, 5 54, 98, 101, 10(l4) 104, 580, 588, 5 50 (ry)6, 258, 0Ö0Ã0·0§0ë1, 2 2 2¬, 417, CARDINAL_NUMBER domain, 565 2 2 286, 487, 5 5(Nã), 654, 5 557, 5 561 !?ndex 5 Catalogs, 45 !!character factor>, 160, CATALOG_NAME, 83, 480, 2 2 281, ­1, 162 486, 2 2 287, 536, 50Ú0Ë0Ò, 539, Characteristics of numbers, 541, 54(l4) 543, 544, 545, (R´) 546, 547, 548, 549, 550, character not in repertoire 551, 55(l4) 553, 554, 555, , 1, 5 5(eå) 556, 557, 558, 559, 561, , 160, 562, 569, 571, 570Ñ0ü0Ä 580, ­() 583, 584, 585, 586, 591, character repertoire, 5, 7, 595, 596, 606, 5 5SA, 610, 20, 21, 20Ñ0ü0Ä 24, 2 25, 2 2 26, 611 5 5 54, 85, 86, 9(l4) 90Ñ0ü0Ä 100, , 504, 505, 109, 1, 9, 10Õ0£0ü0È, ª4, 507, 5 50Ø0ë0Ä 10Ø0¯0¿0ü0ë, 5, 160, (eå)8, 20Ú0½, , (T )8, 249, (ry)0, 266, 0Ó0ë(l4) 504, 505, 506, 507, 664 2 2¬, 0Ó0ë6, 50, 607, 5 560, , 504 669 , 504, !!character representation>, 507, 5 50Ø0ë0Ä, 651 88, 89, 9(l4) 90Ñ0ü0Ä 95, 97, CHAR, 84, 107, 108, 2 256, 2­, 500, 501, 505, 50, 2 260, 0Ø0¯0¿0ü0ë1, 500, 501, 502, 508, 5SD, 520, 5(h*), 629 5, 518, 5, 520, 5(g ), !!character set definition>, 664 5(l4) 255, (ry)7, 2 2, 0Ó0ë(l4) character, 5 2 2(y>), 0Ø0¯0¿0ü0ë8, 2 2 282, 644, 5 546 CHARACTER, , (eå), (h*), 0Õ0é0ó, character set descriptor, 2 2 29, 84, 107, 108, 1SD, (h*), 44, (ry)0, 2 2, 0Ó0ë(l4) 0Ñ0ü0Ä 248, (ry)5, 259, (Œ¡)0Ñ0ü0Ä 2 2, 606 2 201, 0Ó0ë1, 2 2ª, 0Õ0¡0é0Ã0É9, 2 20Õ0¡0é0Ã0É, !!character set name>, 2 2 24, 0Õ0é0ó1, 2 252, 0Õ0é0ó6, 2 257, 0Õ0é0ó8, 90Ñ0ü0Ä 99, 103, 104, 105, 2 259, 0Ø0¯0¿0ü0ë0, 2 261, 0Ø0¯0¿0ü0ë(l4) 2 263, 108, 248, (T )9, 259, 0Ô0³(l4) 0Ø0¯0¿0ü0ë4, 2 265, 0Ø0¯0¿0ü0ë6, 2 267, 426, 2 2, 0Ó0ë(l4) 2 2ª, 0Ó0ë6, 2 2(h*), 2 2 2(Nã), 440, 2 2 245, 447, 2 2 282, 0Õ0¡0é0Ã0É9, 2 20Ó0ë, 0Õ0£0ü0È0Ñ0ü0Ä 2 2 2, 45(l4) 480Ñ0ü0Ä 500, 501, 504, 505, 2 2 254, 656, 5 557 506, 5SA, 509, 510, 51(l4) , 0Ó0ë1 510Ñ0ü0Ä 5­, 517, 5, 520, 521, 5(g ), 520Ñ0ü0Ä 564, 570, 604, 5 505, 640, 5 546, 647, 651, 5 553, 657, 5 558, 664 6 Database Language SQL !!character set specifica- , 85, 86, 87, 89, expression>, (y>), (T ), 9(l4) 90Ñ0ü0Ä 97, 98, 100, 8, 1(Nã), ª0, 10Õ0¡0é0Ã0É, ª0Ñ0ü0Ä 105, 107, 109, 248, (T )9, 10Õ0é0ó, ª6, 160, ­1, 162, 250, (ry)5, 256, (Œ¡)0Ñ0ü0Ä 2 201, ­4, 2, 444, 5 542 0Ó0ë4, 2 2(eå), 0Õ0£0ü0È1, 2 20Õ0é0ó, 0Ö0Ã0·0§0ë4, , 2 2 2(Œ¡), 490, 500, 501, 503, ª(l4) 10Ú0½, ª8, 5 50Ô0³, 641 504, 506, 507, 508, 510, CHARACTER_DATA, 564, 570, 511, 5, 510Ñ0ü0Ä 5, 517, 573, 574, 576, 578, 580, 5, 519, 5(eå), 521, 5(y>), 585, 590, 590Ñ0ü0Ä 598, 600, 629, 5 50Ô0³, 644, 5 551, 660, 5 502, 604, 5 5SA, 61() 5 563, 664 CHARACTER_DATA domain, 564 character string, (eå) CHARACTER_LENGTH, 84, 1(R´), character string data type ¬1, 2 2 245, 679 descriptor, 20 CHARACTER_MAXIMUM_LENGTH, !!character string literal>, 50Ø0ë0Ä, 544, 570, 571, 572 73, 82, 86, 87, 89, 92, CHARACTER_OCTET_LENGTH, 90Ñ0ü0Ä 95, 97, 100, (Œ¡)6, 539, 544, 570, 571, 57() 2 2 2, 629, 5 556 CHARACTER_SETS, 554, 604, character strings, 6 5 50, 608, 5 5, 640 Character strings, 20 CHARACTER_SETS base4able, Character strings and 606 collating sequences, CHARACTER_SETS view, 554 20 CHARACTER_SETS_CHECK_ !!character string4ype>, REFERENCES_COLLATIONS, 107, 108, 1SD, 0Ñ0ü0Ä 263, 606 2 201, 45(l4) 2 2 254, 640, 5 558 CHARACTER_SETS_DEFAULT_ !!character substring COLLATE_CATALOG_NOT_ function>, (g ), (y]), ª(l4) NULL, 606 10Õ0£0ü0È, ª5, 10Ú0½, 444, 5 541 CHARACTER_SETS_DEFAULT_ !!character translation>, COLLATE_NAME_NOT_NULL, 2(l4) 10Õ0¡0é0Ã0É, ª4, 10Ø0¯0¿0ü0ë, ª7, 606 2 2 244, 630, 5 559 CHARACTER_SETS_DEFAULT_ COLLATE_SCHEMA_NOT_NULL, 606 CHARACTER_SETS_FOREIGN_KEY_ SCHEMATA, 5 50 !?ndex 7 CHARACTER_SETS_PRIMARY_KEY, !!check constraint 606 definition>, (Œ¡)(l4) 264, CHARACTER_SET_CATALOG, 80Ñ0ü0Ä (y])0, 271, (R´)1, 282, 0Ô0³1, 426, 2 2 2(y]), 428, 2 2 20Ö0Ã0·0§0ë, 436, 2 2SD, 590Ñ0ü0Ä 594, 630ª0ü0à 2 2 20Ø0ë0Ä, 440, 2 2 241, 45(l4) 2 2 254, Checking of constraints, 41 456, 2 2 257, 538, 50Ø0ë0Ä, 544, CHECK_CLAUSE, 551, 593, 594 554, 555, 556, 569, 5 504, CHECK_COLUMN_USAGE, 559, 5 50, 607, 5 5SA, 609, 5 510, 561, 596 611, 5 563 CHECK_COLUMN_USAGE base CHARACTER_SET_NAME, 83, table, 596 0Õ0é0ó4, 2 2 2(Œ¡), 427, 2 2 2(R´), 434, CHECK_COLUMN_USAGE_CHECK_ 2 2 20Ø0¯0¿0ü0ë, 439, 2 2 240, 441, 2 2 252, REFERENCES_COLUMNS, 596 2 2 254, 456, 2 2 257, 538, 50Ø0ë0Ä, CHECK_COLUMN_USAGE_FOREIGN_ 544, 554, 555, 556, 569, KEY_CHECK_CONSTRAINTS, 5 504, 606, 5 507, 608, 5 5SD, 596 CHECK_COLUMN_USAGE_PRIMARY_ 610, 5 5, 660µ0ó0Á0ü0à KEY, 596 CHARACTER_SET_SCHEMA, 83, CHECK_CONSTRAINTS, 551, 426, 2 2 2(y]), 428, 2 2 20Ö0Ã0·0§0ë, 436, 574, 586, 593, 594, 595, 2 2 20Ø0ë0Ä, 440, 2 2 241, 45(l4) 2 2 254, 596, 598, 640 2 2 256, 457, 50Ú0Ë0Ò, 539, 544, CHECK_CONSTRAINTS base 554, 555, 556, 569, 5 504, table, 593 606, 5 507, 608, 5 5SD, 610, CHECK_CONSTRAINTS view, 551 5 5, 660µ0ó0Á0ü0à CHECK_CONSTRAINTS_PRIMARY_ , KEY, 593 8, 10Ô0³ CHECK_CONSTRAINTS_SOURCE_ CHAR_LENGTH, 84, 1(R´), 679 CHECK, 593 CHECK, 40, 75, 84, (Œ¡)4, CHECK_OPTION, 0Õ0é0ó6, 543, 281, (Nã)6, 297, (Nã)9, 2 2(ry), 578, 579 0Ú0Ë0Ò9, 2 293, 0Ø0ë0Ä5, 2 2 287, 537, CHECK_OPTION_CHECK, 578 565, 570, 571, 57(l4) 573, CHECK_OPTION_NOT_NULL, 578 574, 576, 578, 579, 580, CHECK_TABLE_IN_COLUMNS, 576 CHECK_TABLE_USAGE, 595 580Ñ0ü0Ä 584, 585, 586, 587, CHECK_TABLE_USAGE base 588, 590, 591, 593, 595, 4able, 595 596, 598, 5 500, 60(l4) 5 504, CHECK_TABLE_USAGE_CHECK_ 5 50, 608, 5 510, 611, 5 5, REFERENCES_TABLES, 595 5 5ª, 616, 5 5, 618, 5 577 8 Database Language SQL CHECK_TABLE_USAGE_FOREIGN_ , KEY_CHECK_CONSTRAINTS, 508, 5SD, 510, 5, 651, 595 5 564 CHECK_TABLE_USAGE_PRIMARY_ , 5SA, 510, !!C host identifier>, 490, 5 575 504, 505, 506, 507 , !!C initial value>, 504, 2 2 290, 508, 5SD 505, 50 , 508, Claims of conformance, 625 5 551 Classes of SQL-statements, , 5SA 51 CLASS_ORIGIN, 83, 84, 479, , 508 2 2 281, 485, 5 563 !!COBOL numeric type>, 5SA, Client-server operation, 5 5 54 510 CLOSE, 84, 2 281, 400Ñ0ü0Ä 2 2 205, !!COBOL type specification>, 471, 2 2 282, 480µ0ó0Á0ü0à 5SA, 510, 5, 639, 5 564 !!close statement>, 50, 53, 55, 57, 58, 59, 2 268, , 490, 5SA, 509, 510, 2 281, 48(N) 664 cluster, 2 2 25, 566, 654 Codes associated with Clusters of catalogs, 2 2 25 datetime data4ypes !!C numeric variable>, 504, in Dynamic SQL, 2 2 2(Nã) 507 Codes used for!!interval COALESCE, 5 5, 84, 1, 142, iualifier>s in Dynamic 182, 444, 2 2 246, 544, 5 579 SQL, 2 2 2(Nã) COBOL, 0Ñ0ü0Ä 2 2 29, 5 51, 80Ñ0ü0Ä 243, Codes used for SQL data 2 258, 0Õ0é0ó9, 2 263, 0Ø0¯0¿0ü0ë4, 2 2 289, types in Dynamic SQL, 2 2 290, 491, 2 2 293, 495, 2 2 298, 428 5SA, 509, 510, 511, 5 5, coercibility, 5, (h*), (y>), 5 5ª, 614, 5 5(ry), 639, 5 551, (T ), (ry), 0Õ0é0ó, 5, 1(g ), 5 561, 66(l4) 5 564, 675 5, 10Õ0£0ü0È, ª4, 145, ¬5, !!COBOL binary integer>, 161, 7, 2SA, (h*)4, 20Ú0½, 5SA, 510, 5 551 (Œ¡)4, 297, 0Ú0½() , 508, 5SD, Coercible, (y>), (T ), (ry), (Œ¡), 510, 511, 5 50Ø0ë0Ä 5, 145, (eå)8, 264 COLLATE, 84, (ry)1, 2 2, 444, 5 579 !?ndex 9 , (h*), (y>), !!collation definition>, 50Ñ0ü0Ä (T ), 0Ø0¯0¿0ü0ë, 0Ú0½, ­0, 161, 255, (ry)7, 2 2, 0Ó0ë5, 2 2­, 163, 7, 188, (ry)1, 262, 0Ó0ë7, 2 20Ó0ë, 0Õ0£0ü0È5, 2 268, 48(l4) (Œ¡)0Ñ0ü0Ä 264, (Œ¡)5, 2 201, 0Ô0³(l4) 5 50Õ0¡0é0Ã0É, 634, 5 50Õ0é0ó, 637, 5 50Ø0ë0Ä, 2 203, 0Ó0ë1, 2 20Ó0ë, 0Õ0£0ü0È7, 2 272, 661 5 50Ó0ë, 63(l4) 5 50Õ0£0ü0È collation descriptor, 21, Collating coercibility 2 2 24, 2 2ª, 0Ó0ë5, 2 2, 0Ó0ë8, rules for dyadic 2 2(y>), 608 operators, (T ) !!collation name>, 2 26, 2 27, Collating coercibility 99, 103, 104, 251, (ry)9, rules for monadic 265, 0Ô0³(l4) 2 210, 0Ó0ë4, 2 2¬, operators, (T ) 0Ó0ë6, 2 2, 0Õ0¡0é0Ã0É9, 2 20Ó0ë, 0Õ0£0ü0È0Ñ0ü0Ä collating sequence, 5 5 2 20Õ0é0ó, 444, 2 2 252, 454, 5 5(Nã) !!collating sequence COLLATIONS, 539, 545, 555, definition>, 2 2, 0Ó0ë5 572, 604, 5 50, 608, 5 540 Collating sequence usage COLLATIONS base table, 5 5SA for comparisons, 25 , 0Ó0ë1, collation, 6, 20, 21, 24, 2 2, 0Ó0ë4, 2 2¬, 0Ó0ë6 2 25, 2 26, 2 27, 2 2 24, 50Ñ0ü0Ä 5 54, COLLATIONS view, 555 5 55, 5 56, 87, 99, 103, COLLATIONS_CHARACTER_SET_ 104, 251, (ry)5, 256, (ry)7, CATALOG_NOT_NULL, 5 5SA (ry)8, 259, (Œ¡)0Ñ0ü0Ä 265, 0Ô0³1, COLLATIONS_CHARACTER_SET_ 2 202, 0Ó0ë0, 2 2, 0Ó0ë(l4) 2 2, NAME_NOT_NULL, 5 5SA 0Ó0ë5, 2 2­, 0Ó0ë7, 2 2, 0Ó0ë9, COLLATIONS_CHARACTER_SET_ 2 2(y>), 0Õ0¡0é0Ã0É9, 2 20Ô0³, 0Õ0£0ü0È1, 2 20Õ0£0ü0È, SCHEMA_NOT_NULL, 5 5SA 0Õ0£0ü0È4, 2 20Õ0é0ó, 0Õ0£0ü0È6, 2 20Ú0½, 0Ø0¯0¿0ü0ë8, COLLATIONS_CHECK_ 2 2 20Ø0¯0¿0ü0ë, 444, 2 2 252, 454, 2 2 282, REFERENCES_CHARACTER_ 2 2 283, 555, 572, 605, 5 507, SETS, 608 COLLATIONS_FOREIGN_KEY_ 608, 5 5SD, 629, 5 50Õ0¡0é0Ã0É, 634, SCHEMATA, 5 5SA 635, 5 50Ú0½, 639, 5 561, 665, COLLATIONS_PAD_ATTRIBUTE_ 5 574 CHECK, 5 5SA COLLATION, 84, (ry)9, 2 2, COLLATIONS_PRIMARY_KEY, 608 2 2, 0Ó0ë5, 2 2­, 0Ó0ë8, 2 2(Nã), COLLATION_CATALOG, 83, 427, 0Õ0£0ü0È1, 2 20Õ0¡0é0Ã0É, 48(l4) 5 579 2 2 20Ö0Ã0·0§0ë, 436, 2 2 20Ú0Ë0Ò, 45(l4) 2 2 254, 539, 544, 545, 555, 570, 571, 57(l4) 5 504, 606, 5 5SA, 609 10 Database Language SQL COLLATION_NAME, 83, 428, column, 14, 15, 21, 20Ñ0ü0Ä 24, 434, 2 2 20Ø0¯0¿0ü0ë, 438, 2 2 252, 454, 2 25, 2 26, 2 27, 2 28, 2 29, 2 2 21, 539, 544, 545, 555, 570, 2 2 2(l4) 2 2 20Ñ0ü0Ä 50, 5 51, 5 5(l4) 5 50Ñ0ü0Ä 571, 572, 604, 5 50, 608, 5 54, 5 55, 5 56, 5 5 55, 98, 103, 5 5SD 109, 1, 9, 1(eå), 1, COLLATION_SCHEMA, 80Ñ0ü0Ä 2 2 2(y]), 1(g ), 0Ñ0ü0Ä 1(T ), 5, 1(Œ¡), 2 2 20Ö0Ã0·0§0ë, 436, 2 2 20Ú0Ë0Ò, 45(l4) 2 2 254, 7, 155, ¬6, 174, 6, 539, 544, 545, 555, 570, 177, 8, 179, 0, 181, 571, 57(l4) 5 504, 606, 5 5SA, (l4) 183, 4, 185, 6, 609 187, 9, 190, 1, 192, collection, 5, 5 5,  0Ñ0ü0Ä 194, 5, 196, 7, !!colon>, 80, 91, 99, (T )(l4) 198, 9, 200, (eå)1, 202, 2 2 290, 500, 5 (eå)0Ñ0ü0Ä 2SA, (h*)7, 2, (g )0, (g )0Ñ0ü0Ä 2(T ), (g )7, 2(R´), (y>)0, 20Ö0Ã0·0§0ë, (y>)6, 245, (T )6, 256, (Œ¡)0, 261, (Œ¡)(l4) 263, (Œ¡)4, 265, (Œ¡)6, 267, (Œ¡)8, 270, (y])1, 272, (y])0Ñ0ü0Ä 274, (y])5, 276, (y])7, 278, (y])9, 280, (R´)(l4) 283, (R´)4, 285, (R´)6, 287, (R´)8, 289, (Nã)0, 292, (Nã)6, 297, (Nã)8, 299, 0Ô0³1, 2 202, 0Ô0³4, 2 20, 0Ô0³9, 2 2, 0Õ0¡0é0Ã0É5, 2 2(Œ¡), 0Õ0¡0é0Ã0É9, 2 20Ô0³, 0Õ0£0ü0È1, 2 20Õ0£0ü0È, 0Õ0£0ü0È4, 2 20Õ0é0ó, 0Õ0£0ü0È6, 2 20Ú0½, 0Ú0½1, 2 272, 0Ú0½0Ñ0ü0Ä 2 274, 0Ú0½7, 2 279, 0Ú0Ë0Ò0, 2 283, 0Ú0Ë0Ò6, 2 288, 0Ú0Ë0Ò9, 2 290, 0Ø0ë0Ä1, 2 292, 0Ø0ë0Ä0Ñ0ü0Ä 2 294, 0Ø0ë0Ä5, 2 296, 0Ø0ë0Ä7, 2 298, 420, 2 2 20Ø0¯0¿0ü0ë, 446, 2 2 247, 450, 2 2 251, 45(l4) 2 2 257, 464, 2 2 269, 474, 2 2 275, 487, 50Ô0³, 530Ñ0ü0Ä 544, 547, 552, 558, 561, 56(l4) 569, 570, 572, 579, 580, 581, 582, 584, 588, 589, 591, 594, 596, 597, 5 501, 60(l4) 5 503, 610Ñ0ü0Ä 5 5, 641, 5 543, 644, 5 545, 647, 5 548, 665, 5 569, 670, 5 571, 67(l4) 5 573, 674, 5 577 !?ndex  COLUMN, 84, 284, (R´)6, 289, , (h*), 5 579 1, 1(g ), 0Ñ0ü0Ä 1(T ), 5, !!column constraint>, (Œ¡)(l4) 1(Œ¡), 7, 155, ¬6, 177, 264, (Œ¡)5, 5 545 1, 185, 7, 189, 0, !!column constraint 191, (l4) 193, (h*)7, 2, definition>, (Œ¡)(l4) 263, (y>)0, 264, (R´)4, 2 202, 0Ø0ë0Ä0, (Œ¡)4 579, 594, 5 50Ô0³, 641, 5 543, , 1SD, 644, 5 569, 670 256, (Œ¡)0, 261, (Œ¡)(l4) 263, Columns, 0Ø0¯0¿0ü0ë (Œ¡)4, 265, (Œ¡)6, 273, (R´)4, COLUMNS, 50Ø0ë0Ä, 544, 545, 2 2(ry), 0Ø0ë0Ä7, 2 298, 644, 5 545 56(l4) 572, 576, 580, 584, column descriptor, 0Ú0½, 0Ø0ë0Ä, 588, 596, 5 502, 640 187, (l4) 197, 8, 199, COLUMNS base table, 580 (eå)0, 265, (Œ¡)7, 268, (R´)6, COLUMNS view, 544 287, (R´)8, 297, 0Ô0³(l4) 2 20, COLUMNS_CHECK_DATA_TYPE, 2 2SD, 0Ó0ë8, 2 272, 0Ø0ë0Ä0Ñ0ü0Ä 2 297, 580 2 2 251, 580, 581 COLUMNS_CHECK_REFERENCES_ !!column name>, 0Ø0¯0¿0ü0ë, 98, 100Ñ0ü0Ä DOMAIN, 580 8, 1, 1, 174, 1, COLUMNS_FOREIGN_KEY_TABLES, 182, 1, 192, 7, 198, 580 199, (eå)0, 245, (T )6, 262, COLUMNS_PRIMARY_KEY, 580 265, (y])(l4) 273, (y])6, 282, COLUMNS_UNIQUE, 580 COLUMN_DEFAULT, 544, 580, 284, (R´)6, 287, (R´)8, 289, 581 296, (Nã)7, 298, 0Ô0³9, 2 2(Œ¡), COLUMN_DOMAIN_USAGE, 56(l4) 0Õ0£0ü0È1, 2 20Ö0Ã0·0§0ë, 0Õ0£0ü0È5, 2 271, 0Ú0½(l4) 5 540 0Ú0½0Ñ0ü0Ä 2 288, 0Ú0Ë0Ò9, 2 290, 0Ø0ë0Ä1, COLUMN_DOMAIN_USAGE view, 2 292, 0Ø0ë0Ä4, 2 298, 474, 2 2 287, 56() 50Ô0³, 645, 5 548, 670 COLUMN_NAME, 83, 480, 2 2 281, , 64, 65, 487, 50Ø0ë0Ä, 544, 545, 547, 66, 8, 180, 6, 245, 552, 558, 561, 56(l4) 570, 272, (y])4, 296, 0Ú0½1, 2 272, 571, 572, 570Ñ0ü0Ä 580, 581, 0Ú0½0Ñ0ü0Ä 2 274, 0Ú0Ë0Ò8, 2 292, 464, 584, 588, 589, 596, 597, 2 2 274, 635, 5 50Ú0Ë0Ò 60(l4) 5 503, 617, 5 5 column privilege descriptor COLUMN_POSITION_NOT_NULL, , 5 56 580 COLUMN_PRIVILEGES, 54(l4) 545, 547, 5 502, 640  Database Language SQL COLUMN_PRIVILEGES base COMMITTED, 68, 69, 83, 0Ø0ë0Ä9 4able, 60(N) common column name, 1(h*), COLUMN_PRIVILEGES view, 547 (l4) 181 COLUMN_PRIVILEGES_FOREIGN_ comparable, 6, 21, 27, 2 21, KEY_COLUMNS, 5 502 2 20Ñ0ü0Ä 2 24, 2 25, 10Ö0Ã0·0§0ë, (l4) COLUMN_PRIVILEGES_GRANTEE_ 169, 1, 207, (eå)9, 2, FOREIGN_KEY_USERS, 60(N) (h*)4, 2(eå), (g )4, 2(y]), (y>)1, COLUMN_PRIVILEGES_GRANTOR_ 20Ö0Ã0·0§0ë, (y>)7 FOREIGN_KEY_USERS, 60(N) !!comparison0redicate>, COLUMN_PRIVILEGES_IS_ 156, (eå)0Ñ0ü0Ä 205, (eå)7, 2SD, ??RANTABLE_CHECK, 60(N) (g )0, 2(h*), 0Ú0½0Ñ0ü0Ä 2 2 244, 446, COLUMN_PRIVILEGES_IS_ 50Ó0ë, 64(l4) 5 543 GRANTABLE_NOT_NULL, compilation unit, 1, 2, 46, 5 502 47, 61, 67, 490, 501, COLUMN_PRIVILEGES_PRIMARY_ 505, 5SD, 51(l4) 5¬, 517, KEY, 5 502 5(h*), 654 COLUMN_PRIVILEGES_TYPE_ COMPLETION, 85 CHECK, 60(N) completion condition, 10 , 80, 107, 108, 1, !!comp op>, (eå)7, 2SA, (eå)9, 1, 173, 6, 178, 7, 210, (g )0, 2(h*), 0Ú0½0Ñ0ü0Ä 50Ó0ë 1, 2, (y>)9, 245, (Œ¡)0, , 160, ­1, 0Õ0¡0é0Ã0É9, 2 20Õ0£0ü0È, 0Ö0Ã0·0§0ë6, 2 271, 0Ú0½7, 162, ­0Ñ0ü0Ä 164, 64() 2 282, 0Ø0ë0Ä1, 2 299, 401, 2 2 20Ö0Ã0·0§0ë, !!concatenation operator>, 438, 2 2 251, 474, 2 2 279, 500, 2(l4) 80Ñ0ü0Ä 160, 445 504, 505, 5, 515, 5, Concepts, 19 5(eå) !!condition>, 497, 2 2 299 COMMAND_FUNCTION, 80Ñ0ü0Ä 2 2 279, , 497, 481, 2 2 282, 488 2 2 299 !!comment>, 83, 86, 444, 2 2 262 Conditional rules, 10ª0ü0à , 80µ0ó0Á0ü0à !!condition information>, , 83, 479, 2 2 285 86 , 479, 2 2 280, 485 275, (R´)1, 2 297, 400Ñ0ü0Ä 2 2 282 !!condition information item !!commit statement>, 2 2 21, 50, name>, 479, 2 2 280, 481 5(l4) 54, 5 57, 5 59, 5 5 51, 253, !!condition number>, 2 2 279, 2 242, 0Ø0¯0¿0ü0ë9, 2 2 203, 410Ñ0ü0Ä 2 2 282, 480, 2 2 285, 670ª0ü0à 526, 5 571 Index 10ª0ü0à CONDITION_NUMBER, 83, 0Õ0é0ó4, CONSTRAINT, 84, 292, 0Ô0³8, 479, 2 2 281, 485 2 20Ú0Ë0Ò, 484, 50Ø0¯0¿0ü0ë, 565, 568, conformance, 9, , ­, , 569, 570, 571, 572, 570Ñ0ü0Ä 75, 76, 560Ñ0ü0Ä 5 5, 614, 574, 576, 578, 580, 583, 5 5(ry), 626, 5 5(y]) 584, 585, 586, 588, 590, Conformance, 625 591, 590Ñ0ü0Ä 595, 596, 598, CONNECT, 84, 2 249, 407, 2 2 283, 600, 5 502, 604, 5 505, 606, 527, 5 579 5 5SA, 610, 5 5, 61(l4) 5 579 CONNECTION, 84, 2 249, 410, , 484, 5(y]), 679 252, (ry)0Ñ0ü0Ä 262, (Œ¡)0Ñ0ü0Ä 270, connection does not exist, 0Ô0³1, 2 2SD, 0Õ0¡0é0Ã0É5, 5 50Õ0£0ü0È 0Ö0Ã0·0§0ë9, 2 2 210, 41(l4) 5(y]), 620 , connection exception, 5 5 51, 252, (ry)0ª0ü0à 2 249, 408, 2 2 2SD, 410, 2 2 2, constraint mode, 40, 41, 5(y]), 620 67, 74, (ry)0Ñ0ü0Ä 270, 0Õ0¡0é0Ã0É6, connection failure, 5 5 51, 2 250, 401, 2 2 202, 528 2 2 210, 620 !!constraint name>, 99, 100Ñ0ü0Ä Connection management, 407 105, (ry)(l4) 259, (y])0, 292, , 5 5 51, 99, 100Ñ0ü0Ä 104, 407, 2 2 2SA, 410, 2 202, 0Ô0³8, 2 2SD, 0Õ0¡0é0Ã0É5, 2 2(Œ¡), 2 2 2, 488 0Õ0¡0é0Ã0É8, 2 20Ú0Ë0Ò, 401, 2 2 202, 586, connection name in use, 5 5­, 640, 5 570 408, 5 5(eå) , 410, definition>, (ry)(l4) 253, 2 2 2, 41(N) (Œ¡)(l4) 263, (Œ¡)5, 270, (y])1, !!connection4arget>, 407 2 201, 0Ô0³(l4) 2 2SD, 645, 5 565, CONNECTION_NAME, 80Ñ0ü0Ä 2 252, 670 2 254, 480, 2 2 281, 488 !!constraint name , 54, definition> and 5 55, 5 5 50, 5 5 51, 5 5 5(l4) 5 5 54, 2 249, , 0Ø0¯0¿0ü0ë9, 2 2 207, 408, 2 2 2SD, 480Ñ0ü0Ä 252 488, 5(y]), 636, 5 555, 66(l4) , 5 569, 67(N) 401, 2 2 202 consistent, 5 573 CONSTRAINTS, 84, 2 2 201, 400Ñ0ü0Ä constraint, 2 2 25 5 579  Database Language SQL CONSTRAINT_CATALOG, 83, Conventions, 9 2 2 280, 481, 2 2 286, 487, 541, CONVERT, 84, ª(l4) 5 579 549, 550, 551, 552, 550Ñ0ü0Ä Coordinated Universal Time, 559, 561, 574, 575, 585, 5 586, 588, 589, 590, 591, !!correlation name>, 99, 590Ñ0ü0Ä 595, 596, 598, 616, 102, 100Ñ0ü0Ä 1, 9, 1(h*), 5 5, 618, 5 565 () CONSTRAINT_COLUMN_USAGE, CORRESPONDING, 84, 6, 561, 5 540 198, 9, 202, (R´)9, 5 543, CONSTRAINT_COLUMN_USAGE 679 6iew, 561 !!corresponding column list> CONSTRAINT_NAME, 83, 480, , 196, 8 2 2 281, 486, 2 2 287, 541, 549, corresponding join columns, 550, 551, 55(l4) 553, 559, 181, (l4) 183 561, 574, 575, 585, 586, , 6 588, 589, 590, 591, 593, COUNT, 62, 84, 4, 1(ry), 595, 596, 598, 616, 5 5, 6, 192, 434, 2 2 20Õ0é0ó, 436, 618, 5 565 2 2 20Ú0Ë0Ò, 439, 2 2 252, 450Ñ0ü0Ä 2 2 255, CONSTRAINT_SCHEMA, 80Ñ0ü0Ä 2 2 280, 457, 2 2 285, 537, 586, 616, 481, 2 2 286, 487, 541, 549, 5 5, 641, 5 559 550, 551, 55(l4) 553, 559, CREATE, 84, (ry)5, 260, (Nã)6, 561, 574, 575, 585, 586, 2 201, 0Ó0ë1, 2 2, 0Õ0¡0é0Ã0É0, 2 2(ry), 588, 589, 590, 591, 593, 48(l4) 2 2 283, 484, 50Õ0é0ó, 536, 595, 596, 598, 5 5­, 617, 50Ú0½, 538, 50Ø0ë0Ä, 541, 542, 5 5, 665 540Ñ0ü0Ä 544, 546, 547, 548, CONSTRAINT_TABLE_USAGE, 549, 550, 551, 55(l4) 553, 559, 640 554, 555, 556, 557, 558, CONSTRAINT_TABLE_USAGE 559, 561, 562, 560Ñ0ü0Ä 564, 6iew, 559 565, 567, 568, 569, 570, CONSTRAINT_TYPE, 549, 585, 573, 574, 576, 578, 580, 586, 587, 588, 590, 591, 580Ñ0ü0Ä 584, 585, 588, 590, 618 593, 595, 596, 598, 5 500, CONSTRAINT_TYPE_CHECK, 585, 60(l4) 5 504, 606, 5 5SA, 610, 588, 590 5 5, 616, 5 5, 618 CONSTRAINT_TYPE_NOT_NULL, 585 CONTINUE, 84, 2 2 297, 499 !?ndex ¬ created local4emporary CURRENT_USER, 70, 84, 4, table, 2 27, 2 28, 2 29, 5 5 5(l4) 1¬, 6, 1, (Œ¡)6, 267, 258, (Œ¡)0, 261, (y])5, 281, (Œ¡)8, 269, (R´)(l4) 2 2(ry), 0Ú0½5, 655, 5 568 50Ô0³, 538, 50Ø0ë0Ä, 541, 542, CROSS, 84, 180, (l4) 5 579 540Ñ0ü0Ä 545, 546, 547, 548, !!cross join>, 180, 0Ñ0ü0Ä 549, 550, 551, 55(l4) 553, 184, 631 554, 555, 556, 557, 558, !!C storage class>, 504 559, 561, 562, 641, 5 545, CURRENT, 84, 2 284, 0Ø0ë0Ä1, 2 2 2, 658, 5 579 47(l4) 2 2 274, 476, 2 2 277 cursor, 49 !!current date6alue CURSOR, 84, 0Ú0½1, 2 2 264, 465, function>, 10Ø0ë0Ä 2 2 282, 480Ñ0ü0Ä 2 2 284 current SQL-connection, 5 5 51, , 5 5(l4) 99, 103, 5 5 5(l4) 2 2 2SA, 409, 2 2 210, 411, 0Ö0Ã0·0§0ë1, 2 242, 0Ú0½1, 2 275, 0Ú0½7, 41(l4) 2 2 2ª 2 281, 0Ú0Ë0Ò4, 2 291, 0Ø0ë0Ä(l4) 2 2 243, current SQL-session, 2 2 24, 46(l4) 2 2 264, 467, 2 2 269, 471, 45, 72, 73, 93, 100, 2 2 272, 474, 2 2 275, 476, 2 2 277, 101, 100Ñ0ü0Ä 104, 5, 2 2SD, 49(l4) 5 50Õ0é0ó, 636 2 2 201, 408, 2 2 2SD, 410, 2 2 2, cursor operation conflict, 2 2 2¬, 417, 2 2 2, 420, 2 2 2(h*), (y])9, 2 285, 0Ú0Ë0Ò7, 2 292, 0Ø0ë0Ä5, 42(l4) 2 2 287, 526, 5 553, 654, 2 2 286, 62() 5 556 Cursors, 49 !!current timestamp value , 62, function>, ª9 9, 2 271, 0Ú0½(l4) 2 273, 0Ú0½4, !!current time6alue 2 275, 0Ú0½7, 2 281, 0Ú0Ë0Ò4, 2 291, function>, ª9 44(l4) 2 2 248, 449, 2 2 264, 465, CURRENT_DATE, 5 5 50, 84, 10Ø0ë0Ä, 2 2 267, 469, 2 2 272, 474, 2 2 276, 153, 645, 5 569, 679 477, 5 50Õ0é0ó, 636, 5 50Ú0Ë0Ò, 647 CURRENT_TIME, 84, ª9, 5 545, cursor specification cannot 669, 5 579 be executed, 459, 5 5(h*) CURRENT_TIMESTAMP, 84, ª9, CURSOR_NAME, 80Ñ0ü0Ä 2 252, 0Õ0é0ó4, 645, 5 569, 679 2 2 280, 481, 2 2 286, 487 , 504, 505, 506, 507, 651, 5 564 , 2 2 290, 504, 505, 506, 507 ­ Database Language SQL , DATA_TYPE, 0Õ0é0ó4, 50Ø0ë0Ä, 544, 504 545, 570, 571, 57(l4) 573, CYCLE, 85 580, 581 - D - DATA_TYPE_CHECK_REFERENCES_ DATA, 83, 85, 427, 2 2 20Ö0Ã0·0§0ë, COLLATION, 571 435, 2 2 20Ø0¯0¿0ü0ë, 439, 2 2 252, 450Ñ0ü0Ä DATA_TYPE_DESCRIPTOR, 539, 455, 2 2 256, 458, 5 573 545, 570, 571, 57(l4) 573, Data assignment rules, 20Ó0ë 581 database, 1, 2, 7, 14, 2 2 25, DATA_TYPE_DESCRIPTOR base 61, 63, 70, 625 4able, 570 data exception, 1, 1, DATA_TYPE_DESCRIPTOR_CHECK_ 6, 10Õ0é0ó, ª6, 10Ú0½, 6, USED, 572 7, 148, 9, 150, ¬1, DATA_TYPE_DESCRIPTOR_ 152, ¬0Ñ0ü0Ä 154, ¬8, 163, PRIMARY_KEY, 571 ­7, 2¬, (y>)1, 20Õ0£0ü0È, (y>)4, date, 5 20Õ0é0ó, 0Ö0Ã0·0§0ë8, 2 263, 42(l4) 2 2 20Õ0é0ó, DATE, 19, 2 21, 84, 90, 94, 439, 5 5(eå) 1SA, 0, 1, ª9, 152, Data manipulation, 2 271 ­6, 2 2 2(Nã), 440, 571, 679 Data0arameters, 2 2 28 !!date literal>, 90, 94 data4ype, 19 !!date string>, 82, 90 !!data4ype>, 47, 63, 93, datetime data type 100Ñ0ü0Ä 107, 0Ñ0ü0Ä 1¬, 4, descriptor, 29 192, (Œ¡)(l4) 263, (Œ¡)4, 265, !!datetime factor>, ­5 !!datetime field>, 2 21, 2 20Ñ0ü0Ä 0Ô0³1, 2 246, 0Õ0é0ó0, 2 251, 0Õ0é0ó(l4) 94, 96, 1, (l4) 1(R´), 2 256, 0Õ0é0ó7, 2 258, 0Õ0é0ó9, 2 260, 9, 10Ô0³, 5, 152, ¬0Ñ0ü0Ä 0Ø0¯0¿0ü0ë1, 2 262, 415, 2 2 2, 420, 154, ­5, 166, ­7, 168, 2 2 2(g ), 446, 2 2 292, 494, 5 50Ô0³, ­9, 170, (eå)9, 2(y]), (y>)8, 635, 5 540, 647, 5 558 20Ø0ë0Ä, (T )0, 241, (Œ¡)7, 5 559 data type descriptor, 19, datetime field overflow, (eå), (Œ¡), (y]), (Nã), 0Ô0³, 0Ø0¯0¿0ü0ë, 167, 620 2 27, 192, (Œ¡)5, 290, 0Ô0³(l4) !!datetime literal>, 89, 90, 0Ô0³9, 2 210, 570, 572 95, 96, 97, 267, 640 Data4ypes,  !!datetime0rimary>, 165, Data4ypes of s ­6, 167 used in SQL item Datetimes, 2 20 descriptor areas, 2 2 2(y]) Datetimes and intervals, (Nã) , 165, ­6, 167, ­8, 169, 1, 2 2 245 Index 17 , 107, 108, !!deallocate0repared 1, 0Ñ0ü0Ä 2 2 2(Œ¡), 450Ñ0ü0Ä 2 2 254, statement>, 50, 54, 5 50Ô0³, 640 60, 61, 63, 0Ø0¯0¿0ü0ë9, 2 2 249, , 91, 92, 480Ñ0ü0Ä 5 50Õ0é0ó, 637 95 DEC, 84, 108, 2 266, 515, !!datetime6alue expression> 5­, 520 , 1(R´), 9, 10Ô0³, ¬5, DECIMAL, , (y]), 0Ö0Ã0·0§0ë, 84, 156, ­5, 166, ­7, 168, 107, 1SA, 109, 110, 0Ø0¯0¿0ü0ë0, ­9, 170, 64(N) 2 261, 425, 2 2 2(Œ¡), 429, 2 2 240, , 516, 5(eå), 52(l4) 571, 657, ª9, 140, ­5, 266, (Œ¡)7, 5 558 (Œ¡)8, 269, (R´)(l4) 2 2(ry), 0Ú0½5, DECLARE, 84, 2 271, 0Ø0ë0Ä7, 2 2 264, 5 541 490, 5(eå), 521 DATETIME_INTERVAL_CODE, 83, !!declare cursor>, 2 2 26, 2 2 29, 426, 2 2 2(y]), 434, 2 2 20Ø0¯0¿0ü0ë, 439, 50, 50Ñ0ü0Ä 56, 57, 58, 5 50, 440, 2 2 241, 450Ñ0ü0Ä 2 2 254, 455, 2 241, 0Ö0Ã0·0§0ë(l4) 2 271, 0Ú0½4, 2 275, 2 2 256, 457, 5 563 0Ú0½7, 2 281, 0Ú0Ë0Ò4, 2 291, 464, DATETIME_INTERVAL_PRECISION 2 2 276, 477, 2 2 289, 49(l4) 2 2 293, , 80Ñ0ü0Ä 2 2 2(y]), 434, 2 2 20Ø0¯0¿0ü0ë, 495, 2 2 296, 647, 5 562, 665, 439, 2 2 240, 441, 2 2 253, 455, 5 568, 671, 5 573, 674, 5 575, 2 2 256, 457, 5 563 677 DATETIME_PRECISION, 539, declared local temporary 544, 570, 571, 57(N) table, 2 27, 2 29, 5 5 5(l4) 101, , 90, 91, 96 100Ñ0ü0Ä 245, (y])5, 281, (R´)0Ñ0ü0Ä DAY, 0Ô0³, 0Ó0ë, 0Õ0¡0é0Ã0É, 0Õ0£0ü0È, 84, 294, 0Ø0ë0Ä7, 2 298, 459, 2 2 286, 95, 1, ­7, 20Ú0Ë0Ò, (y>)9, 487, 5 555 (T )0, 2 2 20Ô0³, 441, 2 2 245, 679 DEFAULT, 84, 173, 5, 255, , 91, 94 (Œ¡)6, 274, (y])8, 279, (R´)8, !!day-time interval>, 91 2 20, 0Ó0ë1, 2 2, 0Ó0ë4, 2 2­, , 91, 95 DEALLOCATE, 84, 2 242, 430Ñ0ü0Ä 2 249, 0Ú0Ë0Ò8, 2 291, 0Ø0ë0Ä0Ñ0ü0Ä 2 2 207, 2 2 247, 449, 2 2 283, 526, 5 579 408, 2 2 210, 41(l4) 5(y]), 590, !!deallocate descriptor 591, 59(l4) 5 542, 648, 5 563 statement>, 54, 60, 62, , 0Õ0é0ó, (Œ¡)(l4) 0Ö0Ã0·0§0ë(l4) 2 269, 430Ñ0ü0Ä 2 2 283, 526 266, (Œ¡)7, 268, (R´)7, 2 201, 0Ô0³(l4) 2 205, 0Ô0³9 default collating sequence, 5 18 Database Language SQL !!default option>, 2 26, 2 27, Definitions, 5 (Œ¡)6, 268, (Œ¡)9, 573, 581, Definitions, notations, and 5 545 conventions, 5 !!default specification>, definition schema, 2 2 25 173, 4 Definition Schema, 75, 77, default SQL-connection, 71, 86, 100, 50Õ0£0ü0È, 566 5 5 5(l4) 2 2 2SA, 41(N) Definitions0rovided in default SQL-session, 72, 4his International 2 249, 408, 5(y]) Standard, 5 default time+one, 5 5 50Ñ0ü0Ä 94, Definitions4aken from 96, 1, (l4) 5 556 ISO/IEC 10646, 5 DEFAULT_CHARACTER_SET_ Definitions taken from!?SO CATALOG, 50Ú0Ë0Ò, 569 8601, 5 DEFAULT_CHARACTER_SET_NAME, DEFINITION_SCHEMA, 5 5 55, 101, 50Ú0Ë0Ò, 569 538, 50Ø0ë0Ä, 541, 542, 540Ñ0ü0Ä DEFAULT_CHARACTER_SET_ 544, 545, 546, 547, 548, SCHEMA, 50Ú0Ë0Ò, 569 549, 550, 551, 552, 550Ñ0ü0Ä DEFAULT_COLLATE_CATALOG, 554, 555, 556, 557, 558, 554, 606, 5 507, 674 559, 561, 56(l4) 563, 566, DEFAULT_COLLATE_NAME, 554, 567 606, 5 507, 674 DEFINITION_SCHEMA Schema, DEFAULT_COLLATE_SCHEMA, 567 554, 606, 5 507, 674 degree, 2 27, 2 29, 5 58, 1, deferrable, 0Ø0¯0¿0ü0ë, 40, 41, 4, 176, 9, 183, 1, (ry)0Ñ0ü0Ä 270, (y])5, 2 2(Œ¡), 575, 199, (eå)0Ñ0ü0Ä 207, (h*)1, 2, 587, 598 (g )0, 2(T ), (g )7, 261, (Œ¡)5, DEFERRABLE, 84, 252, (ry)0Ñ0ü0Ä 284, (Nã)0, 297, 0Ú0½(l4) 2 277, 270, 0Ô0³1, 2 2(ry), 401, 2 2 202, 0Ú0½8, 2 288, 45(l4) 2 2 257, 469, 541, 549, 550Ñ0ü0Ä 574, 575, 50Ô0³, 617, 5 5 585, 587, 598, 5 50Õ0£0ü0È, 679 DELETE, 64, 66, 84, (T )5, deferred, 2 2 20, 2 2 21, 5 57, 5 5 56, 260, (Œ¡)1, 274, (y])5, 281, 253, (y])0, 2 2(Œ¡), 40(l4) 575, (Nã)8, 2 20Ô0³, 0Ú0Ë0Ò4, 2 286, 0Ø0ë0Ä7, 587, 599, 655 2 298, 400Ñ0ü0Ä 2 2 272, 476, 2 2 283, DEFERRED, 84, (ry)(l4) 253, 2 2 201, 541, 549, 550Ñ0ü0Ä 574, 484, 550, 590, 592, 600, 575, 585, 587, 598, 599, 5 501 679 , 274, (y])6, Definition, 10 277, (y])8, 279, 59() Index 19 , 50, 53, , 0Ú0½, 0Ø0ë0Ä, 40, 48, 49, 55, 57, 59, 279, 0Ø0¯0¿0ü0ë9, 50, 51, 64, 65, 66, 69, 2 284, 0Ú0Ë0Ò5, 2 287, 0Ø0ë0Ä(l4) 2 295, 72, 74, (l4) 140, 1, 47(l4) 2 2 276, 480µ0ó0Á0ü0à 174, (l4) 197, 9, 200, , 50Ñ0ü0Ä 55, 56, 292, (Nã)6, 2 200, 0Ô0³(l4) 2 204, 58, 59, 1, (l4) 2 269, 0Ô0³9, 2 20Õ0é0ó, 0Õ0£0ü0È8, 2 242, 0Ö0Ã0·0§0ë6, 0Ú0Ë0Ò4, 2 286, 0Ú0Ë0Ò7, 2 292, 400Ñ0ü0Ä 2 250, 0Õ0é0ó1, 2 273, 0Ú0½9, 2 280, 2 2 242, 480Ñ0ü0Ä 2 2 284, 485, 5(ry), 0Ú0Ë0Ò(l4) 2 283, 0Ø0ë0Ä7, 2 2 200, 41(l4) 670µ0ó0Á0ü0à 2 2 20Õ0é0ó, 436, 2 2 240, 441, 2 2 248, DELETE_RULE, 550, 590, 592 45(l4) 2 2 254, 485, 2 2 293, 494, !!delimited identifier>, 5 5 56, 2 2 295, 526, 50Ô0³, 531, 557, 8(l4) 86, 87, 98, 50Õ0£0ü0È 558, 562, 607, 5 567, 668, !!delimited identifier body> 5 569, 670, 5 571, 67(l4) 5 573, , 8(l4) 86, 87, 88, 100, 674, 5 577, 678 50Õ0£0ü0È, 629 dependent0rivilege !!delimited identifier0art> descriptors still exist, , 8(l4) 86 0Õ0£0ü0È8, 5 5(h*) !!delimiter token>, 82, 86, deprecated, 47, 75, 0Ö0Ã0·0§0ë6, 629, 5 540 2 247, 0Õ0é0ó6, 2 257, 0Õ0é0ó8, 2 259, depend, , 0Õ0é0ó, 41, 44, 59, 2 20Õ0é0ó, 0Õ0£0ü0È6, 2 2 252 0Ø0¯0¿0ü0ë0, 2 261, 496, 502, 507, dependency graph, 2 20Õ0é0ó 510, 514, 5­, 519, 5(g ), dependend on, (Nã)(N) 624 Deprecated features, 675 DEPTH, 85 , (l4) 182, 1, 192, 5, 2 279, 45() !!derived column list>, 8, 1, 0, 5 541 derived table, 2 27 !!derived table>, 8, 1, 0, 178, 0Ñ0ü0Ä 200, 630, 5 50Ó0ë derived table descriptor, 40 (eå) Database Language SQL DESC, 84, 0Ó0ë4, 2 2­, 0Ú0½1, Diagnostics area, 2 2 28 2 273 diagnostics area limit, 5 57, DESCRIBE, 84, 2 2 250, 480Ñ0ü0Ä 5 579 5 5 54, 2 2 200 !!describe input statement>, Diagnostics management, 479 54, 5 50, 5 51, 2 2 250, 450Ñ0ü0Ä !!diagnostics size>, 2 299 456, 5 50Õ0é0ó, 638, 5 573 DICTIONARY, 85 !!describe output statement> , 5 5 59, 8(l4) 90, 94, , 54, 60, 61, 450, 2 2 251, 96, 98, 148, ¬0, 5 5, 2 2 257, 670µ0ó0Á0ü0à 629, 5 566 !!describe statement>, 2 269, , 525, Description, 10 5(Œ¡), 527, 5 565 Description of SQL item Direct invocation of SQL, descriptor areas, 2 2 2(ry) 64, 525 descriptor, 6, 14 directly, 2 27, 2 2 25, 2 2 29, 51, DESCRIPTOR, 84, 2 242, 0Õ0é0ó0Ñ0ü0Ä 58, 5 51, 5 54, 5 5 50, 5 5 50Ñ0ü0Ä 5 5 54, 0Õ0é0ó4, 2 255, 431, 2 2 20Õ0£0ü0È, 434, 90Ñ0ü0Ä 100, 101, 1(h*), 5, 438, 2 2 251, 48(l4) 2 2 283, 484, 156, ­7, 181, 5, 186, 5(Œ¡), 539, 545, 570, 571, 9, 190, (l4) 193, 4, 57(l4) 573, 581, 5 579 20Ô0³, (Œ¡)4, 2 201, 0Õ0£0ü0È5, 2 20Ø0¯0¿0ü0ë, , 0Õ0£0ü0È8, 2 291, 0Ø0ë0Ä(l4) 2 294, 415, 434, 2 2 20Õ0é0ó, 438, 2 2 20Ø0ë0Ä 2 2 2, 419, 2 2 274, 485, 5(ry), , 5 5(l4) 99, 640Ñ0ü0Ä 5 556, 670ª0ü0à 102, 104, 105, 0Ö0Ã0·0§0ë(l4) 2 2 20Ó0ë, directly contain, 11, 1(h*), 2 2 20Õ0¡0é0Ã0É, 430Ñ0ü0Ä 2 2 20Ö0Ã0·0§0ë, 435, 2 2 20Ø0¯0¿0ü0ë, 5, 156, ­7, 181, 5, 437, 2 2 20Ú0Ë0Ò, 439, 2 2 241, 451, 186, 9, 190, (l4) 193, 2 2 253, 455, 2 2 257, 458, 5(Œ¡), (y>)0, 264, 0Ô0³1, 2 292, 0Ø0ë0Ä4, 637, 5 50Ú0Ë0Ò 2 2 274, 485, 5 543 Descriptors,  directly dependent on, 2 20Õ0é0ó deterministic, 40, 9, Directly executable SQL- 0Ñ0ü0Ä 200, (R´)(l4) 2 2(ry) statements, 58 DIAGNOSTICS, 84, 2 299, 479, !!directly executable 2 2 284, 679 statement>, 525 diagnostics area, 41, 48, !!direct select statement: 49, 67, 74, 0Ö0Ã0·0§0ë8, 2 250, multiple rows>, 50Ñ0ü0Ä 56, 0Õ0é0ó1, 2 2 200, 479, 2 2 282, 485, 57, 58, 59, 1, 480Ñ0ü0Ä 526, 5(R´), 529, 5 5, 660Ñ0ü0Ä 5(ry), 526, 50Ô0³ 668, 5 569 !?ndex (h*) !!direct SQL data statement> domain, ¬, 0Õ0é0ó, 0Ø0¯0¿0ü0ë, 0Ú0½, 40, , 5(ry), 528, 5 50Ø0ë0Ä, 65(N) 43, 44, 45, 47, 52, 64, , 64, 65, 66, 75, 76, 98, 100Ñ0ü0Ä 67, 71, 73, 74, 93, 100, 105, 109, 1¬, 4, 145, 101, 0Ö0Ã0·0§0ë9, 2 2 2¬, 417, 2 2 2, ¬4, 192, (y>)6, 255, (ry)6, 525, 5(Œ¡), 527, 5(R´), 529, 257, (ry)8, 262, (Œ¡)0Ñ0ü0Ä 264, 5 5, 625, 5 5(y]), 640, 5 551, (Œ¡)5, 266, (Œ¡)7, 268, (R´)1, 655, 5 556 282, (Nã)0, 2 201, 0Ô0³(l4) 2 203, dirty read, 68 0Ô0³4, 2 205, 0Ô0³6, 2 207, 0Ô0³8, DISCONNECT, 84, 2 255, 41(l4) 2 2SD, 0Ó0ë0, 2 2, 0Õ0¡0é0Ã0É9, 2 20Ô0³, 2 2 283, 679 0Õ0£0ü0È1, 2 20Õ0£0ü0È, 0Õ0£0ü0È4, 2 20Ø0¯0¿0ü0ë, 0Õ0£0ü0È7, disconnect error, 2 2 2ª, 620µ0ó0Á0ü0à 2 20Ú0Ë0Ò, 0Ø0¯0¿0ü0ë8, 2 2 246, 48(l4) 2 2 283, , 2 2 2 !!disconnect statement>, 54, 50Õ0£0ü0È, 539, 540, 541, 562, 5 5 51, 2 269, 41(l4) 2 2 2ª, 480Ñ0ü0Ä 564, 565, 569, 570, 57(l4) 636, 5 572 573, 574, 575, 581, 593, distinct, 5, 5 5, 7, 19, 20, 595, 596, 605, 5 50Õ0£0ü0È, 634, (g ), (Nã), 0Ú0Ë0Ò, 0Ø0ë0Ä, 0Ñ0ü0Ä 5 540, 644, 5 546 7, 273, (y])7, 278, (y])9, DOMAIN, 84, (ry)8, 2 201, 0Ô0³4, (Nã)8, 2 273, 490Ñ0ü0Ä 2 2 294, 495, 2 2SD, 0Õ0¡0é0Ã0É9, 2 20Ú0Ë0Ò, 48(l4) 564, 2 2 296, 531, 5 568, 670, 5 573, 565, 5 580 677 domain constraint, 2 2 20, 2 2 20ª0ü0à DISTINCT, 84, 4, 1(Œ¡), !!domain constraint>, 0Õ0é0ó, 193, 4, 195, (eå)8, 50Ø0ë0Ä, 5, 154, 0Ô0³1, 2 202, 0Ô0³7, 541, 544, 617, 5 50Ô0³, 631, 564 670 domain constraint division by zero, ¬8, 5 5(eå) descriptor, 0Ø0¯0¿0ü0ë, 40, 43, 0Ô0³(l4) 2 2SD, 0Õ0£0ü0È7, 2 20Ú0Ë0Ò Domain constraints, 43 domain definition, 2 25 !!domain definition>, 52, 109, 1¬, (ry)5, 256, (ry)7, 266, (R´)1, 2 201, 0Ô0³(l4) 2 203, 0Ó0ë0, 2 268, 480Ñ0ü0Ä 5 544, 646 (g ) Database Language SQL domain descriptor, 2 26, 2 2 24, DOMAIN_CONSTRAINTS_FOREIGN_ 75, (y>)6, 267, (Œ¡)8, 2 201, KEY_CHECK_CONSTRAINTS, 2 202, 0Ô0³4, 2 205, 0Ô0³6, 2 207, 574 2 2SA, 0Ó0ë8, 2 20Ô0³, 0Õ0£0ü0È1, 2 20Ú0½, DOMAIN_CONSTRAINTS_FOREIGN_ 0Õ0£0ü0È8, 573 KEY_DOMAINS, 574 , 2 25, 98, 103, DOMAIN_CONSTRAINTS_FOREIGN_ 105, 144, 5, 154, (l4) KEY_SCHEMATA, 574 (ry)8, 262, (Œ¡)0Ñ0ü0Ä 264, (Œ¡)5, DOMAIN_CONSTRAINTS_ 2 201, 0Ô0³(l4) 2 204, 0Ô0³5, 2 20, INITIALLY_DEFERRED_ 2 207, 0Ô0³8, 2 2SD, 0Õ0¡0é0Ã0É9, 2 20Ó0ë, NOT_NULL, 574 2 20Õ0£0ü0È, 0Õ0£0ü0È8, 2 2 246, 581, 5 540, DOMAIN_CONSTRAINTS_PRIMARY_ 644 KEY, 574 Domains, 2 25 DOMAIN_DEFAULT, 50Ø0ë0Ä, 570ª0ü0à DOMAINS, 50Ø0ë0Ä, 56(l4) 572, DOMAIN_NAME, 539, 541, 544, 570Ñ0ü0Ä 574, 580, 5 504, 616, 545, 56(l4) 570, 571, 572, 5 540 570Ñ0ü0Ä 574, 575, 580, 581, DOMAINS base table, 573 5 504 DOMAINS6iew, 50Ø0ë0Ä DOMAIN_NAME_NOT_NULL, 574 DOMAINS_CHECK_DATA_TYPE, DOMAIN_SCHEMA, 539, 541, 573 544, 545, 56(l4) 570, 571, DOMAINS_FOREIGN_KEY_ 572, 570Ñ0ü0Ä 574, 575, 580, SCHEMATA, 573 581, 5 504 DOMAINS_PRIMARY_KEY, 570µ0ó0Á0ü0à DOMAIN_SCHEMA_NOT_NULL, 574 DOMAIN_CATALOG, 539, 541, dormant SQL-connection, 5 5 51, 544, 545, 56(l4) 570, 571, 5 5 5(l4) 2 2 2SA 57(l4) 573, 574, 575, 580, dormant SQL-session, 5 5 5(l4) 581, 5 504 2 2 2SA, 411 DOMAIN_CATALOG_NOT_NULL, DOUBLE, 19, 27, 2 24, 84, 574 1SA, 0, 2 252, 0Õ0é0ó7, 2 258, DOMAIN_CONSTRAINTS, 541, 0Õ0é0ó9, 2 2 2(ry), 426, 2 2 2(Nã), 440, 574, 593, 616 500, 50(l4) 507, 51(l4) 5ª, DOMAIN_CONSTRAINTS base 571, 5 558 table, 574 , 80Ñ0ü0Ä 500, DOMAIN_CONSTRAINTS6iew, 517 541 !!doubleiuote>, 5 5 59, 80, 8(l4) DOMAIN_CONSTRAINTS_CHECK_ 86, 87 DEFERRABLE, 574 !!doublequote symbol>, 8(l4) 86, 87 Index 20ª0ü0à DROP, 84, (ry)8, 259, (R´)8, !!drop4ranslation (R´)9, 290, (Nã)(l4) 294, 0Ô0³0, statement>, 50Ñ0ü0Ä 259, 2 20, 0Ô0³8, 2 2SD, 0Ó0ë0Ñ0ü0Ä 2 2, 0Õ0¡0é0Ã0É0Ñ0ü0Ä 2 2(T ), 0Ø0¯0¿0ü0ë8, 2 2 283, 634, 0Õ0¡0é0Ã0É0Ñ0ü0Ä 2 2(R´), 0Õ0£0ü0È8, 2 298, 480Ñ0ü0Ä 5 50Õ0é0ó, 637, 5 50Ø0ë0Ä 680 , 5(l4) !!drop assertion statement>, 258, (Nã)0, 2 200, 0Õ0£0ü0È8, 2 268, 5(l4) 259, 0Õ0¡0é0Ã0É8, 2 20Ú0Ë0Ò, 0Ø0¯0¿0ü0ë8, 480Ñ0ü0Ä 5 546 480Ñ0ü0Ä 5 50Ö0Ã0·0§0ë, 635, 5 50Ú0½, 639 duplicate, 5 5, 7, 1(Œ¡), 1, !!drop behavior>, (ry)8, 289, 194, 5, 201, (eå)(l4) 2(y>), 292, (Nã)4, 2 200, 0Ô0³9, 2 20Õ0£0ü0È 0Õ0£0ü0È(l4) 5 5 !!drop character set dyadic, (T ), ¬7, 158, ­1, statement>, 52, (ry)9, 2 2 243 0Ó0ë0Ñ0ü0Ä 2 268, 480Ñ0ü0Ä 5 546 dyadic operator, 5 5, (T ), 440ª0ü0à , DYNAMIC, 480ª0ü0à 50Ñ0ü0Ä 259, 0Ó0ë8, 2 2, 0Ø0¯0¿0ü0ë8, !!dynamic close statement>, 2 2 283, 634, 5 50Õ0é0ó, 637, 5 50Ø0ë0Ä 50, 53, 55, 57, 58, 59, , (R´)6, 288, 645 !!dynamic cursor name>, 99, , 104, 105, 467, 2 2 269, 471, (R´)0Ñ0ü0Ä 289, (Nã)0, 5 545 2 2 272, 474, 2 2 275, 638, 5 540 !!drop domain constraint , definition>, 0Ô0³4, 2 2SA, 49, 53, 56, 57, 58, 60, 5 50Ö0Ã0·0§0ë 62, 0Ö0Ã0·0§0ë1, 2 243, 448, 2 2 264, , 2 204, 0Ô0³6, 5 50Ö0Ã0·0§0ë 2 2 276, 477, 2 2 289, 49(l4) 2 2 294, , 495, 5 50Ú0Ë0Ò, 647, 5 551 52, (ry)8, 2 2SD, 0Ó0ë0, 2 20Ú0Ë0Ò, , 50, 53, , 55, 57, 59, 60, 62, 0Ø0¯0¿0ü0ë9, 52, (ry)8, 259, 0Ø0¯0¿0ü0ë8, 2 2 283, 2 2 272, 480ª0ü0à 5 544 !!dynamic fetch statement>, , (R´)0Ñ0ü0Ä 292, 62, 0Ø0¯0¿0ü0ë9, 2 2 241, 451, 2 2 256, 293, 646 457, 2 2 269, 470, 2 2 283, 638, !!drop4able statement>, 5(l4) 5 563 (ry)8, 294, (Nã)5, 2 268, 0Ø0ë0Ä8, 480Ñ0ü0Ä 5 544 (T ) Database Language SQL , effective, , ª, , (y>), 50, 50Ñ0ü0Ä 55, 57, 58, 59, (Œ¡), 0Ó0ë, 0Õ0£0ü0È, 0Ö0Ã0·0§0ë, 0Õ0é0ó, 0Ú0Ë0Ò, 5 5(l4) 2 269, 441, 2 2 255, 464, 0Ø0ë0Ä, 41, 49, 51, 72, 73, 2 2 265, 467, 2 2 268, 480Ñ0ü0Ä 5 563 74, 87, 94, 96, (l4) !!dynamic parameter 1, 0Ñ0ü0Ä 10Ø0ë0Ä, ­6, 171, specification>, 5 50Ñ0ü0Ä 0Ñ0ü0Ä 184, 5, 190, 8, 4, 1¬, 6, 168, (R´)1, 2SA, (eå)9, 20Ø0¯0¿0ü0ë, (T )8, 253, 296, 0Õ0¡0é0Ã0É5, 2 2 20Ø0¯0¿0ü0ë, 439, 2 2 243, (ry)6, 258, (ry)9, 273, (y])6, 450, 2 2 253, 454, 2 2 255, 456, 280, (R´)(l4) 289, (Nã)0, 292, 2 2 260, 46(l4) 2 2 267, 525, 5 541, (Nã)4, 299, 0Ô0³0, 2 202, 0Ó0ë0, 67(N) 2 2ª, 0Ó0ë5, 2 2, 0Ó0ë8, 2 2(h*), , 0Õ0¡0é0Ã0É0Ñ0ü0Ä 2 2(Œ¡), 0Õ0£0ü0È0, 2 20Ó0ë, 0Õ0£0ü0È(l4) 53, 56, 57, 58, 59, 60, 2 20Ú0Ë0Ò, 0Ö0Ã0·0§0ë(l4) 2 249, 0Ú0½0Ñ0ü0Ä 2 275, 5 51, 5 5(l4) 2 250, 44(l4) 2 2 252, 0Ú0½6, 2 285, 0Ú0Ë0Ò6, 2 287, 0Ú0Ë0Ò9, 455, 2 2 256, 459, 2 2 262 2 293, 0Ø0ë0Ä5, 2 297, 0Ø0ë0Ä8, 2 2 203, , 53, 56, 57, 2 2 258, 485, 2 2 293, 526, 5(y]), 58, 59, 5 51, 5 5(l4) 2 250, 531, 570, 570Ñ0ü0Ä 574, 576, 44(l4) 2 2 252, 456, 2 2 259, 460, 578, 580, 585, 598, 5 500, 2 2 262, 480Ñ0ü0Ä 5 50Ú0½ 60(l4) 5 504, 656, 5 568, 669 Dynamic SQL, 2 2 2(ry) effectively,  dynamic SQL error, 431, ELSE, 84, 1, 142, 540Ñ0ü0Ä 435, 2 2 20Ø0ë0Ä, 448, 2 2 255, 456, 544, 680 2 2 257, 458, 2 2 259, 460, 2 2 265, !!else clause>, 1, 142, 2 2 267, 621 0ª0ü0à , 50, 53, Embeddable SQL-statements, 55, 57, 59, 5 50, 5 5(l4) 299, 55 0Ø0¯0¿0ü0ë9, 2 2 274, 475, 2 2 283 DYNAMIC_FUNCTION, 80Ñ0ü0Ä 2 2 279, 2 2 281, 48(l4) 2 2 288 - E - EACH, 85 !?ndex (ry) embedded, 1, (l4) 2 2 29, 51, , 61, 489, 2 2 290, 5 51, 5 5(l4) 5 50Ñ0ü0Ä 5 5 55, 5 5 59, 1, 491, 2 2 295, 496, 501, 505, 5, 1­, 489, 2 2 290, 491, 5SD, 51(l4) 5¬, 517, 5(h*) 49(l4) 2 2 293, 494, 2 2 295, 496, , 2 2 297, 498, 2 2 299, 500, 501, 61, 489, 2 2 290, 491, 2 2 295, 502, 504, 505, 506, 507, 517 5SA, 509, 510, 51(l4) 5ª, !!embedded SQL Fortran 514, 5¬, 516, 5, 518, 0rogram>, 5 51, 2 2 289, 491, 519, 5(eå), 521, 5(g ), 610Ñ0ü0Ä 2 2 293, 495, 2 2 296, 498, 5, 5 5, 625, 5 5(y]), 639, 5 551, 510Ñ0ü0Ä 5 655, 5 561, 66(l4) 5 563, 670Ñ0ü0Ä 5 574, 675, 5 578 , 61, 63, 489, 2 2 290, 491, !!embedded character set 2 2 292, 490Ñ0ü0Ä 2 2 296, 497, 2 2 299, declaration>, 2 2 289, 490, 614, 5 5(ry), 627, 5 573, 674, 49(l4) 2 2 293, 495, 2 2 296, 651, 5 578 660µ0ó0Á0ü0à , 489, 2 2 290, declaration>, 55, 2 2 289, 491, 2 2 295 495, 2 2 297, 498, 2 2 299 , 61, 489, 2 2 291, , 490Ñ0ü0Ä 2 2 298, 515, 5­ 61, 489, 2 2 291, 490Ñ0ü0Ä 2 2 295, , 5 51, 2 2 289, 491, !!embedded SQL begin 2 2 293, 495, 2 2 298, 517, 5, declare>, 5 51, 2 2 289, 490, 519 2 2 291, 495, 5 !!embedded SQL PL/I program> !!embedded SQL COBOL , 5 51, 2 2 289, 491, 2 2 293, 0rogram>, 5 51, 2 2 289, 491, 495, 2 2 298, 520, 5(h*), 52() 2 2 293, 495, 2 2 298, 508, 5SD, !!embedded SQL statement>, 510, 5 575 5 51, 1¬, 489, 2 2 290, 491, !!embedded SQL C0rogram>, 2 2 292, 490Ñ0ü0Ä 2 2 295, 501, 505, 5 51, 2 2 289, 491, 2 2 293, 495, 509, 5, 515, 5, 521, 498, 504, 505, 50, 507 5 50Ø0ë0Ä, 651 Embedded syntax, 61 (Œ¡) Database Language SQL , !!escape character>, 2, 1, 5, 1­, 490, 2 2 293, (h*)5, 2, 447, 5 543 494, 5 573 , END, 84, 1, 142, 490, 90, 94, 95, 147, 9, 540Ñ0ü0Ä 544 267 END-EXEC, 84, 2 2 289, 491, 5 580 , (R´), , 171, (y>)8, 20Ø0ë0Ä, 107, 1SD, 0Õ0é0ó6, 2 2 253, 454, (T )0, 241, (T )(N) 502, 658, 5 561 end-af-line indicator, 83, exact numeric value, 28 5 556 EXCEPT, 84, 196, 7, 201, Entry SQL, 5 5(ry), 629, 5 540 (eå)(l4) 576, 640Ñ0ü0Ä 5 580 Entry SQL Specifications, exception, 10, 1(l4) 10Ñ0ü0Ä 2 24, 640 2 25, 2 26, 2 2 21, 2 2 27, 2 2 28, 5(l4) environment, (l4) 14, 16, 2 2 25, 55, 56, 57, 58, 5 50, 5 54, 46, 70, 71, 72, 74, 75, 5 57, 5 59, 5 5 51, 86, 95, 1, 5 5 57, 246, 0Ö0Ã0·0§0ë4, 5 554, 655, (l4) 1(Œ¡), ª5, 10Ø0¯0¿0ü0ë, ª7, 660Ñ0ü0Ä 5 569 146, 7, 148, 9, 150, EQUALS, 85 ¬1, 152, ¬0Ñ0ü0Ä 154, ¬8, !!equals operator>, 80, (eå)7, 163, ­7, 203, (h*)5, 20Ó0ë, 2 291, 434, 2 2 20Ú0Ë0Ò, 479, 500, (y>)0Ñ0ü0Ä 20Ö0Ã0·0§0ë, (y>)5, 20Ø0¯0¿0ü0ë, (ry)0Ñ0ü0Ä 505 279, (Nã)9, 2 20Ú0Ë0Ò, 0Ö0Ã0·0§0ë8, 2 249, EQUAL_KEY_DEGREES, 5 5 EQUAL_KEY_DEGREES assertion 2 250, 0Ø0¯0¿0ü0ë0Ñ0ü0Ä 2 275, 0Ú0½8, 2 279, , 5 5 0Ú0Ë0Ò0, 2 281, 0Ú0Ë0Ò(l4) 2 283, 0Ú0Ë0Ò4, equivalent, 1, , ¬, 61, 2 286, 0Ú0Ë0Ò9, 2 292, 0Ø0ë0Ä0Ñ0ü0Ä 2 294, 5 5(l4) 5 5 51, 86, 87, 9(l4) 90Ñ0ü0Ä 400, 2 2 203, 404, 2 2 205, 407, 94, 100, 1SA, 1, 142, 2 2 2SA, 409, 2 2 210, 41(l4) 2 2 2ª, 146, 7, 174, 1, 197, 415, 2 2 2, 419, 2 2 2(eå), 42(l4) 8, 2, (h*)(l4) 2, (g )9, 2 2 20Ó0ë, 430Ñ0ü0Ä 2 2 20Õ0é0ó, 439, 2 2 241, 241, (T )5, 246, (Œ¡)0Ñ0ü0Ä 264, 440Ñ0ü0Ä 2 2 247, 448, 2 2 249, 450, 0Õ0£0ü0È0Ñ0ü0Ä 2 288, 0Ø0ë0Ä7, 2 2 292, 496, 2 2 251, 455, 2 2 256, 457, 2 2 258, 501, 50(l4) 50, 507, 510, 459, 2 2 260, 46(l4) 2 2 265, 466, 510Ñ0ü0Ä 5­, 518, 5, 521, 2 2 267, 479, 2 2 282, 485, 2 2 286, 5(g ), 530µ0ó0Á0ü0à 489, 2 2 295, 497, 2 2 298, 499, error in assignment, 435, 5(Œ¡), 527, 5(R´), 624, 5 554, 2 2 20Ø0ë0Ä, 620 655, 5 562, 666, 5 567, 67() ESCAPE, 84, (h*)4, 2¬, 0Õ0é0ó0µ0ó0Á0ü0à EXCEPTION, 84, 479, 5 580 exception condition, 10 Index 27 Exceptions, 10 explicit, 8, 10, ¬, (eå), EXEC, 84, 489, 2 2 291 (y>), 0Ó0ë, 0Õ0é0ó, 41, 44, 45, EXECUTE, 84, 2 254, 459, 2 2 262, 50, 66, 67, 68, 69, 70, 2 2 283, 680 71, 72, 74, 86, 101, !!execute immediate 102, 104, 1, 5, 10Ô0³, statement>, 14, 2 2 24, 0Ñ0ü0Ä 152, ¬0Ñ0ü0Ä 174, 6, 45, 54, 59, 61, 63, 64, 197, 8, 202, (T )1, 242, 5 5 50Ñ0ü0Ä 90Ñ0ü0Ä 100, 101, 1¬, (ry)0Ñ0ü0Ä 256, (ry)8, 260, (y])0, 0Ø0¯0¿0ü0ë9, 2 2 2¬, 417, 2 2 2, 46(l4) 272, (R´)0Ñ0ü0Ä 284, (Nã)(l4) 294, 2 2 283, 650Ñ0ü0Ä 5 554, 656 (Nã)6, 297, 0Ô0³0, 2 201, 0Ô0³(l4) !!execute statement>, , 2 204, 0Ô0³9, 2 2, 0Ó0ë(l4) 2 2ª, 54, 59, 5 51, 5 54, 2 269, 0Ó0ë5, 2 2­, 0Ó0ë8, 2 2(h*), 0Õ0¡0é0Ã0É0Ñ0ü0Ä 441, 2 2 247, 448, 2 2 255, 456, 2 2(ry), 0Õ0¡0é0Ã0É6, 2 2(R´), 0Õ0¡0é0Ã0É9, 2 20Õ0£0ü0È, 2 2 257, 459, 2 2 260, 480Ñ0ü0Ä 5 563 0Õ0£0ü0È4, 2 20Õ0é0ó, 0Ö0Ã0·0§0ë1, 2 248, 0Ú0½7, !!existing character set 2 279, 0Ø0ë0Ä(l4) 2 2 200, 446, 2 2 247, name>, 0Ó0ë1, 2 2 469, 2 2 274, 488, 2 2 293, 579, EXISTS, 84, 2(g ), (y])1, 273, 2 203, 544, 576, 617, 5 5 584, 594, 629, 5 50Õ0¡0é0Ã0É, 654, !!exists0redicate>, 191, 5 555, 656, 5 561, 66(l4) 5 567 (eå)5, 2(g ) Explicit, (y>), (T ), (ry), (Œ¡), 0Õ0é0ó, ­1, 187, 0Ú0½() !!explicit4able>, 196, 7, 202, 63() explicit type conversion, 2 25 !!exponent>, 90, 95 exposed, 8, 1 , 62, 99, 10(l4) 104, 440Ñ0ü0Ä 2 2 262, 465, 2 2 266, 467, 5 5(Nã), 657 !!extended statement name>, 62, 99, 10(l4) 104, 447, 2 2 248, 465, 5 5(Nã), 657, 5 572 Extensions and options, 626 EXTERNAL, 84, 2 2, 0Õ0¡0é0Ã0É0, 5 561, 680 !!external collation>, 2 2, 0Ó0ë7 (R´) Database Language SQL , fixed-length, 90Ñ0ü0Ä 94, 1¬, 2 2, 0Ó0ë5 5, 147, 8, 150, ¬1, !!external4ranslation>, 2 2(eå) 161, ­(l4) 163, (y>)1, 20Õ0¡0é0Ã0É, (y>)4, 20Õ0é0ó, (y>)7, 268, 506, , 0Õ0¡0é0Ã0É0, 2 2(h*) 507, 658 EXTRACT, 84, 1(R´), ª0, 2 2 244, fixed-length coding, 5, 5 5 680 flagger, 5 5 56, 5 5 57, 5 5(Œ¡), 656 , (Nã), Flagger requirements, 5 5(Œ¡) 0Ö0Ã0·0§0ë, 8, 1(Nã), ª0, 10Ó0ë, FLOAT, 19, 27, 2 24, 84, 1SA, 5 541, 659 0, 2 261, 425, 2 2 2(Œ¡), 429, !!extract field>, 8, 1(Nã), 2 2 240, 520, 5(g ), 571, 5 557, 10Ô0³, 444 658 , 8, 1(Nã), !!fold>, 2(l4) 10Õ0¡0é0Ã0É, ª0Ñ0ü0Ä 10Õ0é0ó, 10Ô0³ ª6, 10Ú0½, 444, 5 50Ô0³ - F - FOR, 84, 10Õ0¡0é0Ã0É, ª0Ñ0ü0Ä 149, , ¬7, 168, ­9 ¬1, 2 2, 0Õ0¡0é0Ã0É0, 2 20Õ0£0ü0È, 0Õ0£0ü0È5, FALSE, 84, (g )9, 20Ô0³, 0Õ0é0ó6, 2 20Ø0¯0¿0ü0ë, 0Õ0£0ü0È7, 2 262, 0Ø0¯0¿0ü0ë0Ñ0ü0Ä 2 264, 5 580 0Ø0¯0¿0ü0ë6, 2 271, 0Ú0½(l4) 2 273, 0Ú0½4, feature not supported, 407, 2 292, 445, 2 2 264, 465, 2 2 274, 2 2 210, 621 635, 5 50Ú0Ë0Ò FETCH, 84, 0Ú0½7, 2 2 269, 480µ0ó0Á0ü0à FOREIGN, 84, 264, (y])4, 569, , 2 277, 570Ñ0ü0Ä 574, 576, 580, 580Ñ0ü0Ä 0Ú0½8, 2 279, 0Ú0Ë0Ò0, 2 2 269, 635, 584, 585, 587, 588, 590, 5 50Ú0Ë0Ò 591, 595, 596, 598, 600, !!fetch statement>, 50, 53, 5 502, 605, 5 50, 608, 5 510, 55, 57, 58, 59, 2 250, 618 2 268, 0Ú0½7, 2 280, 480Ñ0ü0Ä 5 50Õ0é0ó, Format, 9, , , ¬, 86, 5 547, 671, 5 577 407, 2 2 2SA, 415, 2 2 2, 419, !!fetch target list>, 0Ú0½7, 2 2 2(eå), 431, 2 2 243, 447, 2 2 259, 2 279, 0Ú0Ë0Ò0, 2 2 270, 647, 5 571 46(l4) 2 2 265, 525, 5(Œ¡), 625, Fields in datetime items, 5 563, 665, 5 567 0Ô0³ form-af-use, 5 5, (eå), (h*), (g ), Fields in day-time!?NTERVAL 99, 100Ñ0ü0Ä 104, ª(l4) 10Õ0£0ü0È, items, 0Õ0¡0é0Ã0É ª4, 10Ø0¯0¿0ü0ë, ª7, 148, 9, Fields in9ear-month !?NTERVAL items, 2 2(N) ¬1, 248, (T )9, 250, 444, FIRST, 84, 0Õ0é0ó(l4) 2 277, 0Ú0½8, 5 507, 619, 5 50Ô0³, 657, 5 559, 2 279, 680 660 Index 29 form-af-use conversion, 6, FROM, 84, 1(R´), ª0, 10Õ0¡0é0Ã0É, 20, 2(l4) 103, 104, 10Õ0£0ü0È, ª0Ñ0ü0Ä 10Ö0Ã0·0§0ë, 9, 151, ¬(l4) ª4, 10Ø0¯0¿0ü0ë, ª7, 2 2 244, 630, 153, ¬4, 178, 0, 182, 5 557, 659 0Ñ0ü0Ä 184, 7, 198, (y])1, !!form-af-use conversion>, 272, (y])0Ñ0ü0Ä 276, (R´)9, 294, 2(l4) 10Õ0¡0é0Ã0É, ª0Ñ0ü0Ä 10Ø0¯0¿0ü0ë, ª7, 0Ô0³0, 2 203, 0Ó0ë0, 2 2, 0Ó0ë0Ñ0ü0Ä 444, 5 50Ô0³, 659 2 2, 0Ó0ë8, 2 2(eå), 0Õ0¡0é0Ã0É0Ñ0ü0Ä 2 20Õ0£0ü0È, , 99, 103, 104, 2 280, 0Ú0Ë0Ò4, 2 286, 400Ñ0ü0Ä 2 2 207, 10Õ0¡0é0Ã0É, ª0Ñ0ü0Ä 10Ö0Ã0·0§0ë, ª6, 5 50Ô0³, 408, 2 2 2¬, 417, 2 2 2, 420, 657 2 2 20Ó0ë, 44(l4) 2 2 244, 445, 2 2 247, FORM_OF_USE, 554, 606, 5 507, 465, 2 2 269, 47(l4) 2 2 276, 485, 665 50Ú0½, 538, 50Ø0ë0Ä, 541, 542, FORTRAN, 80Ñ0ü0Ä 243, 0Õ0é0ó9, 2 264, 540Ñ0ü0Ä 544, 545, 546, 547, 490Ñ0ü0Ä 5 5, 610Ñ0ü0Ä 5 5 548, 549, 550, 551, 552, , 490, 5, 510µ0ó0Á0ü0à 553, 554, 555, 556, 557, , 5, 510Ñ0ü0Ä 5, 571, 57(l4) 573, 576, 578, 5 50Ø0ë0Ä, 651 580, 581, 580Ñ0ü0Ä 584, 585, !!Fortran variable 586, 588, 591, 590Ñ0ü0Ä 595, definition>, 490, 5, 596, 5 504, 606, 5 5SA, 610, 510µ0ó0Á0ü0à 5 5, 616, 5 5, 618, 5 547 FOUND, 84, 0Õ0é0ó(l4) 2 2 297, 499 , 1, 7, 8, 179, 5, 187, 9, 193, 631, 5 50Õ0é0ó, 636, 5 50Ú0Ë0Ò FULL, 42, 84, 0, 182, 4, 2(T ), (g )5, 274, (y])6, 277, (y])8, 590, 591, 5 5ª, 618, 5 580 Full SQL, 625 Function, 9, 10 0Ô0³ Database Language SQL - G - !!get diagnostics statement> ??ENERAL, 85 , 54, 2 269, 479, 2 2 281, , 89, 97 48(l4) 2 2 284, 485, 2 2 288, 651 generally contain, 11, 1(y]), !!get item information>, 2 2 20Ö0Ã0·0§0ë ª9, 186, (R´)1, 282, (Nã)6, GLOBAL, 0Ú0Ë0Ò, 84, 99, 104, 0Ô0³1, 2 207, 0Õ0¡0é0Ã0É5, 2 275, 0Ú0Ë0Ò7, 260, (Œ¡)1, 576, 577, 5 50Õ0£0ü0È, 2 290, 0Ø0ë0Ä(l4) 2 296, 474, 5 50Ø0¯0¿0ü0ë, 680 5 541 global temporary table, 2 27, generally5nderlying table, 2 28, 2 29, 5 5 5(l4) 258, (Œ¡)0, 0Ú0Ë0Ò, 0Ñ0ü0Ä 299, 0Ú0½(l4) 2 287, 261, (y])5, 281, 630Ñ0ü0Ä 5 555, 2 289, 0Ø0ë0Ä0, 2 292, 0Ø0ë0Ä6, 2 2 274 668 General Rules, 9, 10, , ??O, 84, 2 2 297, 499 10Ñ0ü0Ä 14, 15, 2 2 20, 2 2 24, 5 59, ??OTO, 84, 2 2 297 70, 76, 6, 187, (eå)(l4) , 2 2 297, 498, 2 2 299 , 2 2 297, 498 205, (ry)0Ñ0ü0Ä 258, (Œ¡)1, 278, ??RANT, 65, 75, 84, (T )8, (y])9, 282, (R´)4, 289, (Nã)(l4) 2 2¬, 0Õ0¡0é0Ã0É1, 2 2(Nã), 0Õ0£0ü0È0, 2 20Ó0ë, 294, 0Ô0³0, 2 250, 0Õ0é0ó1, 2 276, 0Õ0£0ü0È(l4) 2 20Õ0£0ü0È, 0Õ0£0ü0È5, 2 20Ø0¯0¿0ü0ë, 0Õ0£0ü0È7, 0Ú0½9, 2 283, 0Ú0Ë0Ò9, 2 293, 0Ø0ë0Ä5, 2 2 284, 530Ñ0ü0Ä 5 501, 600Ñ0ü0Ä 5 505 400Ñ0ü0Ä 2 2 2ª, 441, 2 2 243, 456, grantable privilege, 5 56 2 2 257, 458, 2 2 260, 460Ñ0ü0Ä 2 2 264, ??RANTEE, 539, 542, 545, 465, 2 2 267, 468, 2 2 269, 470, 546, 547, 548, 554, 555, 2 2 271, 47(l4) 2 2 275, 476, 2 2 277, 556, 5 500, 601, 5 502, 600Ñ0ü0Ä 485, 2 2 295, 528, 50Ô0³, 625, 5 504, 605 5 562, 660Ñ0ü0Ä 5 572, 670Ñ0ü0Ä 5 577 !!grantee>, (T )5, 246, 0Õ0¡0é0Ã0É9, !!general set function>, 2 20Ô0³, 0Õ0£0ü0È1, 2 20Õ0¡0é0Ã0É, 0Õ0£0ü0È0Ñ0ü0Ä 2 20Ú0Ë0Ò 4, 1(Œ¡), 630, 5 541 GRANTOR, 546, 547, 548, , 4, 1­, 7, !!grant statement>, 52, 65, 2 202, 0Ø0¯0¿0ü0ë(l4) 5 541, 658 66, (T )5, 248, (ry)5, 2 2¬, GET, 84, 2 2, 434, 2 2 279, 0Õ0¡0é0Ã0É1, 2 2(Nã), 0Õ0£0ü0È0, 2 20Ó0ë, 0Õ0£0ü0È(l4) 480Ñ0ü0Ä 2 2 284, 680 2 268, 484 , 2 2 20Ö0Ã0·0§0ë !!greater than operator>, , 434 !!greater than or equals !!get descriptor statement>, operator>, 83, (eå)7 54, 5 50, 5 5(l4) 2 269, 434, ??ROUP, 84, 7, 5 5­, 617 435, 2 2 20Ø0¯0¿0ü0ë, 480Ñ0ü0Ä 5 572 Index 2 21 , 2 28, 1, - I - 177, 7, 189, 0Ñ0ü0Ä 203, identified privilege 296, 0Ú0Ë0Ò0Ñ0ü0Ä 5 50Ó0ë, 635, 5 543 descriptor, 0Õ0£0ü0È5 grouped table, 2 28, 1(T ), !!identifier>, 2 2 24, 2 2 26, 5 5(l4) 7, 187, 9, 192, 4 5 5 51, 5 5 50Ñ0ü0Ä 98, 99, 100, grouped view, 7, 179, 10(l4) 105, 408, 2 2 2, 431, 5, 203, (Nã)6, 2 283, 631, 2 2 247, 451, 2 2 265, 481, 50Õ0£0ü0È, 5 50Õ0¡0é0Ã0É, 635, 5 543 534, 564, 630, 5 556, 657, !!grouping column reference> 5 577 , 7 s for use , 7 statement>, 481 -?! - , 8(l4) 86, ?!AVING, 84, 189 87, 88, 100, 530Ñ0ü0Ä 5 5(Nã), , 2 28, 1, 640 1(ry), 7, 181, 5, 189, !!identifier0art>, 82, 86 0Ñ0ü0Ä 203, (Nã)6, 2 283, 631, , 82, 85, 5 50Õ0é0ó, 640Ñ0ü0Ä 5 578 86 !!hexit>, 89, 90, 92, 94 IDENTITY, 84, 0Õ0¡0é0Ã0É0, 2 2(h*), 680 , 82, !?F, 85 86, 89, 9(l4) 94, 95, 97, !?GNORE, 85 266, (Œ¡)7, 5 5(Nã) immediate, 40, 41, (ry)0Ñ0ü0Ä !!high>, 16, 17 270, 0Õ0¡0é0Ã0É6, 2 250, 401, 5(R´), , 2 2 290, 575, 587, 599 2 2 292, 495, 2 2 296 !?MMEDIATE, 84, (ry)(l4) 253, , (y])0, 2 201, 0Õ0¡0é0Ã0É5, 2 2 201, 400Ñ0ü0Ä 497, 2 2 298, 499 2 2 262, 480Ñ0ü0Ä 5 50Õ0£0ü0È, 680 , immediate base, 299 497, 2 2 298, 499 immediately contain, 11, host variable, (y>), (T ) 14, 1, 9, 1(g ), 9, !!host6ariable definition>, 155, ¬7, 166, ­7, 173, 2 2 289, 490, 2 2 292, 494, 2 2 295, 4, 191, (l4) 193, (eå)0, 496 203, (Œ¡)0Ñ0ü0Ä 271, (y])(l4) 297, HOUR, 0Ô0³, 0Ó0ë, 0Õ0¡0é0Ã0É, 0Õ0£0ü0È, 73, 0Ô0³(l4) 2 2, 0Ó0ë5, 2 2(eå), 0Õ0£0ü0È5, 84, 95, (l4) 1ª, 0Ñ0ü0Ä 2 290, 0Ø0ë0Ä(l4) 2 296, 408, 2 2 2(g ), 10Ô0³, ­6, 167, (y>)8, 20Ø0ë0Ä, 431, 2 2 244, 465, 2 2 274, 648 240, 42(l4) 2 2 20Ô0³, 441, 5 580 !!hours value>, 91, 94 0Õ0¡0é0Ã0É Database Language SQL immediately-executable !!implementation-defined SQL-statement, 57 collation name>, 0Ó0ë4, implementation-defined, 5 5, 2 2¬, 661 20, 21, 28, 29, 2 24, 2 2 24, !?mplementation-defined 2 2 25, 2 2 26, 2 2 27, 51, 56, 5 51, elements, 650ª0ü0à 5 54, 5 57, 5 59, 5 5 51, 5 5 5(l4) 5 5 50Ñ0ü0Ä !!implementation-defined 74, 77, 83, 87, 93, 101, 4ranslation name>, 0Õ0¡0é0Ã0É0, 10(l4) 103, 104, 1SA, 109, 2 2(h*), 661 110, (l4) 1¬, 6, 1(ry), !!implementation-defined 9, 10Õ0£0ü0È, ª4, 146, 7, 5niversal character ¬7, 158, ­1, 162, 1, form-of-use name>, (T )8, (y>)0Ñ0ü0Ä 20Õ0é0ó, (y>)8, 240, (T )8, 249, 660 249, (ry)0, 256, 0Ó0ë1, 2 2, implementation-dependent, 0Ó0ë5, 2 2, 0Õ0¡0é0Ã0É0, 2 2(h*), 0Ö0Ã0·0§0ë1, 5 5, 10, , ª, , 0Ú0½, 2 244, 0Ö0Ã0·0§0ë8, 2 256, 0Õ0é0ó7, 2 258, 0Ø0ë0Ä, 40, 48, 49, 50, 51, 2 259, 0Ø0¯0¿0ü0ë0, 2 261, 0Ø0¯0¿0ü0ë(l4) 2 263, 64, 65, 66, 69, 72, 74, 2 264, 0Ø0¯0¿0ü0ë5, 2 266, 0Ú0½0Ñ0ü0Ä 2 2 200, (l4) 140, 1, 174, (l4) 404, 2 2 207, 408, 2 2 2(eå), 42(l4) 197, 9, 200, (eå)8, 20Ú0½, 2 2 20Ó0ë, 43(l4) 2 2 240, 441, 2 2 242, (y])0, 279, (Nã)6, 2 202, 0Ô0³9, 440Ñ0ü0Ä 2 2 245, 447, 2 2 252, 454, 2 242, 0Ö0Ã0·0§0ë6, 2 250, 0Õ0é0ó1, 2 273, 2 2 281, 485, 2 2 286, 488, 2 2 292, 0Ú0½9, 2 280, 0Ú0Ë0Ò(l4) 2 283, 0Ø0ë0Ä7, 501, 502, 506, 5SD, 510, 2 2 200, 41(l4) 2 2 20Õ0é0ó, 436, 2 2 240, 5ª, 516, 5, 521, 5(g ), 441, 2 2 248, 45(l4) 2 2 254, 485, 525, 5(Œ¡), 527, 5(R´), 529, 2 2 293, 494, 2 2 295, 526, 50Ô0³, 50Ó0ë, 564, 565, 586, 5 507, 531, 5 507, 667, 5 568, 669, 609, 5 5, 610Ñ0ü0Ä 5 5, 615, 5 570, 671, 5 572, 670Ñ0ü0Ä 5 574, 5 5, 624, 5 5(Œ¡), 630, 5 553, 677, 5 578 654, 5 555, 656, 5 557, 658, Implementation-dependent 659, 5 560, 661, 5 562, 660Ñ0ü0Ä elements, 5 567 5 564, 665, 5 566 !!implementation-defined character repertoire name>, 20, 248, (T )9, 0Ó0ë1, 5 560 Index 2 20ª0ü0à implicit, ª, (eå), 0Ó0ë, 41, !?N, 84, 1(R´), (h*)(l4) 2 2 245, 539, 44, 67, 69, 70, 71, 72, 542, 540Ñ0ü0Ä 545, 546, 547, 5 5 50Ñ0ü0Ä 5 5 54, 101, 10(l4) 103, 548, 554, 555, 556, 570, 104, 1SA, 109, 110, 1, 571, 57(l4) 573, 574, 576, 1¬, 1, 1(g ), 4, 1(ry), 578, 580, 581, 583, 584, ª0, 10Ö0Ã0·0§0ë, (l4) 143, 9, 585, 586, 588, 590, 591, 151, ¬(l4) 153, ­6, 174, 590Ñ0ü0Ä 595, 596, 598, 600, 1, 182, (y>)(l4) 240, (T )1, 5 502, 604, 5 50, 608, 5 5, 242, (ry)(l4) 253, (ry)5, 256, 61(l4) 5 5ª, 618 258, (Œ¡)0, 263, (Œ¡)6, 268, include, 6, 10Ñ0ü0Ä 14, 15, 19, (y])0, 272, (y])5, 276, (R´)0Ñ0ü0Ä 21, 2(l4) 2 20, 2 2(l4) 2 24, 2 26, (R´)4, 292, (Nã)4, 296, (Nã)7, 2 27, 2 29, 2 2 20, 2 2 21, 2 2 2(l4) 2 2 20Ñ0ü0Ä 0Ô0³0, 2 201, 0Ô0³(l4) 2 204, 0Ô0³9, 2 2 24, 2 2 28, 50, 5 5 55, 5 5 56, 86, 0Ó0ë1, 2 2, 0Ó0ë0Ñ0ü0Ä 2 2¬, 0Ó0ë6, 100, 1, 1, 1, 1(g ), 2 2, 0Õ0¡0é0Ã0É0, 2 2(h*), 0Õ0¡0é0Ã0É0Ñ0ü0Ä 2 2(ry), 6, 10Õ0é0ó, 5, 153, 6, 0Õ0¡0é0Ã0É6, 2 2(R´), 0Õ0¡0é0Ã0É9, 2 20Õ0£0ü0È, 0Õ0£0ü0È4, 192, 0Ñ0ü0Ä 194, (y>)6, 246, 2 20Õ0é0ó, 0Ö0Ã0·0§0ë1, 2 244, 0Ø0¯0¿0ü0ë(l4) 2 263, (T )8, 249, (ry)0, 251, (ry)0Ñ0ü0Ä 0Ø0¯0¿0ü0ë4, 2 265, 0Ø0¯0¿0ü0ë6, 2 267, 0Ú0½(l4) 260, (Œ¡)1, 264, (Œ¡)5, 268, 2 277, 0Ú0½9, 2 288, 0Ø0ë0Ä(l4) 2 297, (y])0, 271, (y])0Ñ0ü0Ä 275, (y])6, 0Ø0ë0Ä9, 2 2 200, 400Ñ0ü0Ä 2 2 205, 407, 282, (R´)0Ñ0ü0Ä 284, (R´)8, 289, 2 2 2, 431, 2 2 246, 447, 2 2 269, (Nã)1, 292, (Nã)4, 296, (Nã)7, 474, 2 2 276, 477, 2 2 288, 49(l4) 299, 0Ô0³0, 2 201, 0Ô0³(l4) 2 204, 2 2 293, 501, 50, 510, 5ª, 0Ô0³8, 2 2SD, 0Ó0ë0, 2 2, 0Ó0ë(l4) 518, 5(h*), 579, 584, 594, 2 2ª, 0Ó0ë5, 2 2­, 0Ó0ë8, 2 2(h*), 5 50Õ0£0ü0È, 655, 5 556, 657, 5 560, 0Õ0¡0é0Ã0É0Ñ0ü0Ä 2 2(ry), 0Õ0¡0é0Ã0É6, 2 2(R´), 0Õ0¡0é0Ã0É9, 661, 5 562, 660Ñ0ü0Ä 5 564, 669, 2 20Ô0³, 0Õ0£0ü0È1, 2 20Õ0é0ó, 0Õ0£0ü0È6, 2 20Ú0½, 5 572 0Ú0½(l4) 2 283, 0Ú0Ë0Ò4, 2 286, 0Ú0Ë0Ò9, !?mplicit, 20Ñ0ü0Ä 24, 25, 26, 2 292, 0Ø0ë0Ä4, 2 297, 45(l4) 2 2 254, 2 25, 1(g ), ª4 495, 2 2 296, 505, 50, 521, implicit type conversion, 569, 581, 5 50Õ0é0ó, 640, 5 541, 2 25 640Ñ0ü0Ä 5 568, 686 implicit+ero-bit padding, !?ncompatibilities7ith 149, ¬1, 152, (y>)(l4) 268, ISO/IEC 9075:1989, 5 577 620µ0ó0Á0ü0à independent, 14, 2 20Õ0é0ó, 0Õ0£0ü0È6 independent node, 2 20Õ0é0ó, 0Õ0£0ü0È6 !?ndex4ypography, 15 indicator, (y>)1, 5 556 0Ö0Ã0·0§0ë Database Language SQL INDICATOR, 84, 1, 0Õ0é0ó(l4) !?NFORMATION_SCHEMA, 20, 2 2 25, 0Õ0é0ó0Ñ0ü0Ä 2 2 2(y]), 434, 2 2 20Õ0é0ó, 436, 5 5 55, 103, (T )9, 2 255, 530Ñ0ü0Ä 439, 2 2 252, 450Ñ0ü0Ä 2 2 255, 456, 50Õ0é0ó, 536, 50Ú0½, 538, 50Ø0ë0Ä, 2 2 258, 500, 502, 670µ0ó0Á0ü0à 541, 542, 540Ñ0ü0Ä 545, 546, indicator overflow, 20Ó0ë, 547, 548, 549, 550, 551, 5 5(eå) 55(l4) 553, 554, 555, 556, indicator0arameter, 48, 557, 558, 559, 561, 562, 1, 5, 1­, (l4) 20Ó0ë, 568, 569, 570, 573, 574, 0Õ0é0ó6, 2 2 20Õ0é0ó, 436, 2 2 20Ø0ë0Ä, 630, 576, 578, 580, 580Ñ0ü0Ä 584, 5 559, 661 585, 588, 590, 593, 595, !!indicator parameter>, 4, 596, 598, 5 500, 60(l4) 5 504, 1¬, 6, 192, 436, 2 2 20Ø0ë0Ä, 606, 5 507, 608, 5 5SD, 610, 630, 5 559 5 5, 665 Indicator parameters, 48 !?NFORMATION_SCHEMA Schema, indicator variable, 47, 48, 535 1, 5, 1­ !?NFORMATION_SCHEMA_CATALOG_ !!indicator variable>, 1, NAME, 50Ø0¯0¿0ü0ë, 537, 50Ú0Ë0Ò, 1¬, 6, 192, 630, 5 559 539, 541, 54(l4) 543, 545, !?nformation Schema, 1, 10, 2 2 25, 5 50Ñ0ü0Ä 5 56, 5 59, 5 5 55, 5 5 57, 546, 547, 548, 549, 550, (R´)(l4) 299, 0Õ0¡0é0Ã0É6, 2 298, 530Ñ0ü0Ä 551, 55(l4) 553, 554, 555, 50Ö0Ã0·0§0ë, 535, 50Ø0¯0¿0ü0ë, 538, 540, 556, 557, 558, 559, 561, 541, 542, 540Ñ0ü0Ä 545, 546, 562 547, 548, 549, 550, 551, INFORMATION_SCHEMA_CATALOG_ 552, 550Ñ0ü0Ä 554, 557, 558, NAME base table, 50Ø0¯0¿0ü0ë 560, 561, 56(l4) 563, 567, INFORMATION_SCHEMA_CATALOG_ 568, 640, 5 552, 667 NAME_CARDINALITY, 537 Information Schema and !?NFORMATION_SCHEMA_ Definition Schema, 50Õ0£0ü0È CATALOG_NAME_CARDINALITY assertion, 50Ú0½ INFORMATION_SCHEMA_CATALOG_ NAME_PRIMARY_KEY, 536 !?nformative elements, 9 INITIALLY, 84, 252, (ry)0Ñ0ü0Ä 270, 0Ô0³1, 2 2(ry), 541, 549, 550Ñ0ü0Ä 574, 575, 585, 587, 598, 599, 5 50Õ0£0ü0È, 680 !?ndex 0Õ0é0ó initially deferred, 575, insufficient item 587, 599 descriptor areas, 45(l4) initially immediate, (ry)0Ñ0ü0Ä 2 2 253, 620ª0ü0à 575, 587, 599 !?NT, 84, 108, 2 256, 0Õ0é0ó7, !?NITIALLY_DEFERRED, 541, 2 266, 500, 502, 515, 5­ 549, 553, 574, 575, 585, INTEGER, 19, 27, 2 24, 84, 587, 598, 599 1SA, 0, 2SD, 0Õ0é0ó(l4) 2 257, INNER, 84, 180, 1, 182, 0Õ0é0ó8, 2 259, 0Ø0¯0¿0ü0ë0, 2 261, 425, 0Ñ0ü0Ä 5 580 2 2 2(Œ¡), 429, 2 2 240, 50(l4) 507, innermost, 8, , 8 510, 5, 510Ñ0ü0Ä 5, 516, !!in0redicate>, 205, (h*)(l4) 5, 519, 5(g ), 565, 571, 2 2 244, 446 657, 5 562 !!in0redicate6alue>, 2 integrity constraint, 1, !?NPUT, 84, 450, 5 580 2 2 20, 5 57, 5 59, 5 5 54, 154, input parameter, 5 51, 5 5(l4) 0Ö0Ã0·0§0ë7, 2 248, 0Õ0é0ó0, 2 257, 0Ø0¯0¿0ü0ë(l4) 20Ø0¯0¿0ü0ë, (ry)0Ñ0ü0Ä 270, 0Õ0¡0é0Ã0É5, 2 285, 2 263, 0Ø0¯0¿0ü0ë4, 2 265, 0Ø0¯0¿0ü0ë6, 2 267, 0Ú0Ë0Ò7, 2 2 203, 486 2 2 259, 467, 5 561 !?ntegrity constraints, 40 !?NSENSITIVE, 50, 84, 0Ú0½1, integrity constraint 0Ú0½(l4) 2 274, 0Ú0½6, 2 2 264, 465, 6iolation, ¬4, 20Ø0¯0¿0ü0ë, 5 50Õ0é0ó, 638, 5 580 (ry)0Ñ0ü0Ä 2 2 203, 486, 5 5(h*), 62() INSERT, 64, 66, 84, (T )5, !!integrity no>, 16, 17 246, (Œ¡)1, 284, (R´)9, 298, !!integrity yes>, ­,  0Õ0¡0é0Ã0É9, 2 20Ô0³, 0Õ0£0ü0È0Ñ0ü0Ä 2 20Ö0Ã0·0§0ë, 0Ú0Ë0Ò8, , ­,  Intermediate SQL, 625, 5 5(Nã) 0Ú0Ë0Ò9, 2 298, 484, 5 500, 601, Intermediate SQL 60(l4) 5 503, 63(N) Specifications, 5 5(Nã) !!insert column list>, 174, INTERSECT, 84, 196, 7, 0Ú0Ë0Ò8, 2 289, 446 200, (eå)1, 202, (eå)8, 5 543, 670, 5 580 , 0Ú0Ë0Ò8, 2 290, 648 INTERVAL, , 0Ô0³, 0Ó0ë, 0Õ0¡0é0Ã0É, , 53, 55, 0Õ0£0ü0È, 49, 73, 83, 84, 91, 56, 58, 59, 1, 0Ñ0ü0Ä 94, 108, 1, 0Ñ0ü0Ä 1(y>), 174, 6, 202, (Nã)9, 2 269, ­6, 167, ­9, 170, (eå)9, 0Ú0Ë0Ò8, 2 290, 44(l4) 2 2 244, 446, 2(y]), (g )8, 2 253, 42(l4) 2 2 2(Œ¡), 2 2 284, 485, 5(ry), 631, 5 50Õ0¡0é0Ã0É, 427, 2 2 2(Nã), 434, 2 2 20Ø0¯0¿0ü0ë, 439, 636, 5 542, 648, 5 573 2 2 240, 441, 2 2 245, 450Ñ0ü0Ä 2 2 254, 2 2 255, 456, 2 2 257, 571, 5 563, 680 2 26 Database Language SQL interval data4ype descriptor, 29, 2 20 , 8, 1(Nã), ª0, 155, , 168, ­9 ¬6, 165, ­6, 167, ­8, interval field overflow, 169, 0, 171, 42(l4) 5 542 ¬4, 20Õ0£0ü0È, (y>)5, 5 5(eå) intervening, 11, 2 26, 1, , INTO, 84, 0Ú0½7, 2 282, 0Ú0Ë0Ò8, 0Õ0£0ü0È, 96, 0Ñ0ü0Ä 1(Nã), (y>)9, 2 2 251, 459, 2 2 269 (T )0, 241, (T )(l4) 2 2 2(y]), 445, , 46, 89, 93, 2 2 253, 455, 5 560 98, 100 , 0Õ0¡0é0Ã0É, (l4) in5sage by, 2 201, 0Ô0³7 170, (eå)9, 20Ø0ë0Ä, (T )0, 241, invalid authorization (T )(l4) 2 2 2(y]), 445, 2 2 253, 455, specification, 0Ö0Ã0·0§0ë8, 660 2 2 207, 408, 2 2 2(eå), 621 , 89, 91, invalid catalog name, 2 2 2¬, 94, 95, 96, 97, 267, 640 621 , ­8, invalid character set name, ­9 2 2 2, 621 , 0Ô0³, invalid character6alue 0Õ0¡0é0Ã0É, 91, 94, 95, 96, 108, for cast, 146, 7, 148, 1, 0Ñ0ü0Ä 168, 0, 171, 9, 150, ¬1, 152, ¬0Ñ0ü0Ä (y>)9, 240, (T )1, 242, (Œ¡)7, 154, 620 2 2 2(y]), 429, 2 2 245, 450Ñ0ü0Ä 2 2 255, invalid condition number, 644 2 2 200, 485, 5 5(h*) !?ntervals, 0Õ0¡0é0Ã0É invalid connection name, !!interval string>, 82, 86, 2 2 2SA, 62() 91 invalid cursor name, 440Ñ0ü0Ä !!interval4erm ´, ­8, 2 2 262, 465, 2 2 266, 467, 5 5(g ) ­9, 170 invalid cursor state, 0Ú0½5, !!interval4erm (ŒÇ), ­8, 169 2 278, 0Ú0Ë0Ò1, 2 284, 0Ø0ë0Ä(l4) 2 2 249, , 165, ­6, 487, 5 5(g ) ­7, 168, ­9, 2 2 245 invalid datetime format, !!interval4ype>, 107, 1SA, 1, 620 1, 0Ñ0ü0Ä 2 2 2(y]), 450Ñ0ü0Ä 2 2 255, invalid descriptor count, 640 2 2 255, 457, 5 5(h*) !!interval6alue expression invalid descriptor index, 1>, 168, ­9, 170 431, 2 2 20Õ0é0ó, 439, 5 5(h*) !?ndex 0Ú0½ invalid escape character, ISO/IEC 9075, xi, xiii, 2¬, 620 xvi, 5 5 55, 5 5 56, 85, 5 577, invalid escape sequence, 678, 5 585, 686 2¬, 620 !?SOgEC 9579-(l4) 2 2, 619, 5 5(g ) invalid0arameter6alue, ISO/IEC 9899, 0Ñ0ü0Ä 243, 505 2 248, 620 !?SOgEC DIS 1000Õ0¡0é0Ã0É, 1 invalid schema name, 2 2 2, !?SO 1989, 2 2, (T )0Ñ0ü0Ä 5SD 62(N) ISO (eå)(g ), 0Ñ0ü0Ä 249 invalid SQL descriptor ISO 6160, 0Ñ0ü0Ä 243, 521 name, 2 2 20Ó0ë, 430Ñ0ü0Ä 2 2 20Õ0é0ó, !?SO 5 5 55, 2 2, (T )0Ñ0ü0Ä 5 439, 2 2 251, 62(N) ISO 8601, 0Ñ0ü0Ä 5 invalid SQL statement name, ISO 8652, 0Ñ0ü0Ä 243, 501 !?SO 9075, 5 5, 610Ñ0ü0Ä 5 5, 2 2 249, 450, 2 2 259, 465, 2 2 267, 660Ñ0ü0Ä 5 565 62(N) ISOLATION, 84, 2 299, 680 invalid time+one isolation level, 68, 69, displacement value, 70, 74, 76, 0Õ0é0ó0, 2 299, 167, 42(l4) 5 5(eå) 400, 5(R´), 66() invalid transaction state, !!isolation level>, 0Ø0ë0Ä9 2 250, 0Ú0Ë0Ò4, 2 286, 0Ú0Ë0Ò9, 2 292, !?S_DEFERRABLE, 541, 549, 2 294, 400, 2 2 2, 420, 5(y]), 550Ñ0ü0Ä 574, 575, 585, 587, 528, 5 5(g ) 598 invalid4ransaction IS_GRANTABLE, 546, 547, 4ermination, 400Ñ0ü0Ä 2 2 205, 548, 5 500, 601, 5 502, 600Ñ0ü0Ä 62(N) 5 504, 605 , 2, (h*)0Ñ0ü0Ä !?S_NULLABLE, 544, 580, 58() 2 2 244, 446, 5 50Õ0¡0é0Ã0É !?S_UPDATABLE, 543, 578, 579 !?S, 2 26, 84, 142, (h*)8, 2(Nã), IS_UPDATABLE_CHECK, 578 20Ô0³, (Œ¡)4, 272, 500, 504, !?S_UPDATABLE_NOT_NULL, 578 50, 508, 5, 517, 5(eå), !!item number>, 434, 2 2 20Õ0é0ó, 562, 570, 571, 580, 581, 436, 2 2 20Ú0Ë0Ò, 439 61(l4) 5 5ª, 618 - J - !?SOgEC 1020, 0Ñ0ü0Ä 243, 517 JOIN, 84, 0, 182, 4, !?SOgEC 1046, 0Ñ0ü0Ä 5, (T )9 50Ø0ë0Ä, 541, 545, 549, 550, ISO/IEC 756, 2 2 2, (T )0Ñ0ü0Ä 5¬ 551, 552, 550Ñ0ü0Ä 557, 558, !?SOgEC 1539, 2 2, (T )0Ñ0ü0Ä 5 559, 561, 562, 631, 5 580 !?SOgEC 5 546, 0µ0ó0Á0ü0à , 0, !?SOgEC 8824, 2 2 181 join columns, 181, (l4) 183 0Ú0Ë0Ò Database Language SQL , 8, 180, KEY_COLUMN_USAGE view, 55() 181, 0Ñ0ü0Ä 200 KEY_COLUMN_USAGE_FOREIGN_ !!joined4able>, 2 2 25, 1, KEY_COLUMNS, 588 1(eå), 1, 178, 0, 181, KEY_COLUMN_USAGE_PRIMARY_ (l4) 184, 1, 196, 8, KEY, 588 199, (eå)0, 201, (eå)(l4) 5 541, KEY_COLUMN_USAGE_UNIQUE, 5 543 588 , 0, KEY_DEGREE_GREATER_THAN_OR_ 1 EQUAL_TO_1, 5 5 !!join4ype>, 0, 181, 0µ0ó0Á0ü0à KEY_DEGREE_GREATER_THAN_ - K - OR_EQUAL_TO_1 assertion, KEY, 2 26, 2 2 21, 2 2 2(l4) 84, 264, 618 270, (y])(l4) 273, (y])4, 275, known not nullable, 2 26, 481, 50Ø0¯0¿0ü0ë, 55(l4) 561, 568, 199, (eå)0, 582 569, 571, 573, 574, 576, - L - 578, 580, 583, 584, 585, LANGUAGE, 84, 243, 560Ñ0ü0Ä 586, 587, 588, 590, 591, 5 5, 610Ñ0ü0Ä 5 5, 615, 5 540, 593, 595, 596, 598, 5 500, 665 5 502, 604, 5 505, 606, 5 5SA, !!language clause>, 46, (T )0Ñ0ü0Ä 610, 5 5, 618, 5 540, 645 244, 0Ö0Ã0·0§0ë1, 2 242, 0Ö0Ã0·0§0ë4, 2 246, , , (h*), 82, 83, 0Õ0é0ó(l4) 2 257, 0Õ0é0ó8, 2 259, 0Ø0¯0¿0ü0ë0, 85, 87, 101, 1(eå), 427, 2 261, 0Ø0¯0¿0ü0ë(l4) 2 263, 0Ø0¯0¿0ü0ë4, 2 265, 5 50Ó0ë, 641, 5 553, 666 0Ø0¯0¿0ü0ë6, 2 267, 45(l4) 2 2 254, 490Ñ0ü0Ä KEY_COLUMN_CONSTRAINT_TYPE_ 5 544, 670, 5 571 CHECK, 588 , 243 KEY_COLUMN_ORDINAL_ LAST, 84, 0Ú0½7, 2 278, 0Ú0½9, POSITION_NOT_NULL, 588 5 580 KEY_COLUMN_TABLE_CATALOG_ LEADING, 84, 10Õ0¡0é0Ã0É, ª7, 5 580 NOT_NULL, 588 leaf generally5nderlying KEY_COLUMN_TABLE_NAME_NOT_ table, 2 28, 2 272, 0Ú0Ë0Ò7, NULL, 588 2 289, 0Ø0ë0Ä0, 2 292, 0Ø0ë0Ä6, 2 2 274 KEY_COLUMN_TABLE_SCHEMA_ leaf5nderlying table, 2 28, NOT_NULL, 588 298, 0Õ0£0ü0È0 KEY_COLUMN_USAGE, 55(l4) 561, LEAVE, 85 588, 5 5, 618, 5 540 LEFT, 84, 0, 182, 0Ñ0ü0Ä KEY_COLUMN_USAGE base4able 50Ø0ë0Ä, 545, 5 580 , 588 , 79, 80, 83, 504, 5 Index 2 29 , ­, 79, 80, levels of conformance, 75 107, 1SA, 8, 1(T ), 8, Lexical elements, 79 ª(l4) 10Õ0£0ü0È, ª9, 141, 4, LIKE, (y>), 84, (h*)4, 2¬, (h*)6 155, ­8, 173, 0, 196, !!like0redicate>, 20Ñ0ü0Ä 205, 203, (h*)(l4) 2(Nã), (y>)9, 245, (h*)4, 2­, 447 260, (y])(l4) 274, (R´)1, 296, LIMIT, 85 (Nã)7, 2 2, 0Õ0¡0é0Ã0É0, 2 2(ry), 0Ö0Ã0·0§0ë6, , 0Ó0ë1 literal, (y>), (T ) 508, 5¬, 520 , 19, 89, 102, LENGTH, 83, 0Õ0é0ó6, 2 2 2(ry), 426, 4, 1­, 6, 147, 9, 427, 2 2 20Ö0Ã0·0§0ë, 436, 2 2 20Ø0ë0Ä, 440, 151, ¬(l4) 153, ¬4, 191, 2 2 241, 45(l4) 2 2 253, 454, 2 2 255, (Œ¡)6, 267, (Œ¡)8, 2 2 20Õ0¡0é0Ã0É, 430Ñ0ü0Ä 456, 2 2 257, 660µ0ó0Á0ü0à 2 2 20Ú0½, 441, 2 2 243, 458, 50Ô0³, , 63, 93, 107, 1SA, 629, 5 50Ú0½, 638, 5 540 109, 2 256, 0Õ0é0ó7, 2 258, 0Õ0é0ó9, LOCAL, 2 28, 2 2 20, 84, 99, 102, 2 260, 0Ø0¯0¿0ü0ë1, 2 2 245, 447, 500, 104, 165, ­6, 167, (Œ¡)0, 501, 502, 504, 505, 506, 261, (Nã)6, 299, 0Ø0ë0Ä7, 2 2 2(g ), 507, 508, 5SD, 510, 5, 576, 577, 578, 579, 680 5ª, 515, 5­, 517, 5, !!local table name>, 98, 519, 5(eå), 521, 5(g ), 639 103, 0Ø0ë0Ä7, 2 2 286, 487 , 20Ñ0ü0Ä local4emporary4able, 0Ú0½, 27, 29, 1(R´), 9, 10Ó0ë, 0Ú0Ë0Ò, 0Ø0ë0Ä, 72, 101, 103, 5 50Ô0³, 641, 5 559 (T )5, 258, (Œ¡)0, 261, (y])5, LESS, 85 281, (R´)0Ñ0ü0Ä 294, 0Ø0ë0Ä7, 2 298, , 80, 459, 2 2 286, 487, 577, 655, (eå)7, 2 273, 531 5 568 !!less4han or equals LOOP, 85 operator>, 80Ñ0ü0Ä 207 , 16, 17 LEVEL, 84, 2 299, 680 LOWER, (g ), 84, ª(l4) 10Ø0¯0¿0ü0ë, Leveling, 75 681 Leveling Rules, 9, 1(l4) 15, lower case, 2(l4) 81, 87, 88, 625 10Õ0é0ó, ª6, 50, 534, 5 540 Leveling the SQL Language, 5 5(Nã) !!level of isolation>, 2 299, 2 2 200, 66() , 296, (Nã)7, (Nã)9, 5 50Õ0£0ü0È 40 Database Language SQL - M - MINUTE, 2 20, 2 21, 2 2(l4) 2 20Ñ0ü0Ä 5 5 50Ñ0ü0Ä Maintenance and interpreta- 84, 95, 1, 0Ñ0ü0Ä 1(y>), 4ion of SQL, 685 ª0, 166, (y>)8, 20Ø0ë0Ä, (T )0, !!mantissa>, 90, 94, 95, 2 2 2(g ), 430, 2 2 241, 681 148, ¬0 !!minutes value>, 91, 94 marked modified0rivilege mixing of data4ypes, 0Ö0Ã0·0§0ë descriptor, 0Õ0£0ü0È6 modified, 0Õ0£0ü0È5 MATCH, 2 2 2(l4) 2 2 20Ñ0ü0Ä 84, 2(T ), modified privilege 274, (y])6, 280, 0Õ0é0ó0Ñ0ü0Ä 2 254, descriptor, 0Õ0£0ü0È5 550, 590, 591, 630Ñ0ü0Ä 5 581 MODIFY, 85 matching rows, 2(T ), (y])7, module, 2 28, 2 29, 2 2 25, 2 2 26, 2 2 27, (y])8, 279 2 2 28, 2 2 29, 55, 56, 5 51, 5 5(l4) !!match predicate>, (eå)5, 5 50Ñ0ü0Ä 5 55, 5 57, 5 5 51, 5 5 5(l4) 5 5 50Ñ0ü0Ä (eå)6, 2(T ), (g )5, 2(Œ¡), (y])6, 5 5 54, 5 5 56, 85, 86, 9(l4) 90Ñ0ü0Ä 447, 5 50Õ0¡0é0Ã0É 99, 100, 101, 102, 100Ñ0ü0Ä !!match type>, 2 2 2(l4) 271, (y])4, 104, 5, 1­, (ry)6, 260, 276, (y])7, 278, 591 (Œ¡)1, 297, 0Ô0³(l4) 2 2, 0Ó0ë6, !!match value>, (h*)4, 2, 2 2(h*), 0Õ0¡0é0Ã0É6, 2 241, 0Ö0Ã0·0§0ë(l4) 2 243, 2 2 247, 640µ0ó0Á0ü0à 0Ö0Ã0·0§0ë4, 2 245, 0Ö0Ã0·0§0ë6, 2 248, 0Ö0Ã0·0§0ë9, MATCH_OPTION, 550, 590, 591 2 250, 0Õ0é0ó(l4) 2 271, 0Ú0½5, 2 277, MAX, 84, 1(T ), 5, 1(Œ¡), 0Ú0Ë0Ò1, 2 284, 0Ø0ë0Ä1, 2 297, 400Ñ0ü0Ä 9, 193, (eå)8, 2 2 20Ó0ë, 539, 2 2 205, 408, 2 2 2SD, 411, 2 2 249, 544, 570, 571, 57(l4) 5 5­, 450, 2 2 259, 464, 2 2 267, 469, 660Ñ0ü0Ä 5 570 2 2 271, 47(l4) 2 2 274, 490, 2 2 293, MESSAGE_LENGTH, 83, 480, 495, 2 2 296, 610Ñ0ü0Ä 5 5, 625, 481, 2 2 288 5 5(y]), 634, 5 546, 647, 5 554, MESSAGE_OCTET_LENGTH, 83, 655, 5 556, 657, 5 558, 661, 480, 2 2 281, 488 5 562, 668, 5 569, 670, 5 571, MESSAGE_TEXT, 83, 480, 2 2 281, 2 2 288, 660µ0ó0Á0ü0à 670Ñ0ü0Ä 5 574, 678 MIN, 84, 1(T ), 5, 1(Œ¡), Module, 2 241 9, 193, (eå)8, 5 570 MODULE, 0Ø0ë0Ä, 84, 98, 0Ö0Ã0·0§0ë4, !!minus sign>, 80, 80Ñ0ü0Ä 86, 2 297, 486, 2 2 287, 61(l4) 5 5ª, 90, 91, 157, ¬8, 165, 614 ­8, 169, (T )1, 242 !?ndex 41 !!module>, 2 28, 2 29, 2 2 25, 2 2 26, , 0Ö0Ã0·0§0ë1, 47, 48, 49, 51, 55, 56, 2 244, 490ª0ü0à 5 51, 5 5(l4) 5 50Ñ0ü0Ä 5 55, 5 57, 5 5 51, Modules, 46 72, 73, 74, 93, 100, monadic, 24, 95, 10Õ0£0ü0È, ª4, 101, 103, 104, 1¬, 6, 158 (ry)6, 260, (Œ¡)1, 297, 0Ô0³(l4) monadic operator, 6, 24, 0Ó0ë(l4) 2 2­, 0Õ0¡0é0Ã0É1, 2 2(Œ¡), 0Ö0Ã0·0§0ë1, 10Õ0£0ü0È, ª4 2 242, 0Ö0Ã0·0§0ë0Ñ0ü0Ä 2 244, 0Ö0Ã0·0§0ë6, 2 248, MONTH, 0Ô0³, 0Ó0ë, 0Õ0¡0é0Ã0É, 0Õ0£0ü0È, 84, 2 249, 0Õ0é0ó0, 2 252, 0Ú0½1, 2 275, 95, 1, 1, 0Ñ0ü0Ä 20Ú0Ë0Ò, 2 277, 0Ú0Ë0Ò1, 2 284, 0Ø0ë0Ä1, 2 297, (y>)9, 240, 430, 2 2 245, 681 !!months6alue>, 91, 94, 241 400Ñ0ü0Ä 2 2 205, 408, 2 2 2SD, 411, MORE, 83, 479, 2 2 281, 48() 2 2 249, 450, 2 2 259, 464, 2 2 267, multiple server4ransac- 2 2 269, 471, 2 2 272, 474, 2 2 293, tions, 2 2 207, 410, 5 5(h*) 495, 2 2 296, 614, 5 5(ry), 627, multiset, 6, 5 5 5, 0Ø0¯0¿0ü0ë, 0Ú0½, 0Ú0Ë0Ò, 5 50Ö0Ã0·0§0ë, 646, 5 554, 655, 5 556, 8, 183, 4, 2 20Õ0¡0é0Ã0É 657, 5 558, 661, 5 562, 668, MUMPS, 2 2 2, 61, 83, (T )0Ñ0ü0Ä 244, 5 569, 670, 5 571, 670Ñ0ü0Ä 5 574, 0Õ0é0ó9, 2 260, 0Ø0¯0¿0ü0ë5, 2 2 289, 490, 678 2 2 291, 490Ñ0ü0Ä 2 2 295, 498, 5¬, , 2 2 25, 2 2 26, 5 5 5(l4) 5 564 101, 102, 0Ö0Ã0·0§0ë1, 2 243, 490Ñ0ü0Ä , 5 554, 657, 5 569 515, 5­, 664 , identifier>, 46, 65, 490, 5¬ (ry)6, 2 241, 0Ö0Ã0·0§0ë(l4) 2 248, 408, , 515, 5­ !!module character set , specification>, 2 2 26, 515, 5­ , 85, 86, 9(l4) 90Ñ0ü0Ä 100, 515 2 244, 0Ö0Ã0·0§0ë5, 2 2 293, 647, 5 561 !!MUMPS variable definition> !!module contents>, 0Ö0Ã0·0§0ë1, , 2 2 290, 515, 5­ 0Ö0Ã0·0§0ë0Ñ0ü0Ä 5 547 module language, 46, 75 !!module name>, 46, 61, 74, 99, 103, 0Ö0Ã0·0§0ë4, 2 252, 490Ñ0ü0Ä 669, 5 573 2 2 2(N) Database Language SQL - N - , n-adic operator, 5 5 82, 86 NAME, 84, 2 2 2(y]), 434, 2 2 20Ú0Ë0Ò, NONE, 85 45(l4) 2 2 254, 670µ0ó0Á0ü0à , 0, , 6, 197, 8, 199, 181, 0Ñ0ü0Ä 184 (eå)0 NAMES, 84, 2 244, 419, 2 2 284, !!non-joiniuery0rimary>, 490, 5 581 196, 7, 198, 9, 5 570 Names and identifiers, 98 , 196, NATIONAL, (eå), (h*), 84, 107, 7, 198, 9, 5 570 108, 5 553, 657, 5 581 non-null, (g )0Ñ0ü0Ä 277 !!national character string non-null6alue, , 42, 89, literal>, 8(l4) 86, 89, 1, 2SA, (g )5, 20Ö0Ã0·0§0ë, (y])8, 92, 93, 97, 640 279, 0Ú0½0Ñ0ü0Ä 50Ó0ë, 66(l4) 5 565 !!national character string , 83, 4ype>, 107, 1ª, 640 89, 92 NATURAL, 84, 0, 181, 0Ñ0ü0Ä non-repeatable read, 5 58 184, (R´)9, 2 252, 681 !!non-reserved7ord>, 83 NCHAR, 84, 107, 1SA, 681 NEW, 85 , (y>)9, 241 !!newline>, 83, 86, 92, 656 Normative references, 0ª0ü0à NEXT, 84, 0Ú0½7, 2 278, 0Ú0½9, no subclass, 619, 5 5(eå), 621, 469, 5 581 5 5(g ), 620ª0ü0à NO, (h*), 0Õ0é0ó, 84, (eå)8, 249, NOT, (y>), 0Ø0¯0¿0ü0ë, 84, (l4) 2, 250, (y])4, 276, 0Ó0ë4, 2 2¬, (h*)(l4) 2, (h*)8, 2(R´), (g )9, 590, 591, 59(l4) 5 5SA, 609, 20Ô0³, (ry)(l4) 253, (Œ¡)(l4) 264, 5 560, 670, 5 581 (y])0, 271, (y])(l4) 273, 0Ô0³1, No collating sequence, (y>), 2 203, 0Õ0¡0é0Ã0É5, 2 2 297, 499, 562, 24, 25, 26, 297 569, 570, 571, 574, 576, no data, 47, 0Õ0é0ó0, 2 251, 0Ú0½9, 578, 580, 585, 588, 590, 2 282, 0Ú0Ë0Ò0Ñ0ü0Ä 2 287, 0Ú0Ë0Ò9, 2 295, 598, 5 500, 60(l4) 5 504, 606, 435, 2 2 299, 528, 50Ô0³, 62(l4) 5 5SA, 610, 5 5, 617, 5 5, 5 5(T ) 630Ñ0ü0Ä 5 545 non-deferrable, 2 26, 2 2 21 Notation, 7 , 82, !!not equals operator>, 83, 86 (eå)7 non-deterministic, 2 2 20, 189, 193, (eå)0, 282, 0Õ0¡0é0Ã0É5 Index 2 2 20ª0ü0à null, 6, 5 5 5, , 0Ø0¯0¿0ü0ë, 42, 43, !!null0redicate> semantics, 48, 6, 1(Œ¡), 9, 10Ô0³, 2 ª1, 10Õ0é0ó, ª6, 10Ú0½, (l4) , 0Ñ0ü0Ä 5, 156, ¬8, 162, ­0Ñ0ü0Ä 174, 0Ø0ë0Ä1 166, ­9, 173, 4, 182, null value, 5 5, 7, 19, 2 26, 0Ñ0ü0Ä 192, (eå)5, 207, (h*)5, 2 2 2(l4) 1(Œ¡), 9, 10Ô0³, ª1, (h*)8, 2(T ), (g )5, 2(R´), (y>)1, 10Õ0é0ó, ª6, 10Ú0½, (l4) 145, 20Ö0Ã0·0§0ë, (Œ¡)7, 268, (y])8, 279, ¬6, 158, ­(l4) 163, ­6, 0Ú0½0Ñ0ü0Ä 2 291, 42(l4) 2 2 20Ø0¯0¿0ü0ë, 444, 169, 4, 183, (eå)7, 2¬, 2 2 252, 454, 2 2 256, 458, 50, (h*)8, 2(T ), (g )5, 2(R´), (y>)1, 525, 50Ó0ë, 570Ñ0ü0Ä 579, 581, 20Ö0Ã0·0§0ë, (Œ¡)7, 268, (y])8, 279, 594, 614, 5 544, 66(l4) 5 565, 435, 2 2 20Ø0¯0¿0ü0ë, 454, 2 2 256, 458, 668, 5 571, 674 5(ry), 579, 594, 614, 5 562, NULL, , 0Ø0¯0¿0ü0ë, 84, 1, 142, 665, 5 568, 671, 5 574 4, 145, 0Ñ0ü0Ä 192, (h*)8, null6alue, no indicator (Œ¡)(l4) 264, (Œ¡)6, 267, (y])(l4) 0arameter, (y>)1, 2 2 20Õ0é0ó, 620 273, (y])4, 278, (y])9, 543, null value eliminated in 544, 56(l4) 569, 570, 571, set function, 6, 5 5(y>) 574, 576, 578, 580, 581, number, (y]) NUMBER, 84, 479, 2 2 281, 48() 585, 588, 590, 591, 592, !!number of conditions>, 598, 5 500, 60(l4) 5 504, 606, 2 299, 400, 5 572 608, 5 510, 61(l4) 5 5ª, 618, Numbers, 27 5 545 NUMBER_OF_CHARACTERS, 554, nullability, 2 26, 265 606, 5 507, 665 nullability characteristic, NUMERIC, , (y]), 0Ö0Ã0·0§0ë, 84, 2 26, 2 27, 265 107, 1SD, 0, 2 253, 0Õ0é0ó8, nullable, 2 2 2(l4) 2 2 27, 182, (l4) 2 2 2(ry), 426, 2 2 2(Nã), 440, 2 2 245, 199, (eå)0, 2 2 252, 58(N) 510, 50Ø0ë0Ä, 544, 565, 570, NULLABLE, 84, 2 2 2(y]), 434, 571, 57(l4) 5 558 436, 2 2 20Ú0Ë0Ò, 45(l4) 2 2 253, 454, numeric data4ype 544, 580, 582 descriptor, (y]) null character, 2 263, 506, , 157, ¬8 5 561 !!numeric type>, 107 NULLIF, 84, 141, (l4) 2 2 244, , 2 2 246, 681 ª0Ñ0ü0Ä 155, ¬7, 158 !!null0redicate>, 205, (h*)8, , 2 2 244 8, 10Ó0ë, ¬7, 5 50Ô0³, 641 44 Database Language SQL numeric value out of range, octet, 0Ñ0ü0Ä 5, (g ), (y>), (y]), 1(Œ¡), 6, 147, ¬8, 20Õ0£0ü0È, 10(l4) 103, 8, 10Ó0ë, (ry)0, (y>)5, 5 5(eå) 2 256, 0Õ0é0ó7, 2 258, 0Õ0é0ó9, 2 260, NUMERIC_PRECISION, 50Ø0ë0Ä, 0Ø0¯0¿0ü0ë1, 2 262, 0Ø0¯0¿0ü0ë0Ñ0ü0Ä 2 264, 0Ø0¯0¿0ü0ë5, 544, 565, 570, 571, 57(N) 2 266, 0Ø0¯0¿0ü0ë7, 2 2 20Ø0¯0¿0ü0ë, 45(l4) 2 2 253, NUMERIC_PRECISION_RADIX, 454, 2 2 258, 488, 501, 506, 539, 544, 565, 570, 571, 5SD, 510Ñ0ü0Ä 5, 521, 572, 572 619 NUMERIC_SCALE, 50Ø0ë0Ä, 544, !!octet length expression>, 570, 571, 572 8, 10Ó0ë - O - OCTET_LENGTH, 80Ñ0ü0Ä 84, 1(R´), OBJECT, 85 ª0, 2 2 2(y]), 434, 2 2 20Ø0¯0¿0ü0ë, 438, !!object column>, 0Ø0ë0Ä1, 2 292, 2 2 245, 45(l4) 2 2 253, 454, 2 2 258, 2 293, 0Ø0ë0Ä4, 2 295, 0Ø0ë0Ä6, 2 2 247, 488, 50Ø0ë0Ä, 544, 570, 571, 474, 2 2 275, 648 572, 681 object identifier, 16, 5 5(ry) OF, 84, 2 260, 0Ø0¯0¿0ü0ë1, 2 271, 0Ú0Ë0Ò4, Object identifier for 2 291, 47(l4) 2 2 274, 476, 2 2 277, Database Language SQL, 517, 5, 519, 5 50Ø0ë0Ä ­ OFF, 85 , 245, (T )6, OID, 85 0Õ0¡0é0Ã0É9, 2 20Õ0¡0é0Ã0É, 0Õ0£0ü0È0Ñ0ü0Ä 5 50Ö0Ã0·0§0ë, 646 OLD, 85 OBJECT_CATALOG, 539, 548, ON, 84, 180, (T )8, 260, (y])4, 554, 555, 556, 5 504, 605 275, (R´)1, 289, (Nã)4, 2 200, OBJECT_NAME, 50Ø0ë0Ä, 548, 554, 0Ó0ë0, 2 2ª, 0Ó0ë5, 2 2, 0Õ0¡0é0Ã0É1, 555, 556, 604, 5 505 2 2(y>), 0Õ0¡0é0Ã0É9, 2 20Ô0³, 0Õ0£0ü0È1, 2 20Õ0¡0é0Ã0É, OBJECT_SCHEMA, 50Ø0ë0Ä, 548, 0Õ0£0ü0È0Ñ0ü0Ä 2 297, 400Ñ0ü0Ä 50Ø0ë0Ä, 541, 554, 555, 556, 5 504, 605 545, 549, 550, 551, 552, OBJECT_TYPE, 50Ø0ë0Ä, 548, 554, 550Ñ0ü0Ä 557, 558, 559, 561, 555, 556, 604, 5 505 562 !!occurrences>, 431, 2 2 20Õ0¡0é0Ã0É, ONLY, 84, 0Ú0½1, 2 272, 0Ø0ë0Ä9, 435, 2 2 20Ø0ë0Ä, 451, 2 2 253, 455, 2 2 200, 681 2 2 257, 637, 5 563 OPEN, 84, 2 275, 467, 2 2 283, 2 2 284 Index 2 2 25 , 50, 53, OPTION, 2 2 20, 5 55, 5 5 55, 84, 55, 57, 58, 59, 0Ö0Ã0·0§0ë(l4) 248, (Nã)6, 297, (Nã)9, 2 2(Nã), 2 268, 0Ú0½1, 2 275, 464, 2 2 265, 0Õ0£0ü0È0, 2 20Ó0ë, 0Õ0£0ü0È0Ñ0ü0Ä 2 20Õ0é0ó, 0Õ0£0ü0È6, 484, 2 2 293, 494, 2 2 295, 496, 2 20Ú0½, 0Õ0é0ó6, 2 289, 0Ø0ë0Ä0Ñ0ü0Ä 2 295, 5 573 487, 50Õ0£0ü0È, 540Ñ0ü0Ä 550, 578, OPERATION, 85 579, 590, 591, 601, 5 503, Operations involving bit 605, 5 577 strings, 27 OR, 0Ø0¯0¿0ü0ë, 84, (g )8, 2(Nã), (y>)0, Operations involving 50Ø0ë0Ä, 546, 547, 548, 571, character strings, (g ) 570Ñ0ü0Ä 580, 581, 583, 584, Operations involving 585, 586, 591, 595, 596, datetimes and intervals, 606, 5 5SA, 611, 5 5, 610ª0ü0à 2 24 ORDER, 84, 0Ú0½1, 2 272, 0Ú0½4, Operations involving 2 2 264, 530, 5 50Õ0é0ó, 638 numbers, (Nã) !!order by clause>, 50, 0Ú0½1, operator, 5 5, 7, 8, , ª, 2 272, 0Ú0½0Ñ0ü0Ä 2 291, 474, 50Ô0³, 2(l4) 20Ñ0ü0Ä 24, 27, 29, 2 24, 531, 5 568, 671, 5 574 0Õ0é0ó, 80, 83, 95, ª0Ñ0ü0Ä , 10Ö0Ã0·0§0ë, ¬7, 158, ­0, 161, 0Ú0½1 166, ­9, 170, 7, 198, ORDINAL_POSITION, 544, 55(l4) (eå)0, 201, (eå)(l4) 207, (eå)8, 580, 581, 588, 589 2(Nã), (y>)7, 2 273, 0Ø0ë0Ä1, 2 2 20Ö0Ã0·0§0ë, Other operators involving 438, 2 2 243, 445, 2 2 279, 500, bit strings, (y]) 505, 50Ó0ë, 659, 5 570 Other operators involving OPERATORS, 85 character strings, 20ª0ü0à Operators that operate on OTHERS, 85 bit strings and return Other4erms,  bit strings, 27 OUTER, 84, 180, 618, 5 581 Operators4hat operate , 180 on character strings outermost, 11, 1 and return character outer reference, 1(g ), 4, strings, 2(N) 1(Œ¡), 1, 185, 9, 190, (l4) 194, 0Ú0Ë0Ò6, 2 295, 641, 5 578 OUTPUT, 84, 450, 5 581 output0arameter, 0Ö0Ã0·0§0ë7, 2 248, 0Õ0é0ó7, 2 262, 0Ø0¯0¿0ü0ë0Ñ0ü0Ä 2 264, 0Ø0¯0¿0ü0ë5, 2 266, 0Ø0¯0¿0ü0ë7, 5 561 2 2 26 Database Language SQL OVERLAPS, 2 24, 84, 2(y]), 681 , 2 24, list>, 0Ö0Ã0·0§0ë6 205, (eå)6, 2(y]), (g )8, 2 2 244, !!parameter name>, 5 5 55, 99, 446, 5 543, 644 103, 4, 1¬, 6, 2 246, - P - 0Ö0Ã0·0§0ë7, 2 250, 0Ú0½1, 2 2 294, 670Ñ0ü0Ä !!890ackage>, 16, 17 5 577 PAD, (h*), 0Õ0é0ó, 85, (eå)8, 249, Parameters, 47 (ry)0, 2 2, 0Ó0ë5, 5 5SA, 609, PARAMETERS, 85 660, 5 570, 681 , !!pad attribute>, 0Ó0ë4, 2 2¬ 1, 5, 1­, 525 PAD_ATTRIBUTE, 555, 608, !!parameter using clause>, 609, 5 565 2 2 255, 459, 2 2 260 0arameter, (R´), (Nã), 47, 48, PARTIAL, 2 2 2(l4) 2 2 20Ñ0ü0Ä 85, 2(T ), 5 51, 5 5(l4) 5 50Ñ0ü0Ä 5 5 50, 5 5 55, 99, (g )5, 274, (y])6, 277, (y])8, 100Ñ0ü0Ä 1, 5, 1­, ­8, 279, 590, 591, 681 192, (y>)1, 281, (Nã)6, 2 2(ry), Pascal, 2 2, 49, 61, 0Ø0¯0¿0ü0ë0, 0Ö0Ã0·0§0ë6, 2 247, 0Ö0Ã0·0§0ë8, 2 250, 0Õ0é0ó1, 2 261, 0Ø0¯0¿0ü0ë6, 2 2 289, 490, 2 2 291, 2 252, 0Õ0é0ó6, 2 257, 0Õ0é0ó8, 2 259, 490Ñ0ü0Ä 2 2 295, 498, 5, 518, 0Ø0¯0¿0ü0ë0, 2 261, 0Ø0¯0¿0ü0ë(l4) 2 263, 0Ø0¯0¿0ü0ë4, 5, 615, 5 5(Œ¡), 639, 5 551, 2 265, 0Ø0¯0¿0ü0ë6, 2 267, 0Ú0½1, 2 2 20Õ0é0ó, 66() PASCAL, 84, 243, 0Ø0¯0¿0ü0ë0, 2 266, 2 2 20Ø0¯0¿0ü0ë, 439, 2 2 243, 450, 2 2 253, 490Ñ0ü0Ä 5, 61(l4) 5 5ª, 614, 454, 2 2 255, 456, 2 2 259, 460, 5 5¬ 46(l4) 2 2 267, 48(l4) 2 2 286, 494, , 2 2 295, 496, 502, 507, 510, 490, 5, 518 5, 516, 5, 52(l4) 5(ry), !!Pascal4ype specification> 619, 5 5(T ), 630, 5 50Õ0é0ó, 641, , 5, 518, 5, 639, 647, 5 554, 659, 5 561, 66(l4) 5 551 664, 5 565, 666, 5 571, 67(l4) , 490, 5, , 518, 5 47, 0Ö0Ã0·0§0ë6, 2 247, 0Õ0é0ó0, 2 251, , 2, (h*)7, 2 2 247, 2 252, 0Õ0é0ó6, 2 257, 0Õ0é0ó8, 2 259, 640ª0ü0à 2 260, 0Ø0¯0¿0ü0ë1, 2 262, 0Ú0½1, 2 2 294, PENDANT, 85 495, 2 2 296, 635, 5 547, 674, , 5 5 59, 80, 2¬ , 80, 90, 91, 94, 5 575 98, 99, 1, 148, ¬0, 1, 242, 508 !?ndex 47 0ersist, 0Ú0½, 0Ø0ë0Ä, 44, 51, possibly non-deterministic, 5(l4) 5 57, 5 5 5(l4) 258, (Œ¡)0, 40, 9, 193, (eå)0, 282, 261, (y])5, 281, 0Ø0ë0Ä7, 2 298, 0Õ0¡0é0Ã0É5 577 0ossibly nullable, 0Ø0¯0¿0ü0ë, (l4) 0ersistent, 5 5 5, 0Ú0½, 0Ø0ë0Ä, 44, 192, 45(l4) 582 46, 51, 52, 67, (ry)8, precede, 1(l4) 242, (Nã)7, 2 241, 260, (Œ¡)1, 275, (R´)1, 2 297, 0Ø0¯0¿0ü0ë0Ñ0ü0Ä 2 273, 400Ñ0ü0Ä 2 2 292, 490Ñ0ü0Ä 577 505, 509, 5, 521, 50Ó0ë, persistent base table, 2 27 667 persistent4able, 44 PRECISION, , (y]), 0Ö0Ã0·0§0ë, 85, phantom, 5 58 108, 110, 0Õ0é0ó(l4) 2 257, 0Õ0é0ó8, !!PLg host identifier>, 2 259, 425, 2 2 2(Œ¡), 427, 2 2 2(Nã), 2 2 290, 520, 5(h*) 434, 2 2 20Ø0¯0¿0ü0ë, 439, 2 2 240, 441, !!PLg4ype fixed binary>, 2 2 253, 454, 2 2 255, 456, 2 2 257, 5(eå) 500, 502, 507, 5, 510Ñ0ü0Ä !!PLg4ype fixed decimal>, 50Ø0ë0Ä, 544, 565, 570, 571, 5(eå) 57(l4) 5 558, 660ª0ü0à , !!precision>, 63, 107, 1SA, 5(eå) 109, 110, 0Õ0é0ó8, 2 261, 445, !!PLg4ype specification>, 5(eå), 521, 5(g ), 520Ñ0ü0Ä 5 50Ø0ë0Ä, 515, 5­, 520, 5(g ), 657, 651, 5 564, 665 5 558 !!PLg6ariable definition>, , 205, (eå)6, 2­, 2 2 290, 520, 5(h*), 52(l4) 5 564 (g )9, 5 50Õ0¡0é0Ã0É PLI, 84, (T )0Ñ0ü0Ä 2 255, 0Ø0¯0¿0ü0ë1, Predicates, (eå)5 2 267, 490Ñ0ü0Ä 5 5, 610Ñ0ü0Ä 5 5, PREORDER, 85 5 5¬ Preparable and immediately , 80, 90, 157, executable SQL- 158, ­5, 168 statements, 56 POSITION, 85, 1(R´), 445, , 589, 5 581 50Ñ0ü0Ä 56, 59, 5 50, 5 5(l4) 2 2 242, , 20Ñ0ü0Ä 440Ñ0ü0Ä 2 2 260, 46(l4) 2 2 263, 476, (y]), (Nã), 8, 1(Nã), ª0, 2 2 284, 638 ª1, 2 2 244, 630, 5 559 0ossible qualifiers, 1 2 2 28 Database Language SQL !!preparable dynamic5pdate PRIMARY, 2 26, 2 2 21, 2 2 2(l4) 85, statement:0ositioned>, 270, (y])(l4) 273, (y])5, 50Ø0¯0¿0ü0ë, 54, 56, 59, 5 50, 5 5(l4) 299, 568, 569, 571, 573, 574, 44(l4) 2 2 243, 460, 2 2 262, 460Ñ0ü0Ä 576, 578, 580, 580Ñ0ü0Ä 584, 2 2 277, 484, 5 50Ø0ë0Ä 585, 586, 587, 588, 590, !!preparable implementation- 591, 590Ñ0ü0Ä 595, 596, 598, defined statement>, 56, 600, 5 502, 604, 5 50, 608, 44(l4) 2 2 243, 660µ0ó0Á0ü0à 5 510, 618, 5 545 !!preparable SQL data PRIOR, 85, 2 277, 0Ú0½8, 2 279, statement>, 2 2 242, 637 681 , 44(l4) 5 50Ú0½ privilege, 2 2 24, 5 54, 5 55, 5 56, !!preparable SQL session 5 5 55, 5 5 57, 103, 9, 1(g ), statement>, 2 2 242, 637 ª5, 145, (y>)4, 245, (T )6, 0reparable SQL-statement, 248, (T )9, 251, (ry)6, 261, 56, 57 (Œ¡)4, 276, (R´)(l4) 284, (Nã)8, !!preparable SQL4ransaction 2 202, 0Ó0ë0, 2 2, 0Ó0ë5, 2 2­, statement>, 2 2 242, 637 0Õ0¡0é0Ã0É1, 2 2(Œ¡), 0Õ0¡0é0Ã0É9, 2 20Ô0³, 0Õ0£0ü0È1, !!preparable statement>, 2 20Õ0¡0é0Ã0É, 0Õ0£0ü0È0Ñ0ü0Ä 2 20Ö0Ã0·0§0ë, 0Õ0£0ü0È5, 2 20Ø0¯0¿0ü0ë, 2 2 24, 2 2 25, 5 54, 5 5 50Ñ0ü0Ä 90Ñ0ü0Ä 100, 0Õ0£0ü0È7, 2 20Ú0Ë0Ò, 0Ö0Ã0·0§0ë(l4) 2 284, 0Ú0Ë0Ò6, 101, 1¬, 415, 2 2 2, 419, 2 289, 0Ø0ë0Ä(l4) 2 294, 0Ø0ë0Ä8, 2 2 2(eå), 2 2 242, 440Ñ0ü0Ä 2 2 260, 46(l4) 2 2 263, 487, 5(Œ¡), 530Ñ0ü0Ä 546, 547, 650Ñ0ü0Ä 5 554, 656 548, 568, 5 500, 601, 5 502, PREPARE, 85, 2 254, 44(l4) 2 2 247, 2 2 249, 46(l4) 2 2 283, 484, 5 581 600Ñ0ü0Ä 5 504, 605, 5 50Õ0¡0é0Ã0É, 630Ñ0ü0Ä 0repared statement not a 5 555, 660, 5 569, 677, 5 578 cursor specification, , 465, 5 5(h*) 245, (T )6, 2 20Õ0£0ü0È, 63() , 14, 0rivilege dependency graph, 44, 45, 54, 60, 61, 63, 2 20Õ0é0ó 64, 73, 93, 101, 103, privilege descriptor, 44, 104, 5, 2 269, 415, 2 2 2, 65, 66, (T )6, 248, (Œ¡)1, 419, 2 2 242, 449, 2 2 250, 459, 284, (Nã)8, 2 202, 0Ó0ë(l4) 2 2¬, 2 2 264, 465, 2 2 284, 650Ñ0ü0Ä 5 554, 0Ó0ë6, 2 2(h*), 0Õ0¡0é0Ã0É9, 2 20Ô0³, 0Õ0£0ü0È1, 656 2 20Õ0¡0é0Ã0É, 0Õ0£0ü0È0Ñ0ü0Ä 2 20Ö0Ã0·0§0ë, 0Õ0£0ü0È5, 2 20Ø0¯0¿0ü0ë, PRESERVE, 85, (Œ¡)0, 281, 0Õ0£0ü0È7, 2 20Ú0Ë0Ò, 0Ø0ë0Ä8, 2 2 2(eå), 600, 0Ø0ë0Ä7, 5 581 5 502, 604 !?ndex 49 0rivilege not granted, 0Õ0£0ü0È(l4) PUBLIC, 66, 75, 85, 10(l4) 620µ0ó0Á0ü0à 245, (T )6, 248, 0Ó0ë5, 2 2(h*), privilege not revoked, 2 20Ú0Ë0Ò, 0Õ0£0ü0È4, 50Õ0£0ü0È, 539, 542, 545, 620µ0ó0Á0ü0à 546, 547, 548, 554, 555, Privileges, 64 556, 5 501, 600Ñ0ü0Ä 5 505 PRIVILEGES, 85, 245, (T )6, (Nã)4, 2 200, 0Õ0£0ü0È(l4) 2 20Ú0Ë0Ò, 539, - Q - 54(l4) 545, 546, 547, 548, , 98, 554, 555, 556, 600, 5 502, 10(l4) 1, (ry)(l4) 2 2(ry), 486, 604, 5 505, 640 2 2 287 !!privileges>, 245, 0Õ0¡0é0Ã0É9, , 0, 181 0Õ0£0ü0È0, 2 20Ó0ë, 0Õ0£0ü0È(l4) 2 20Õ0£0ü0È, 0Õ0£0ü0È8, , 98, 101, 104, 0Ø0ë0Ä7 PRIVILEGE_TYPE, 546, 547, !!qualified name>, 2 29, 2 2 24, 548, 5 500, 601, 5 502, 600µ0ó0Á0ü0à 5 5 50Ñ0ü0Ä 98, 99, 101, 10(l4) 0rocedure, 47 2 2 2, 656 PROCEDURE, 85, 2 246 !!qualifier>, 1, 1(ry), 1, !!procedure>, , 0Ø0ë0Ä, 46, 2 290, 640ª0ü0à 2 2 27, 2 2 28, 2 2 29, 55, 56, 5 51, !!quantified comparison 5 50Ñ0ü0Ä 5 55, 5 57, 5 5 51, 5 5 5(l4) 5 5 54, predicate>, (eå)5, 2(eå), 103, (ry)6, 2 241, 0Ö0Ã0·0§0ë(l4) 2 246, 447 2 247, 0Ö0Ã0·0§0ë8, 2 249, 0Õ0é0ó0, 2 252, !!quantifier>, 2(eå), (g )1 2 271, 0Ø0ë0Ä7, 2 2 2SA, 409, 2 2 2, !!query expression>, 11, 410Ñ0ü0Ä 2 2 260, 460Ñ0ü0Ä 2 2 293, 494, 15, 2 27, 2 28, 2 2 20, 5 5 55, 1, 2 2 295, 496, 5(y]), 528, 5 5(y]), 0Ñ0ü0Ä 176, 0Ñ0ü0Ä 196, 7, 655, 5 561, 66(l4) 5 570, 671, 200, (eå)(l4) 203, (eå)4, 20Ú0½, 5 573, 674, 5 575 (R´)(l4) 284, (R´)9, 294, (Nã)6, !!procedure name>, 2 2 27, 5 51, 297, (Nã)8, 299, 0Ô0³0, 2 2SD, 99, 103, 0Ö0Ã0·0§0ë6, 2 248, 0Õ0é0ó(l4) 0Ó0ë0Ñ0ü0Ä 2 2, 0Õ0¡0é0Ã0É0Ñ0ü0Ä 2 2(ry), 0Õ0£0ü0È0, 490Ñ0ü0Ä 2 2 294, 661, 5 571, 670µ0ó0Á0ü0à 2 20Ó0ë, 0Õ0£0ü0È4, 2 20Õ0é0ó, 0Õ0£0ü0È6, 2 271, Procedures, 47 0Ú0½(l4) 2 275, 0Ú0Ë0Ò7, 2 288, 0Ú0Ë0Ò9, Processing methods, 5 5(y]) 2 290, 0Ø0ë0Ä(l4) 2 296, 444, 2 2 246, programming languages, 2 2 29, 467, 2 2 274, 530, 579, 581, (T )0µ0ó0Á0ü0à 583, 584, 5 50Ó0ë, 63(l4) 5 50Ø0¯0¿0ü0ë, PROTECTED, 85 64(l4) 5 543, 646, 5 548, 671, 677 Query expressions, 0ª0ü0à 50 Database Language SQL query expression4oo long RECURSIVE, 85 for information schema, redundant duplicates, 7 299, 620µ0ó0Á0ü0à REF, 85 !!query primary>, 6, 198, , 640µ0ó0Á0ü0à 274, (y])5, 280, (R´)9 , 2 2 20, referenced columns, 2 2 2(l4) 10(l4) 1, 1, 192, 0Ñ0ü0Ä 271, (y])5, 276, (Nã)(l4) 2 20Ø0¯0¿0ü0ë, 194, 5, 196, 7, 200, 0Õ0£0ü0È7 203, (eå)4, 282, (Nã)6, 299, referenced table, 2 2 2(l4) 2 2 20Ñ0ü0Ä 0Õ0¡0é0Ã0É5, 2 282, 0Ú0Ë0Ò4, 2 290, 0Ø0ë0Ä1, 271, (y])4, 275, (y])6, 277, 2 2 242, 460, 2 2 272, 474, 5 50Ó0ë, (y])8, 279, (R´)0, 289, (Nã)() 5 50Õ0¡0é0Ã0É, 640Ñ0ü0Ä 5 546, 648, 5 570 !!referenced4able and !!query term>, 196, 9, columns>, 2 2 2(l4) 271, (y])4, (eå)(l4) 5 543 275, (y])6, 289 !!question mark>, 63, 80, Reference Model of Data 1 Management, 1 , 5 5 59, 80, 80Ñ0ü0Ä 87, REFERENCES, 5 55, 5 56, 85, 89, 90, 91, 92, 93, 97, 245, (T )6, 261, (y])4, 276, 2 2, 0Õ0¡0é0Ã0É0 (R´)(l4) 284, (R´)9, 298, 0Ô0³(l4) !!quote symbol>, 87, 89, 90µ0ó0Á0ü0à 2 2(Œ¡), 0Õ0¡0é0Ã0É9, 2 20Ô0³, 0Õ0£0ü0È1, 2 20Õ0¡0é0Ã0É, - R - 0Õ0£0ü0È0Ñ0ü0Ä 2 20Ø0¯0¿0ü0ë, 0Õ0£0ü0È7, 2 298, 569, READ, 5 58, 5 59, 85, 2 271, 0Ú0½(l4) 571, 570Ñ0ü0Ä 574, 576, 580, 2 299, 400, 5 581 580Ñ0ü0Ä 584, 585, 588, 591, read-only, 0Ú0Ë0Ò, 40, 50, 67, 595, 596, 598, 600, 5 501, 5 5 50, 182, (Nã)6, 2 250, 0Ú0½(l4) 60(l4) 5 503, 604, 5 505, 606, 0Ú0Ë0Ò4, 2 286, 0Ú0Ë0Ò8, 2 289, 0Ø0ë0Ä(l4) 5 5SA, 610, 5 5, 630ª0ü0à 2 294, 400, 5(R´) !!references specification>, READ ONLY, 0Ú0½(l4) 2 2 200 262, (Œ¡)4, 274, (R´)0, 5 50Õ0£0ü0È read-write, 5 57, 5 5 50, 2 250, REFERENCING, 85 2 2 200, 528 referencing columns, 42, READ 2 2 2 2RITE, 0Ø0ë0Ä9, 2 2 200 (y])1, 274, (y])5, 276, 588 REAL, , (y]), 0Ö0Ã0·0§0ë, 85, 108, !!referencing columns>, 42, 110, 0Õ0é0ó(l4) 2 257, 0Õ0é0ó8, 2 259, (y])1, 274, (y])5, 276 0Ø0¯0¿0ü0ë0, 2 261, 0Ø0¯0¿0ü0ë6, 2 2 2(ry), 426, referencing table, 2 2 2(l4) 2 2 20Ñ0ü0Ä 429, 2 2 240, 500, 502, 507, 274, (y])5, 276, (y])7 5, 510Ñ0ü0Ä 5¬, 516, 5, !!referential action>, 274, 5, 571, 5 557, 658 (y])6, 278, (y])9, 591, 59() !?ndex 51 referential constraint, 2 2 21, Remote Database Access, 0Ñ0ü0Ä 42 5 5(g ) !!referential constraint REPEATABLE, 68, 69, 84, 0Ø0ë0Ä9 definition>, 42, 45, repertoire, 5, 7, 20, 21, (y])0, 271, (y])4, 276, (R´)0, 20Ñ0ü0Ä 24, 2 25, 2 2 26, 5 5 54, 5 5 56, 645 85, 86, 9(l4) 90Ñ0ü0Ä 100, , 265, (y])4, 280, 10Õ0é0ó, ª6, 145, 7, 148, 5 50Õ0£0ü0È, 645 9, 150, ¬1, 160, (eå)8, REFERENTIAL_CONSTRAINTS, 20Ú0½, (T )8, 249, (ry)0, 266, 550, 559, 586, 590, 5 5, 0Ó0ë1, 2 2, 0Ó0ë5, 2 2­, 506, 640 5 507, 660, 5 569, 674 REFERENTIAL_CONSTRAINTS REPLACE, 85 base4able, 590 requires, 6, 2 2 2(l4) 5 5 51, 583 REFERENTIAL_CONSTRAINTS reserved, 61, 73, 83, 84, 6iew, 550 85, 87, 100, 2 2 2SA, 411, REFERENTIAL_CONSTRAINTS_ 2 2 248, 466, 5 5, 626, 5 555, CONSTRAINT_TYPE_CHECK, 678 590 !!reserved7ord>, 83, 84, REFERENTIAL_CONSTRAINTS_ 85, 87, 100, 5 5(Œ¡), 678 PRIMARY_KEY, 590 RESIGNAL, 85 REFERENTIAL_DELETE_RULE_ RESTRICT, 85, 258, (R´)9, CHECK, 590 292, (Nã)4, 2 200, 0Ô0³9, 2 20Ú0½, REFERENTIAL_DELETE_RULE_ 0Õ0é0ó4, 5 581 NOT_NULL, 590 restricted data type REFERENTIAL_MATCH_OPTION_ attribute6iolation, CHECK, 590 456, 2 2 258, 621 REFERENTIAL_MATCH_OPTION_ !!result>, 141, (l4) 143 NOT_NULL, 590 , 141, REFERENTIAL_UPDATE_RULE_ () CHECK, 590 !!result5sing clause>, 451, REFERENTIAL_UPDATE_RULE_ 2 2 256, 457, 2 2 259, 460, 5 50Ú0Ë0Ò NOT_NULL, 590 Retrieval assignment, (y>)1 , 82, RETURN, 85 86, 87, 88, 98, 50Õ0£0ü0È, RETURNED_LENGTH, 84, 427, 534, 5 5(Nã) 2 2 20Ö0Ã0·0§0ë, 436, 2 2 20Ú0Ë0Ò, 458 RELATIVE, 85, 0Ú0½7, 2 278, RETURNED_OCTET_LENGTH, 84, 2 279, 681 427, 2 2 20Ö0Ã0·0§0ë, 436, 2 2 20Ú0Ë0Ò, 458 52 Database Language SQL RETURNED_SQLSTATE, 84, 2 2 279, !!row value constructor (ŒÇ), 2 2 281, 485, 2 2 286, 487, 2 2 288 (g )7, 2(R´) RETURNS, 85 , REVOKE, 85, 289, (Nã)4, 2 200, 2 26, 156, 0Ñ0ü0Ä 174, 5, 0Ó0ë0, 2 2ª, 0Ó0ë8, 2 2(y>), 0Õ0£0ü0È0Ñ0ü0Ä 176, (eå)7, 2, (h*)(l4) 2, 2 255, 484, 5 581 (h*)9, 2(eå), (g )4, 2(y]), 0Ø0ë0Ä0, !!revoke statement>, 5(l4) 2 2 244, 446, 2 2 247, 631, 5 542, 245, (R´)9, 294, 0Ô0³0, 2 210, 644, 5 548, 669 2 2ª, 0Ó0ë8, 2 2(y>), 0Õ0£0ü0È0Ñ0ü0Ä 2 20Ø0ë0Ä, !!row value constructor 2 268, 484, 5 546 element>, 0Ñ0ü0Ä 174, 5, RIGHT, 85, 0, 182, 4, 2 290, 444, 2 2 246, 631, 5 542 0Õ0é0ó0Ñ0ü0Ä 2 256, 681 , 79, 81, list>, 0Ñ0ü0Ä 174, 6, 83, 504, 5 2 290, 669 , 16, 5 5 59, 80, ROW_COUNT, 84, 479, 2 2 281, 107, 108, 1, 4, 1(R´), 484, 2 2 285, 670ª0ü0à 10Õ0¡0é0Ã0É, ª0Ñ0ü0Ä 10Ø0ë0Ä, 1, 144, Rule evaluation order,  ¬5, 168, 0Ñ0ü0Ä 180, 6, Rules determining collating 203, (h*)(l4) 2(Nã), (y>)9, 245, sequence5sage, (y>) (Œ¡)0, 272, (y])4, 281, (Nã)6, - S - (Nã)7, 2 2, 0Õ0¡0é0Ã0É0, 2 2(ry), 0Ö0Ã0·0§0ë6, SAVEPOINT, 85 2 288, 0Ø0ë0Ä0, 2 2 289, 491, 500, Scalar expressions, 107 508, 5¬, 520 , 155, ROLE, 85 ¬6, 203, 64() ROLLBACK, 68, 70, 85, 0Õ0é0ó5, !!scalar subquery>, , and
, 2 2 21, subquery>, (eå)0ª0ü0à 50, 54, 5 57, 5 59, 5 5 50, 2 242, SCALE, 84, 425, 2 2 2(Œ¡), 427, 0Ø0¯0¿0ü0ë9, 2 2 205, 484, 5(Œ¡), 655, 2 2 20Ö0Ã0·0§0ë, 436, 2 2 20Ø0ë0Ä, 440, 2 2 241, 5 571, 674 450Ñ0ü0Ä 2 2 254, 455, 2 2 256, 457, ROUTINE, 85 50Ø0ë0Ä, 544, 570, 571, 572, ROW, 85 660ª0ü0à ROWS, 85, (Œ¡)0, 275, (R´)1, !!scale>, 63, 107, 1SA, 109, 0Ø0ë0Ä7, 5 581 110, 0Õ0é0ó8, 2 261, 515, 5­, , 0Ñ0ü0Ä 174, 520, 5(g ), 658 203 SCHEMA, 85, 255, (ry)8, 2 241, , 417, 2 2 283, 484, 50Õ0é0ó, 567 2(y]), (g )8 Index 50ª0ü0à , 65, (ry)5, 544, 549, 550, 551, 55(l4) (ry)6 553, 557, 558, 559, 561, 56(l4) 569, 571, 573, 574, , 0Ó0ë1 576, 580, 583, 584, 585, , 93, 5 50, 608, 5 510, 611, 5 540 100, 255, (ry)6, 257, (Œ¡)0Ñ0ü0Ä SCHEMATA base table, 569 644, 5 560 SCHEMATA6iew, 50Ú0Ë0Ò !!schema collation name>, SCHEMATA_FOREIGN_KEY, 569 2 2, 0Ó0ë5 SCHEMATA_PRIMARY_KEY, 569 !!schema definition>, 44, , 52, 65, 93, 100, 101, 2 2(eå), 0Õ0¡0é0Ã0É1 252, (ry)5, 256, (Œ¡)0, 261, SCHEMA_NAME, 84, 0Õ0é0ó4, 2 2 280, 263, (Nã)6, 2 201, 0Ó0ë1, 2 2¬, 481, 2 2 286, 487, 50Ú0Ë0Ò, 541, 0Õ0¡0é0Ã0É0, 2 2(ry), 0Ø0¯0¿0ü0ë8, 2 2 284, 566, 543, 544, 549, 550, 551, 568, 660 55(l4) 553, 557, 558, 559, Schema definition and 561, 56(l4) 569 manipulation, (ry)5 SCHEMA_OWNER, 538, 541, , (ry)5, 256, 540Ñ0ü0Ä 544, 549, 550, 551, 63(l4) 5 544 552, 550Ñ0ü0Ä 557, 558, 559, , 15, 2 29, 2 2 24, 561, 562, 569 2 2 25, 2 2 26, 5 54, 5 5 5(l4) 5 5 50Ñ0ü0Ä 98, SCHEMA_OWNER_NOT_NULL, 569 99, 101, 10(l4) 103, 104, scope, 1, 10, 14, 2 29, 5 5(l4) (T )9, 252, (ry)5, 256, (ry)7, 5 50Ñ0ü0Ä 5 5 50, 99, 102, 100Ñ0ü0Ä (ry)8, 260, (Œ¡)0Ñ0ü0Ä 283, (Nã)4, 104, 8, 1, 1, 1(g ), 296, (Nã)7, 2 200, 0Ô0³1, 2 202, 5, 260, (R´)0Ñ0ü0Ä 2 256, 0Ú0Ë0Ò6, 0Ô0³4, 2 2SD, 0Ó0ë1, 2 2, 0Ó0ë0Ñ0ü0Ä 2 292, 0Ø0ë0Ä4, 2 297, 431, 2 2 20Õ0£0ü0È, 2 2¬, 0Ó0ë6, 2 2, 0Õ0¡0é0Ã0É0, 2 2(h*), 447, 2 2 249, 450, 2 2 251, 459, 0Õ0¡0é0Ã0É0Ñ0ü0Ä 2 2(ry), 0Õ0¡0é0Ã0É6, 2 2(R´), 0Ö0Ã0·0§0ë1, 2 2 265, 466, 2 2 267, 475, 2 2 292, 2 297, 0Ø0ë0Ä8, 2 2 2¬, 417, 2 2 286, 501, 5 569 487, 2 2 293, 616, 5 544, 654, Scope, 1 656, 5 557, 661, 5 568, 669 scope clause, 8, 1, , 101, 431, 2 2 20Õ0£0ü0È (ry)5, 257, 644, 5 557 , 99, 10(l4) 104, 431, 2 2 20Õ0£0ü0È, 447, 2 2 251 54 Database Language SQL SCROLL, 85, 2 271, 0Ú0½(l4) 2 274, SELECT, 65, 66, 75, 85, 2 277, 464, 2 2 265, 469, 5 50Õ0é0ó, 9, 1(g ), 0, 182, 0Ñ0ü0Ä 638, 5 547, 681 184, 1, 197, 8, 245, SEARCH, 85 (Œ¡)1, 271, (y])(l4) 273, (y])6, !!search condition>, 15, 2 26, 284, (R´)9, 298, 0Ô0³0Ñ0ü0Ä 2 2(Nã), 2 2 2(l4) 2 2 20Ñ0ü0Ä 5 58, 1, (l4) 0Õ0£0ü0È0, 2 20Ö0Ã0·0§0ë, 0Õ0£0ü0È5, 2 20Ø0¯0¿0ü0ë, 0Ú0Ë0Ò(l4) 1, 142, 0Ñ0ü0Ä 180, 1, 2 298, 480Ñ0ü0Ä 2 2 284, 485, 50Õ0£0ü0È, 183, 5, 186, 7, 189, 537, 50Ú0Ë0Ò, 539, 541, 54(l4) 0, 2(Nã), (y>)0, 264, (y])1, 543, 544, 545, 546, 547, 272, (R´)1, 282, (R´)4, 289, 548, 549, 550, 551, 55(l4) (Nã)4, 2 200, 0Ô0³1, 2 202, 0Ô0³7, 553, 554, 555, 556, 557, 2 2SD, 0Ó0ë0Ñ0ü0Ä 2 2, 0Õ0¡0é0Ã0É0Ñ0ü0Ä 2 2(ry), 558, 559, 561, 562, 560Ñ0ü0Ä 0Õ0¡0é0Ã0É6, 2 20Ô0³, 0Õ0£0ü0È7, 2 286, 0Ú0Ë0Ò7, 571, 57(l4) 573, 576, 578, 2 294, 0Ø0ë0Ä5, 2 296, 485, 593, 580, 581, 580Ñ0ü0Ä 584, 585, 594, 595, 596, 5 50Õ0£0ü0È, 636, 586, 588, 591, 590Ñ0ü0Ä 595, 5 543, 677, 5 578 596, 5 500, 601, 5 502, 600Ñ0ü0Ä search condition too long 5 504, 606, 5 5SA, 610, 5 5, for information schema, 616, 5 5, 618, 5 577 (R´)(l4) 2 2(Œ¡), 620µ0ó0Á0ü0à , 53, 55, 57, 58, , 91, 94, 59, 10(l4) 1, 9, 2 250, 95, 96, 242, 629 0Ø0¯0¿0ü0ë8, 2 282, 484, 5 572, 677 , !!select sublist>, 191, 5, 91, 95, (T )(N) 5 543 !!seconds value>, 91, 94
, 9, (Œ¡)0, 283, (Nã)(l4) 294, 0Õ0¡0é0Ã0É9, 1(g ), 5, 177, 1, 192, 2 20Õ0¡0é0Ã0É, 0Õ0£0ü0È8, 2 297, 0Ø0ë0Ä8, 2 2 282, 0Ñ0ü0Ä 195, (eå)0Ñ0ü0Ä 2 282, 0Ú0Ë0Ò0Ñ0ü0Ä 480Ñ0ü0Ä 2 2 284, 568, 569, 570, 5 50Ó0ë, 63(l4) 5 50Õ0é0ó, 640Ñ0ü0Ä 5 577 570Ñ0ü0Ä 574, 576, 577, 578,
, , 44, 98, 580, 580Ñ0ü0Ä 584, 585, 588, 101, 103, 8, 1, 1, 590, 593, 595, 596, 598, 1(g ), 9, 193, 6, 197, 5 500, 60(l4) 5 504, 606, 5 5SA, (eå)0, 245, (ry)8, 260, (Œ¡)1, 610, 5 5, 646 263, (y])(l4) 274, (R´)(l4) 283, table check constraint, 41, (R´)9, 291, (Nã)(l4) 294, (Nã)6, 43 297, (Nã)8, 299, 0Ô0³0, 2 2(Œ¡), table constraint, 41, 42 0Õ0¡0é0Ã0É9, 2 20Ô0³, 0Õ0£0ü0È1, 2 20Õ0£0ü0È, 0Õ0£0ü0È4, !!table constraint>, 264, 2 20Õ0é0ó, 0Õ0£0ü0È8, 2 284, 0Ú0Ë0Ò6, 2 288, 270, (y])1, 2 2SD, 487 0Ú0Ë0Ò9, 2 291, 0Ø0ë0Ä(l4) 2 294, 0Ø0ë0Ä5, !!table constraint 2 2 259, 47(l4) 2 2 274, 475, 2 2 276, definition>, (Œ¡)0, 263, 477, 2 2 285, 49(l4) 5 50Ó0ë, 635, (Œ¡)4, 270, (Nã)1, 2 2SD, 0Ó0ë0, 5 50Ø0¯0¿0ü0ë, 638 586 4able0rivilege descriptor, 4able constraint descriptor 5 56 , 2 2 20, 2 2 21, 2 2 2(l4) 270, (y])1, !!table reference>, 8, (y])5, 289, (Nã)1, 2 20Ø0¯0¿0ü0ë, 0Õ0£0ü0È8 1, 0, 1(h*), (l4) 1(ry), Table constraints, 2 2 21 8, 179, 0, 192, 0Ñ0ü0Ä !!table definition>, 2 27, 2 28, 197, 9, 200, (R´)1, 296, 5(l4) 255, (Œ¡)0, 261, (Œ¡)(l4) (Nã)8, 2 20Ó0ë, 630, 5 50Ó0ë, 641 263, (Œ¡)5, 272, (y])4, 281, Tables, 2 27 284, 0Ø0¯0¿0ü0ë8, 2 2 284, 566 TABLES, 542, 540Ñ0ü0Ä 576, 578, 4able descriptor, 15, 2 29, 580, 580Ñ0ü0Ä 585, 586, 595, 2 2 20, 2 2 24, 5 5 55, 260, (Œ¡)1, 600, 5 540 (Œ¡)5, 273, (y])5, 283, (R´)9, TABLES base table, 576 (Nã)1, 292, (Nã)6, 2 2SD, 0Õ0¡0é0Ã0É6,
, 8, 1, 2 275, 576, 581 (eå)0Ñ0ü0Ä 2, (g )0, 2(g ), (g )0Ñ0ü0Ä !!table element>, (Œ¡)0, 261 2(T ), (g )5, 2 2 246, 447
, (Œ¡)0, TABLES view, 54() 2 297 TABLES_CHECK_NOT_VIEW, 576 TABLES_FOREIGN_KEY_SCHEMATA , 576 TABLES_PRIMARY_KEY, 576 TABLES_TYPE_CHECK, 576 Index 5 55 , TABLE_CONSTRAINTS_TABLE_ 175, 6, 196, 7, 200, SCHEMA_NOT_NULL, 585 (eå)(l4) 2, 0Ø0ë0Ä0, 2 2 244, 446, TABLE_CONSTRAINTS_UNIQUE_ 5 50Ó0ë, 63(l4) 5 542, 648 CHECK, 586 !!table value constructor TABLE_NAME, 84, 480, 2 2 281, list>, 6 486, 2 2 287, 54(l4) 543, 544, TABLE_CATALOG, 54(l4) 543, 545, 546, 547, 549, 552, 544, 545, 546, 547, 549, 557, 558, 559, 561, 56(l4) 55(l4) 557, 558, 559, 561, 572, 576, 578, 580, 581, 562, 57(l4) 576, 578, 580, 580Ñ0ü0Ä 584, 585, 586, 587, 581, 583, 584, 585, 586, 588, 589, 595, 596, 597, 587, 588, 589, 591, 595, 600, 5 501, 60(l4) 5 503 596, 597, 600, 5 501, 60(l4) TABLE_OR_DOMAIN_CATALOG, 600µ0ó0Á0ü0à 50Ø0ë0Ä, 545, 570, 571, 572, TABLE_CONSTRAINTS, 549, 570Ñ0ü0Ä 581 559, 561, 585, 586, 588, TABLE_OR_DOMAIN_CHECK_ 590, 591, 590Ñ0ü0Ä 5 5­, 618 COMBINATIONS, 570 TABLE_CONSTRAINTS base TABLE_OR_DOMAIN_DATA_TYPE_ table, 585 NOT_NULL, 570 TABLE_CONSTRAINTS6iew, 549 TABLE_OR_DOMAIN_NAME, 539, TABLE_CONSTRAINTS_CHECK_ 545, 570, 571, 57(l4) 573, REFERENCES_TABLES, 585 581 TABLE_CONSTRAINTS_CHECK_ TABLE_OR_DOMAIN_SCHEMA, VIEWS, 586 50Ø0ë0Ä, 545, 570, 571, 572, TABLE_CONSTRAINTS_DEFERRED_ 570Ñ0ü0Ä 581 CHECK, 585 TABLE_PRIVILEGES, 54(l4) 546, TABLE_CONSTRAINTS_ 600, 5 540 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, 5 500 TABLE_CONSTRAINTS_PRIMARY_ TABLE_PRIVILEGES_GRANTABLE_ KEY, 585 CHECK, 5 500 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 66 Database Language SQL TABLE_PRIVILEGES_GRANTOR_ 4emporary4able, 0Ú0½, 0Ú0Ë0Ò, FOREIGN_KEY_USERS, 600 0Ø0ë0Ä, 46, 53, 56, 57, 58, TABLE_PRIVILEGES_PRIMARY_ 60, 72, 73, 76, 101, KEY, 5 500 103, (T )5, 258, (Œ¡)0, 261, TABLE_SCHEMA, 54(l4) 543, (Œ¡)(l4) 265, (y])5, 281, (R´)0Ñ0ü0Ä 544, 545, 546, 547, 549, 294, (Nã)6, 2 2(ry), 0Ö0Ã0·0§0ë0Ñ0ü0Ä 2 284, 552, 557, 558, 559, 561, 0Ú0Ë0Ò6, 2 289, 0Ø0ë0Ä(l4) 2 294, 0Ø0ë0Ä7, 56(l4) 572, 576, 578, 580, 2 298, 400Ñ0ü0Ä 2 2 2(eå), 459, 2 2 286, 581, 580Ñ0ü0Ä 584, 585, 586, 487, 2 2 292, 494, 2 2 295, 577, 587, 588, 589, 595, 596, 5 50Õ0£0ü0È, 634, 5 50Ø0¯0¿0ü0ë, 639, 5 552, 597, 600, 5 501, 60(l4) 5 503 655, 5 568 TABLE_TYPE, 542, 576, 578, , 2 29, 2 2 26, TABLE_TYPE_NOT_NULL, 576 50Ñ0ü0Ä 56, 57, 58, 5 50, 5 5 5(l4) !!target character set 262, (Œ¡)5, 281, (Nã)6, 2 241, specification>, 2 2(eå), 0Ö0Ã0·0§0ë0Ñ0ü0Ä 2 297, 0Ø0ë0Ä8, 2 2 289, 49(l4) 0Õ0£0ü0È5 2 2 294, 495, 5(ry), 634, 5 50Ø0¯0¿0ü0ë, , 10, 5 5(l4) 1, 5, 281, (Nã)6, 639, 5 552 0Õ0¡0é0Ã0É5, 2 247, 0Õ0é0ó0, 2 275, 0Ú0½7, temporary view, 668 2 280, 0Ú0Ë0Ò(l4) 2 283, 436, 2 2 20Ø0ë0Ä, !!term>, 157, ­8, 169 451, 2 2 256, 457, 2 2 258, 460, Terms denoting rule 2 2 269, 470, 5 547, 667 requirements,  TARGET_CHARACTER_SET_ TEST, 85 THEN, 85, 1, 142, 0Ó0ë4, CATALOG, 556, 610, 5 5 2 2­, 0Ó0ë8, 543, 544, 5 582 TARGET_CHARACTER_SET_NAME, THERE, 85 556, 610, 5 5 TIME, 19, 29, 2 20, 2 21, 2 2 29, TARGET_CHARACTER_SET_SCHEMA 85, 90, 94, 1SA, 0, , 556, 5 510, 611 1, (l4) 1(g ), 0Ñ0ü0Ä 1(Nã), TEMPORARY, 2 27, 2 28, 85, 260, ª9, 152, ¬0Ñ0ü0Ä 165, ­6, (Œ¡)1, 2 297, 576, 577, 630Ñ0ü0Ä 167, 42(l4) 2 2 2(Nã), 440, 2 2 246, 5 582 484, 571, 68()