SYSCOLUMN

Snippet Sql 2

Come ottenere lista colonne primary_key e constraint di una tabella ELECT A.TABLE_SCHEMA “SCHEMA”, A.TABLE_NAME, A.CONSTRAINT_TYPE “TYPE”, C.ORDINAL_POSITION “POS”, A.CONSTRAINT_NAME, C.COLUMN_NAME FROM QSYS2.SYSCST A LEFT OUTER JOIN QSYS2.SYSREFCST B ON A.CONSTRAINT_SCHEMA = B.CONSTRAINT_SCHEMA AND A.CONSTRAINT_NAME = B.CONSTRAINT_NAME LEFT OUTER JOIN QSYS2.SYSKEYCST…