•The following query
can be used to retrieve the columns in a table. Note
that it uses parameter markers
•
•SELECT TRIM(COLUMN_NAME) AS
COLNAME,
•ordinal_position AS
OFF,
•TRIM(data_Type) AS
DATA_TYPE,
•LENGTH AS LEN, numeric_scale
AS SCLE,
•numeric_precision AS PREC,
•TRIM(ifnull(column_heading,'')) AS
COL_HEADING,
•TRIM(ifnull(column_text,'')) AS
COL_TEXT,
•is_nullable AS NULLS,
•has_default AS HD,
•system_column_name AS
SYSCOL
•FROM qsys2.syscolumns
•WHERE table_schema = ? AND
•TABLE_NAME=? ORDER BY OFF