SYSDEFAULTS

The sysdefaults system catalog table lists the user-defined defaults that are placed on each column in the database. One row exists for each user-defined default value.

The sysdefaults table has the following columns:
Table 1. SYSDEFAULTS table column descriptions
Column Type Explanation
tabid INTEGER Code uniquely identifying a table. When the class column contains the code P, then the tabid column references a procedure ID not a table ID.
colno SMALLINT Code uniquely identifying a column.
type CHAR(1) Code identifying the type of default value:
  • C = Current®
  • L = Literal value
  • N = NULL
  • S = Dbservername or Sitename
  • T = Today
  • U = User
default CHAR(256) If sysdefaults.type = L, a literal default value.
class CHAR(1) Code identifying what kind of column:
  • T = table
  • t = ROW type
  • P = procedure

If no default is specified explicitly in the CREATE TABLE or the ALTER TABLE statement, then no entry exists for that column in the sysdefaults table.

If you specify a literal for the default value, it is stored in the default column as ASCII text. If the literal value is not of one of the data types listed in the next paragraph, the default column consists of two parts. The first part is the 6-bit representation of the binary value of the default value structure. The second part is the default value in ASCII text. A blank space separates the two parts.

If the data type of the column is not CHAR, NCHAR, NVARCHAR, or VARCHAR, or (for HCL OneDB™) BOOLEAN or LVARCHAR, a binary representation of the default value is encoded in the default column.

A composite index on the tabid, colno, and class columns allows only unique values.