SQL - SYSIBM.SYSCOLUMNS - www.cadcobol.com.br


Volta ao Menu das SYSIBM

Volta ao Menu Principal


Desenvolvido por DORNELLES, Carlos Alberto - Analista de Sistemas - Brasília DF. - cad_cobol@hotmail.com

SYSIBM.SYSCOLUMNS
Contains one row for every column of each table and view.

Nome da coluna Tipo do dado Descrição Uso
 NAME  VARCHAR(18) NOT NULL  Name of the column  G
 TBNAME  VARCHAR(18) NOT NULL  Name of the table or view which contains the column  G
 TBCREATOR  CHAR(8) NOT NULL  Authorization ID of the owner of the table or view that contains the column  G
 COLNO  SMALLINT NOT NULL  Numeric place of the column in the table or view; for example 4 (out of 10). 0 in an  additional row if the definition of the table is incomplete (all required unique indexes  have not been created)  G
 COLTYPE  CHAR(8) NOT NULL  The type of the column specified in the definition of the column:

 INTEGER       Large integer
 SMALLINT    Small integer
 FLOAT          Floating-point
 CHAR            Fixed-length character string
 VARCHAR     Varying-length character string
 LONGVAR     Varying-length character string
 DECIMAL      Decimal
 GRAPHIC      Fixed-length graphic string
 VARG            Varying-length graphic string
 LONGVARG   Varying-length graphic string
 DATE             Date
 TIME             Time
 TIMESTMP    Timestamp

 Whether a column described as VARCHAR, LONGVAR, VARG, or LONGVARG is a long  string column or not depends on its length attribute
 G
 LENGTH  SMALLINT NOT NULL  The length attribute of the column or, in the case of a decimal column, its precision.  The number does not include the internal prefixes used to record actual length and  null state, where applicable.

 INTEGER       4
 SMALLINT    2
 FLOAT          4 ou 8
 CHAR            Length of string
 VARCHAR     Maximum length of string
 LONGVAR     Maximum length of string
 DECIMAL      Precision of number
 GRAPHIC      Number of DBCS characters
 VARG            Maximum number of DBCS characters
 LONGVARG   Maximum number of DBCS characters
 DATE             4
 TIME             3
 TIMESTMP    10

 G
 SCALE  SMALLINT NOT NULL  Scale of decimal data. Zero if not a decimal column  G
 NULLS  CHAR(1) NOT NULL  Whether the column can contain null values:

 N  No
 Y  Yes

 The value can be N for a view column that is derived from an expression or a function.  Nevertheless, such a column allows nulls when it is referenced in an outer select list.
 G
   INTEGER NOT NULL  Not used  N
 HIGH2KEY  CHAR(8) NOT NULL
 FOR BIT DATA
 Second highest value of the column. Blank if statistics have not been gathered. If the  column has a non-character data type, the data might not be printable. This is an  updatable column.  S
 LOW2KEY  CHAR(8) NOT NULL
 FOR BIT DATA
 Second lowest value of the column. Blank if statistics have not been gathered. If the  column has a non-character data type, the data might not be printable. This is an  updatable column.  S
 UPDATES  CHAR(1) NOT NULL  Whether the column can be updated:

 N  No
 Y  Yes

 The value is N if the column is:

 ° Part of the key of a partitioned index
 ° Derived from a function or expression.

 The value can be Y for columns of a read-only view.
 G
 IBMREQD  CHAR(1) NOT NULL  Whether the row came from the basic machine-readable material (MRM) tape:

 N  No
 Y  Yes
 G
 REMARKS  VARCHAR(254) NOT NULL  A character string provided by the user with the COMMENT ON statement.  G
 DEFAULT  CHAR(1) NOT NULL  Default indicator:

 N   The column has no default value.

 Y   If the NULLS column is Y, the column has a default value of null.

      If the NULLS column is N, the default value depends on the data type of the column.

      Data Type                            Default Value
      Numeric                               0
      Fixed-length string              Blanks
      Varying-length string           A string length of 0
      Date                                     The current date
      Time                                    The current time
      Timestamp                          The current timestamp

 B   The default value depends on the data type of the column.

      Data Type                            Default Value
      Numeric                               0
      Fixed-length string              Blanks
      Varying-length string           A string length of 0
      Date                                     The current date
      Time                                    The current time
      Timestamp                          The current timestamp

 1   The column has a default value that is the string constant found in the       DEFAULTVALUE column of this table row.

 2   The column has a default value that is the floating-point constant found in the       DEFAULTVALUE column of this table row.

 3   The column has a default value that is the decimal constant found in the       DEFAULTVALUE column of this table row.

 4   The column has a default value that is the integer constant found in the       DEFAULTVALUE column of this table row.

 5   The column has a default value that is the hex string found in the DEFAULTVALUE       column of this table row.

 S   The column has a default value that is the value of the SQLID of the process at the       time a default value is used.

 U   The column has a default value that is the value of the USER special register at       the time a default value is used.
 G
 KEYSEQ  SMALLINT NOT NULL  The column's numeric position within the table's primary key. 0 if it is not part of a  primary key.  G
 FOREIGNKEY  CHAR(1) NOT NULL  Applies to character columns only, where it indicates the subtype of the data. A value  of B indicates BIT data, and if value of the field MIXED DATA on installation panel  DSNTIPF is:

 ° NO, any other value indicates SBCS data
 ° YES, an S indicates SBCS and any other value indicates MIXED

 This is an updatable column.
 G
 FLDPROC  CHAR(1) NOT NULL  Whether the column has a field procedure:

 N  No
 Y  Yes

 This column is blank for views.
 G
 LABEL  VARCHAR(30) NOT NULL  The column label provided by the user with a LABEL ON statement; otherwise it is an  empty string.  G
 STATSTIME  TIMESTAMP NOT NULL
 WITH DEFAULT
 If RUNSTATS updated the statistics, the date and time when the last invocation of  RUNSTATS updated the statistics. The default value is '0001-01-01.00.00.00.000000'. If  the value is '0001-01-02.00.00.00.000000', RUNSTATS should be run to update the  statistics before they are used. This is an updatable column.  G
 DEFAULTVALUE  VARCHAR(512) NOT NULL
 WITH DEFAULT
 This field is meaningful only if the column being described is for a table (the TYPE  column of the associated SYSTABLES row is T for table or G for global temporary  table).

 When the DEFAULT column is 1, 2, 3, 4, or 5, this field contains the default value of the  column.

 If the default value is a string constant or a hexadecimal constant (DEFAULT is 1 or 5,  respectively), the value is stored without delimiters, except for a graphic string  constant which will be enclosed by the shift-out and shift-in characters.

 If the default value is a numeric constant (DEFAULT is 2, 3, or 4), the value is stored as  specified by the user, including sign and decimal point representation, as appropriate  for the constant. When the default column is S or U and the default value was specified  with the definition of a new column on an ALTER TABLE statement, this field contains  the value of the CURRENT SQLID or USER special register at the time of the ALTER  statement.
 G
 COLCARDF  FLOAT NOT NULL
 WITH DEFAULT -1
 Estimated number of distinct values in the column. The value is -1 if statistics have not  been gathered. This is an updatable column.  S


© Copyright IBM Corp.