This is an old revision of the document!



SQLWays Product Page - Migration to IBM DB2 Free Evaluation

IBM DB2 - Identifiers

This article describes identifiers in DB2.

Identifiers rules

DB2 - Identifier
First Character An alphabetical character
Subsequent Characters Alphanumeric characters and the underscore (_)
Maximum Length 128 bytes

Schema name is limited to 30 bytes
Case Sensitivity Identifiers are not case sensitive, DB2 interprets them as uppercase
Standards ANSI SQL - $ is not allowed

Identifiers - Differences between DB2 and other Databases

Database Identifiers First Character Subsequent Characters Max Length
Oracle Oracle Identifiers No differences Allowed: $ and # 30
SQL Server SQL Server Identifiers Allowed: _ , @ and # Allowed: $, @ and # 128
MySQL MySQL Identifiers Allowed: digit Allowed: $ 64
Sybase ASE Sybase ASE Identifiers Allowed: _ , @ and # Allowed: $, @ and # 255
PostgreSQL PostgreSQL Identifiers Allowed: _ Allowed: $ 63

Quoted or Delimited Identifiers

DB2 - Quoted Identifiers
Quotation Marks Double quotation marks (“”)
Characters 2 double quotes can be used to include a double quote
Maximum Length 128 bytes not including quotes
Case Sensitivity Case sensitive

Quoted Identifiers - Differences between DB2 and other Databases

Database Identifiers Quotation Marks Characters Case Sensitivity
Oracle Oracle Quoted Identifiers “” Any except quotes Case sensitive
SQL Server SQL Server Quoted Identifiers [] and “” Any except quotes Case insensitive
MySQL MySQL Identifiers `` and “” Any except quotes Case sensitive
Sybase ASE Sybase ASE Quoted Identifiers [] and “” Any except quotes Case insensitive
PostgreSQL PostgreSQL Quoted Identifiers “” Any including quotes Case sensitive


SQLWays Product Page - Migration to IBM DB2 Free Evaluation


© 1999-2024, Ispirer Systems, LLC. All Rights Reserved.