Reference > Database > WebSphere Commerce database tables database schemaobject naming conventions


Database schema object naming conventions

If you customize the e-commerce application, you can create database tables. For consistency WebSphere Commerce tables follow these conventions.

Naming convention Description
Tables and views

  • To avoid name collision (duplicate names) with WebSphere Commerce tables and views in future releases, the first character in the table or view name must be X. For example, XMYTABLE.

  • The table name must be no more than 18 characters in length. If the name exceeds this limit, shorten the length by removing vowels from the end of the name, until only 18 characters remain.

    Table names longer than 18 characters will work, but cannot be propagated to the staging server due to the STAGLOG table limitations.

  • The view name must be no more than 10 characters in length. If the name exceeds this limit, shorten the length by removing vowels from the end of the name, until only 10 characters remain.

  • The table or view name must not contain any special characters, such as "_", "+", "$", "%", or blank spaces.

  • Do not use database reserved words as a table or view name.

  • View names must end with VW.

  • The table name must be a plural noun.

  • The view name must be a singular noun.

Columns

When you create tables that follow the preceding conventions for table names, you can implement the own naming convention for columns within those tables.

In general, adding new columns to WebSphere Commerce tables is not a supported customization scenario. However, the DB2 generated column feature is supported. You can add generated columns to WebSphere Commerce tables. The generated columns must follow the naming conventions.

  • To avoid name collision (duplicate names) with columns in WebSphere Commerce tables in future releases, the first two characters in the column name must be X_. For example, X_MYCOLUMN.

  • The column name must be no more than 18 characters in length. If the name exceeds this limit, shorten the length by removing vowels from the end of the name, until there are only 18 characters.

  • Columns names (other than foreign keys) must not contain any special characters, such as "+", "$", "%", or blank spaces.

  • Do not use database reserved words as a column name.

Indexes

  • The index name must be no more than 18 characters in length.

  • The index name must not contain blank spaces.

  • The index name must not contain any database reserved words.

  • A non-unique index must be named as I_tablex where table is the name of the table and x is a number, beginning at 1. For example, a non-unique index for the USERS table is I_USERS1.

  • A unique index must be named as UI_tablex where table is the name of the table and x is a number, beginning at 1. For example, a unique index for the USERS table is UI_USERS1.

  • The total size of the index must be no larger than 254 bytes.

  • The index name must be unique throughout the whole database schema.

Primary keys

  • The primary key name must be no more than 18 characters in length.

  • The primary key name must not contain blank spaces.

  • The primary key name must not contain any database reserved words.

  • The primary key must be named as P_table where table is the name of the table. For example, the primary key for the USERS table is P_USERS.

  • The primary key name must be unique throughout the whole database schema.

Foreign keys

  • The foreign key name must be no more than 18 characters in length.

  • The foreign key name must not contain blank spaces.

  • The foreign key name must not contain any database reserved words.

  • The foreign key must be named as F_tablex where table is the name of the table and x is a number that starts from 1. For example, the foreign key for the USERS table is F_USERS1.

  • The foreign key name must be unique throughout the whole database schema.

Database triggers

  • The database trigger name must be no more than 18 characters in length.

  • The database trigger name must not contain blank spaces.

  • The database trigger name must not contain any database reserved words.

  • The database trigger must be named as T_tablex where table is the name of the table and x is a number that starts from 1. For example, the database trigger name for the USERS table is T_USERS1.

  • The database trigger name must be unique throughout the whole database schema.

Stored procedures

  • The stored procedure must be no more than 18 characters in length.

  • The stored procedure name must not contain blank spaces.

  • The stored procedure name must be named as XSP_producename.

  • The stored procedure name must be unique throughout the database schema.

If working with extended sites, review the information in Management Center modeling guidelines for extended sites.


+

Search Tips   |   Advanced Search