Show information about columns in *FILE or SQL View (QSYS2.SYSCOLUMNS)

By kimot, 24 December, 2022

The SYSCOLUMNS view contains one row for every column of each table and view in the SQL schema (including the columns of the SQL catalog).

SELECT system_column_name, column_name, system_table_name, system_table_schema, data_type, length, numeric_scale, column_heading
FROM QSYS2.SYSCOLUMNS
WHERE table_name = 'USER_INFO' AND table_schema='QSYS2'
SYSTEM_COLUMN_NAME COLUMN_NAME         SYSTEM_TABLE_NAME SYSTEM_TABLE_SCHEMA DATA_TYPE LENGTH NUMERIC_SCALE COLUMN_HEADING
USER_NAME          AUTHORIZATION_NAME  USER_INFO         QSYS2               VARCHAR   10                   Authorization Name
PRVSIGNON          PREVIOUS_SIGNON     USER_INFO         QSYS2               TIMESTMP  10                   Previous Signon
SIGNONINV          SIGN_ON_ATTEMPT...  USER_INFO         QSYS2               INTEGER    4     0             Sign On Attempts NotValid
STATUS             STATUS              USER_INFO         QSYS2               VARCHAR   10                   Status
PWDCHGDAT          PASSWORD_CHANGE...  USER_INFO         QSYS2               TIMESTMP  10                   Password Change Date
NOPWD              NO_PASSWORD_IND...  USER_INFO         QSYS2               VARCHAR    3                   No Password Indicator
PWD_0_1            PASSWORD_LEVEL_0_1  USER_INFO         QSYS2               VARCHAR    3                   Password Level 0 1
PWD_2_3            PASSWORD_LEVEL_2_3  USER_INFO         QSYS2               VARCHAR    3                   Password Level 2 3
PWDEXPITV          PASSWORD_EXPIRA...  USER_INFO         QSYS2               SMALLINT
...
..
.