When creating a table name in a DB2 database, it may contain various types of characters according to your needs. This article describes how to use different characters when creating a table name for your reference.
Environment:
Product: DB2 UDB
Platform: cross-platform
Version: v8
Problem description:
In DB2 UDB, unless otherwise specified, all names can contain the following characters:
· A to Z. When used in most names, characters A to Z are converted from the write form to the uppercase form.
· 0 to 9
· @, #, $, And _ underlines)
· The name cannot start with a number or underline.
The naming of a table as a database object follows the same rules. Therefore, even if the table name used during table creation is in lower case, DB2 automatically converts the table to upper case, for example:
Db2 create table testname (a1 int)
The DB20000I SQL command is successfully completed.
Db2 list tables
Table/view mode type creation time
-----------------------------------------------------------------------------
:
Testname testuser t 2005-09-24-18.15.30.428001
:
What should I do if the table name I want to create contains lower-case characters? Here we will briefly introduce how to create and use it.