Reserved words in Db2 for z/OS

Restrictions exist on the use of certain words that are used by Db2 for z/OS®. In some cases, these names are reserved and cannot be used by application programs. In other cases, certain names are not recommended for use by application programs though not prevented from being used by the database manager.

Keywords can be used as ordinary identifiers, except in a context where they could also be interpreted as SQL syntax. When a keyword can be interpreted as SQL syntax the keyword is considered a reserved word in that context, which means that it cannot be used as an ordinary identifier. However, a keyword can be used as an identifier in a context where it is a reserved word, by specifying it as a delimited identifier. For example:

  • ALL cannot be a column name in a SELECT statement, unless it is delimited. However, if the quotation mark (") is the escape character that begins and ends delimited identifiers, “ALL” can be used as a column name in a SELECT statement.
  • COUNT cannot be used as a column name in a SELECT statement, unless it is also specified as delimited.

New reserved words for Db2 12 are identified by note 1 in the following table. Some topics in this information might also indicate words that cannot be used in the specific context that is being described.

IBM® SQL has additional reserved words that Db2 for z/OS does not enforce. Therefore, you should not use these additional reserved words as ordinary identifiers in names that have a continuing use. For a list of the reserved words, see PDF file icon SQL Reference for Cross-Platform Development - Version 6 for a list of the words.

Begin general-use programming interface information.

Table 1. Reserved words in Db2 for z/OS
First letter Reserved words
A
  • ADD
  • AFTER
  • ALL
  • ALLOCATE
  • ALLOW
  • ALTER
  • AND
  • ANY
  • AS
  • ARRAY
  • ARRAY_EXISTS
  • ASENSITIVE
  • ASSOCIATE
  • ASUTIME
  • AT
  • AUDIT
  • AUX
  • AUXILIARY
B
  • BEFORE
  • BEGIN
  • BETWEEN
  • BUFFERPOOL
  • BY
C
  • CALL
  • CAPTURE
  • CASCADED
  • CASE
  • CAST
  • CCSID
  • CHAR
  • CHARACTER
  • CHECK
  • CLONE
  • CLOSE
  • CLUSTER
  • COLLECTION
  • COLLID
  • COLUMN
  • COMMENT
  • COMMIT
  • CONCAT
  • CONDITION
  • CONNECT
  • CONNECTION
  • CONSTRAINT
  • CONTAINS
  • CONTENT
  • CONTINUE
  • CREATE
  • CUBE
  • CURRENT
  • CURRENT_DATE
  • CURRENT_LC_CTYPE
  • CURRENT_PATH
  • CURRENT_SCHEMA
  • Start of changeFL 504 CURRENT_SERVER1End of change
  • CURRENT_TIME
  • CURRENT_TIMESTAMP
  • Start of changeFL 504 CURRENT_TIMEZONE1End of change
  • CURRVAL
  • CURSOR
D
  • DATA
  • DATABASE
  • DAY
  • DAYS
  • DBINFO
  • DECLARE
  • DEFAULT
  • DELETE
  • DESCRIPTOR
  • DETERMINISTIC
  • DISABLE
  • DISALLOW
  • DISTINCT
  • DO
  • DOCUMENT
  • DOUBLE
  • DROP
  • DSSIZE
  • DYNAMIC
E
  • EDITPROC
  • ELSE
  • ELSEIF
  • ENCODING
  • ENCRYPTION
  • END
  • ENDING
  • END-EXEC2
  • ERASE
  • ESCAPE
  • EXCEPT
  • EXCEPTION
  • EXECUTE
  • EXISTS
  • EXIT
  • EXPLAIN
  • EXTERNAL
F
  • FENCED
  • FETCH
  • FIELDPROC
  • FINAL
  • FIRST
  • FOR
  • FREE
  • FROM
  • FULL
  • FUNCTION
G
  • GENERATED
  • GET
  • GLOBAL
  • GO
  • GOTO
  • GRANT
  • GROUP
H
  • HANDLER
  • HAVING
  • HOLD
  • HOUR
  • HOURS
I
  • IF
  • IMMEDIATE
  • IN
  • INCLUSIVE
  • INDEX
  • INHERIT
  • INNER
  • INOUT
  • INSENSITIVE
  • INSERT
  • INTERSECT
  • INTO
  • IS
  • ISOBID
  • ITERATE
J
  • JAR
  • JOIN
K
  • KEEP
  • KEY
L
  • LABEL
  • LANGUAGE
  • LAST
  • LC_CTYPE
  • LEAVE
  • LEFT
  • LIKE
  • Start of changeLIMIT1End of change
  • LOCAL
  • LOCALE
  • LOCATOR
  • LOCATORS
  • LOCK
  • LOCKMAX
  • LOCKSIZE
  • LONG
  • LOOP
M
  • MAINTAINED
  • MATERIALIZED
  • MICROSECOND
  • MICROSECONDS
  • MINUTES
  • MODIFIES
  • MONTH
  • MONTHS
N
  • NEXT
  • NEXTVAL
  • NO
  • NONE
  • NOT
  • NULL
  • NULLS
  • NUMPARTS
O
  • OBID
  • OF
  • Start of changeOFFSET1End of change
  • OLD
  • ON
  • OPEN
  • OPTIMIZATION
  • OPTIMIZE
  • OR
  • ORDER
  • ORGANIZATION
  • OUT
  • OUTER
P
  • PACKAGE
  • PADDED
  • PARAMETER
  • PART
  • PARTITION
  • PARTITIONED
  • PARTITIONING
  • PATH
  • PIECESIZE
  • PERIOD
  • PLAN
  • PRECISION
  • PREPARE
  • PREVVAL
  • PRIOR
  • PRIQTY
  • PRIVILEGES
  • PROCEDURE
  • PROGRAM
  • PSID
  • PUBLIC
Q
  • QUERY
  • QUERYNO
R
  • READS
  • REFERENCES
  • REFRESH
  • RELEASE
  • RENAME
  • RESIGNAL
  • REPEAT
  • RESTRICT
  • RESULT
  • RESULT_SET_LOCATOR
  • RETURN
  • RETURNS
  • REVOKE
  • RIGHT
  • ROLE
  • ROLLBACK
  • ROLLUP
  • ROUND_CEILING
  • ROUND_DOWN
  • ROUND_FLOOR
  • ROUND_HALF_DOWN
  • ROUND_HALF_EVEN
  • ROUND_HALF_UP
  • ROUND_UP
  • ROW
  • ROWSET
  • RUN
S
  • SAVEPOINT
  • SCHEMA
  • SCRATCHPAD
  • SECOND
  • SECONDS
  • SECQTY
  • SECURITY
  • SEQUENCE
  • SELECT
  • SENSITIVE
  • SESSION_USER
  • SET
  • SIGNAL
  • SIMPLE
  • SOME
  • SOURCE
  • SPECIFIC
  • STANDARD
  • STATIC
  • STATEMENT
  • STAY
  • STOGROUP
  • STORES
  • STYLE
  • SUMMARY
  • SYNONYM
  • SYSDATE
  • SYSTEM
  • SYSTIMESTAMP
T
  • TABLE
  • TABLESPACE
  • THEN
  • TO
  • TRIGGER
  • TRUNCATE
  • TYPE
U
  • UNDO
  • UNION
  • UNIQUE
  • UNTIL
  • UPDATE
  • USER
  • USING
V
  • VALIDPROC
  • VALUE
  • VALUES
  • VARIABLE
  • VARIANT
  • VCAT
  • VERSIONING
  • VIEW
  • VOLATILE
  • VOLUMES
W
  • WHEN
  • WHENEVER
  • WHERE
  • WHILE
  • WITH
  • WLM
X
  • XMLCAST
  • XMLEXISTS
  • XMLNAMESPACES
Y
  • YEAR
  • YEARS
Z
  • ZONE
Notes:
  1. New reserved word for Db2 12.
  2. COBOL only

End general-use programming interface information.