DB2 Server for VSE & VM: SQL Reference


Table of Contents

Summary of Changes

  • |Summary of Changes for DB2 Version 7 Release 1
  • |Enhancements, New Functions, and New Capabilities
  • |Reliability, Availability, and Serviceability Improvements
  • |Library Enhancements
  • Chapter 1. Introduction

  • Who This Book Is For
  • Prerequisite Knowledge
  • How This Book Is Organized
  • |How to Send Your Comments
  • Syntax Notation Conventions
  • SQL Reserved Words
  • Conventions for Representing Mixed Data Values
  • Short Forms Used in Syntax Diagrams
  • Chapter 2. Concepts

  • Static SQL
  • Dynamic SQL
  • Interactive SQL
  • Extended Dynamic SQL
  • Relational Database
  • Tables
  • Keys
  • Primary Keys
  • Integrity
  • Data Integrity
  • Entity Integrity
  • Referential Integrity
  • Relationships Between Tables
  • Foreign Keys
  • Referential Constraints
  • Delete Rules
  • Insert Rules
  • Update Rules
  • Activating and Deactivating Keys
  • Indexes
  • Views
  • Packages
  • Catalog
  • Application Processes, Concurrency, and Recovery
  • Isolation Level
  • Repeatable Read (RR)
  • Cursor Stability (CS)
  • Uncommitted Read (UR)
  • Isolation Level Restrictions
  • Isolation Level Escalation
  • Program Control of Isolation
  • Application Requesters and Application Servers
  • Distributed Relational Database
  • Application Servers in DRDA
  • Remote Unit of Work
  • Distributed Unit of Work
  • The Use of DB2 Family SQL on Various Application Servers
  • Data Representation Considerations
  • Character Conversion
  • Character Sets and Code Pages
  • Coded Character Sets and CCSIDs
  • Authorization and Privileges
  • Chapter 3. Language Elements

  • Characters
  • Tokens
  • Spaces
  • Comments
  • Identifiers
  • SQL Identifiers
  • Host Identifiers
  • Naming Conventions
  • Authorization IDs and Authorization-names
  • Example 1
  • Example 2
  • Data Types
  • |Result Set Locators
  • Nulls
  • Character Strings
  • Graphic Strings
  • Numbers
  • Datetime Values
  • Null Values
  • Assigning Null Values Within the Database:
  • Returning Null Values to the Application from the Database:
  • Null Values within Expressions and Predicates
  • Equality and Ordering of Null Values:
  • Checking for a Null Value:
  • Assignments and Comparisons
  • Numeric Assignments
  • String Assignments
  • Conversion Rules for String Assignments
  • Datetime Assignments
  • Numeric Comparisons
  • String Comparisons
  • Conversion Rules for String Comparison
  • Datetime Comparisons
  • Constants
  • Integer Constants
  • Floating-Point Constants
  • Decimal Constants
  • Character String Constants
  • Graphic String Constants
  • Special Registers
  • USER
  • CURRENT DATE
  • CURRENT SERVER
  • CURRENT TIME
  • CURRENT TIMESTAMP
  • CURRENT TIMEZONE
  • Column Names
  • Qualified Column Names
  • References to Host Variables
  • The Metavariable host-variable
  • Host Structures and Indicator Arrays
  • Expressions
  • Without Operators
  • With the Concatenation Operator
  • With Arithmetic Operators
  • Two-Integer Operands
  • Integer and Decimal Operands
  • Two-Decimal Operands
  • Decimal Arithmetic in SQL
  • Floating-Point Operands
  • Datetime Operands
  • Datetime Arithmetic in SQL
  • Precedence of Operations
  • Predicates
  • Basic Predicate
  • Quantified Predicate
  • BETWEEN Predicate
  • EXISTS Predicate
  • IN Predicate
  • LIKE Predicate
  • NULL Predicate
  • Search Conditions
  • Example 1
  • Example 2
  • Chapter 4. Functions

  • Column Functions
  • AVG
  • COUNT
  • MAX
  • MIN
  • SUM
  • Scalar Functions
  • CHAR
  • DATE
  • DAY
  • DAYS
  • DECIMAL
  • DIGITS
  • FLOAT
  • HEX
  • HOUR
  • INTEGER
  • LENGTH
  • MICROSECOND
  • MINUTE
  • MONTH
  • SECOND
  • STRIP
  • SUBSTR
  • TIME
  • TIMESTAMP
  • TRANSLATE
  • VALUE
  • VARGRAPHIC
  • YEAR
  • Chapter 5. Queries

  • Authorization
  • subselect
  • select-clause
  • from-clause
  • where-clause
  • group-by-clause
  • having-clause
  • Examples of a subselect
  • Example 1
  • Example 2
  • Example 3
  • Example 4
  • Example 5
  • Example 6
  • Example 7
  • fullselect
  • Examples of a fullselect
  • Conversion Rules for Operations that Combine Strings
  • select-statement
  • order-by-clause
  • update-clause
  • with-clause
  • Examples of a select-statement
  • Chapter 6. Statements

  • How SQL Statements Are Invoked
  • Embedding a Statement in an Application Program
  • Dynamic Preparation and Execution
  • Static Invocation of a select-statement
  • Dynamic Invocation of a select-statement
  • Interactive Invocation
  • SQL Return Codes
  • SQLCODE
  • SQLSTATE
  • SQL Comments
  • Example
  • ACQUIRE DBSPACE
  • |ALLOCATE CURSOR
  • ALTER DBSPACE
  • ALTER PROCEDURE
  • ALTER PSERVER
  • ALTER TABLE
  • |ASSOCIATE LOCATORS
  • BEGIN DECLARE SECTION
  • CALL
  • CLOSE
  • Extended CLOSE
  • COMMENT ON
  • COMMENT ON PROCEDURE
  • COMMIT
  • CONNECT (for VM)
  • CONNECT (for VSE)
  • CREATE INDEX
  • CREATE PACKAGE
  • CREATE PROCEDURE
  • CREATE PSERVER
  • CREATE SYNONYM
  • CREATE TABLE
  • CREATE VIEW
  • DECLARE CURSOR
  • Extended DECLARE CURSOR
  • DELETE
  • DESCRIBE
  • Extended DESCRIBE
  • |DESCRIBE CURSOR
  • |DESCRIBE PROCEDURE
  • DROP
  • DROP PROCEDURE
  • DROP PSERVER
  • DROP STATEMENT
  • END DECLARE SECTION
  • EXECUTE
  • Extended EXECUTE
  • EXECUTE IMMEDIATE
  • EXPLAIN
  • FETCH
  • Extended FETCH
  • GRANT (Package Privileges)
  • GRANT (System Authorities)
  • GRANT (Table Privileges)
  • INCLUDE
  • INSERT
  • LABEL ON
  • LOCK DBSPACE
  • LOCK TABLE
  • OPEN
  • Extended OPEN
  • PREPARE
  • Extended PREPARE
  • PUT
  • Extended PUT
  • REVOKE (Package Privileges)
  • REVOKE (System Authorities)
  • REVOKE (Table Privileges)
  • ROLLBACK
  • SELECT INTO
  • UPDATE
  • UPDATE STATISTICS
  • WHENEVER
  • Appendix A. SQL Limits

  • Notes
  • Appendix B. SQLCA and SQLDA

  • SQL Communication Area (SQLCA)
  • In COBOL and Assembler
  • In PL/I and C
  • In FORTRAN
  • Description of Fields
  • INCLUDE SQLCA Declarations
  • SQL Descriptor Area (SQLDA)
  • Description of Fields
  • Fields in an Occurrence of SQLVAR
  • SQLTYPE and SQLLEN
  • CCSID Usage
  • INCLUDE SQLDA Declarations
  • Appendix C. DB2 Server for VSE & VM Catalog

  • "Roadmap" to Catalog
  • Updateable Columns
  •  SYS ACCESS
  •  SYS CATALOG
  •  SYS CCSIDS
  •  SYS CHARSETS
  •  SYS COLAUTH
  •  SYS COLSTATS
  •  SYS COLUMNS
  •  SYS DBSPACES
  •  SYS DROP
  •  SYS FIELDS
  •  SYS FPARMS
  •  SYS INDEXES
  •  SYS KEYCOLS
  •  SYS KEYS
  •  SYS LANGUAGE
  •  SYS OPTIONS
  •  SYS PARMS
  •  SYS PROGAUTH
  •  SYS PSERVERS
  •  SYS ROUTINES
  •  SYS STRINGS
  •  SYS SYNONYMS
  •  SYS TABAUTH
  •  SYS USAGE
  •  SYS USERAUTH and  SYS USERLIST
  •  SYS VIEWS
  • Appendix D. Sample Tables

  • Relationships Among the Tables
  • ACTIVITY Table
  • Relationship of ACTIVITY to Other Tables
  • CL_SCHED Table
  • DEPARTMENT Table
  • Relationship of DEPARTMENT to Other Tables
  • EMPLOYEE Table
  • Relationship of EMPLOYEE to Other Tables
  • EMP_ACT Table
  • Relationship of EMP_ACT to Other Tables
  • IN_TRAY Table
  • PROJECT Table
  • Relationship of PROJECT to Other Tables
  • PROJ_ACT Table
  • Relationship of PROJ_ACT to Other Tables
  • Appendix E. Data Conversion Chart

    Appendix F. Terminology Differences

  • Terminology Cross-Reference
  • Appendix G. DRDA Considerations

  • Omissions from the Standards
  • Extensions to the Standards
  • DB2 Server for VSE & VM Facility Restrictions
  • Appendix H. Incompatibilities Between Releases

  • Definition of an Incompatibility
  • Impact on Existing Applications
  • V2R1 and V1R3.5 Incompatibilities
  • V2R2 and V2R1 Incompatibilities
  • Detailed Notes on V2R2-V2R1 Incompatibilities
  • V3R1 and V2R2 Incompatibilities
  • Detailed Notes on V3R1-V2R2 Incompatibilities
  • V3R3 and V3R2 Incompatibilities (VM Only)
  • Detailed Notes on V3R3-V3R2 Incompatibilities
  • V3R4 and V3R3 Incompatibilities (VM Only)
  • Detailed Notes on V3R4-V3R3 Incompatibilities
  • V3R4 and V3R2 Incompatibilities (VSE Only)
  • Detailed Notes on V3R4-V3R2 Incompatibilities
  • V3R5 and V3R4 Incompatibilities
  • V5R1 and V3R5 Incompatibilities
  • V6R1 and V5R1 Incompatibilities
  • Notices

  • Programming Interface Information
  • Trademarks
  • Bibliography

    Index



    [ Top of Page | Previous Page | Next Page | Table of Contents | Index ]