syscharsets  syscomments

Chapter 1: System Tables

syscolumns

All databases

Description

syscolumns contains one row for every column in every table and view, and a row for each parameter in a procedure.

Contains one row for each computed column and function-based index key associated with a table.

Columns

The columns for syscolumns are:

Name

Datatype

Description

id

int

ID of table to which this column belongs, or of procedure with which this parameter is associated.

number

smallint

Sub-procedure number when the procedure is grouped (0 for nonprocedure entries).

colid

smallint

Column ID.

status

tinyint

  • Bits 0–2 (values 1, 2, and 4) – indicate bit positioning if the column uses the bit datatype. If the column uses the text/image datatype, bits 0 and 1 indicate replication status as follows:

    • 01 = always replicate

    • 10 = replicate only if changed

    • 00 = never replicate

  • Bit 3 (value 8) – indicates whether NULL values are legal in this column.

  • Bit 4 (value 16) – indicates whether more than one check constraint exists for the column.

  • Bits 5 and 6 – are used internally.

  • Bit 7 (value 128) – indicates an identity column.

type

tinyint

Physical storage type; copied from systypes.

length

int

Physical length of data; copied from systypes or supplied by user.

offset

smallint

Offset into the row where this column appears; if negative, this is a variable-length column.

usertype

smallint

User type ID; copied from systypes.

cdefault

int

ID of the procedure that generates default value for this column.

domain

int

Constraint ID of the first rule or check constraint for this column.

name

varchar(255) not null

Column name

printfmt

varchar(255) null

Reserved

prec

tinyint null

Number of significant digits, if the column uses the numeric datatype.

scale

tinyint null

Number of digits to the right of the decimal point, if the column uses the numeric datatype.

remote_type

int null

Maps local names to remote names. Required by the access methods of Component Integration Services to allow the software to pass native column datatype information in parameters to servers of class access_server.

remote_name

varchar(255) null

Maps local names to remote names. Required by the access methods of Component Integration Services to construct a query using the proper column names for a remote table.

xstatus

int null

The status of a column with extended datatypes. The values are:

  • 0 = in row

  • 1 = off row

xstatus is NULL for columns that do not have an extended datatype.

xtype

int null

ID of the class.

Used if a column in a table or a parameter in a procedure has a Java class as its datatype. When used, fields are not NULL, and the value of type is 0x39. See Java in Adaptive Server Enterprise for more information.

xdbid

int null

The database ID of the class. For system classes, the value is -1. Otherwise, the value is the current database ID.

Used if a column in a table or a parameter in a procedure has a Java class as its datatype. Fields are not NULL, and the value of type is 0x39. See Java in Adaptive Server Enterprise for more information.

accessrule

int null

The object ID of the access rule in sysprocedures. See “Row-level access control“ in Chapter 11, “Managing User Permissions” of the System Administration Guide for more information.

status2

int null

Indicates parameter mode of a SQLJ stored procedure, and the return type of a SQLJ function.

Three internal bits support computed columns:

  • 0x00000010, value16 – the column is a computed column.

  • 0x00000020, value 32 – The column is a materialized computed column.

  • 0x00000040, value 64 – The column is a computed column in a view.

status3

int

0x0001, value 1 – Indicates a hidden computed column for a function-based index key.

computedcol

int

Stores the object ID of the computed column definition.

encrtype

int null

Reserved for future use.

encrlen

int null

Reserved for future use.

encrykeyid

int null

Reserved for future use.

encrykeydb

varchar(30) null

Reserve for future used.

encrdate

datetime null

Reserved for future use.

Indexes





Copyright © 2005. Sybase Inc. All rights reserved. syscomments

View this book as PDF