Welcome to the Oracle community forum and interact with 2 million technical staff. The following two statements are based on the system table sysobjects, syscomments, and System View sysconstraints, the query results include the table ID, table name, column ID, column name, CHECK constraint ID, CHECK constraint name, CHECK constraint status value, and CHECK constraint content. TCCView is
Welcome to the Oracle community forum to interact with 2 million technical staff> go to the following two statements based on the system table sysobjects, syscomments, and System View sysconstraints, the query results include the table ID, table name, column ID, column name, CHECK constraint ID, CHECK constraint name, CHECK constraint status value, and CHECK constraint content. TCCView is
Welcome to the Oracle community forum and interact with 2 million technical staff> enter
The following two statements are based on the system table sysobjects, syscomments, and System View sysconstraints, the query results include the table ID, table name, column ID, column name, CHECK constraint ID, CHECK constraint name, CHECK constraint status value, and CHECK constraint content, TCCView is Table-Column-Check View, the results are Column-Level CHECK constraints, TCView is Table-Check View, and the results are all Table-Level CHECK constraints.
1. select top 100 PERCENT a. id AS tableid, a. tablename, a. colid, a. columnname,
A. datatype, a. length, B. constid AS checkid, B. checkname, B. status, B. content
FROM (SELECT sysobjects. name AS tablename, sysobjects. id,
Syscolumns. name AS columnname, syscolumns. colid,
Policypes. name AS datatype, syscolumns. length AS length
FROM sysobjects, syscolumns, policypes
WHERE sysobjects. xtype = 'U' AND sysobjects. id = syscolumns. id AND
Syscolumns. xtype = policypes. xtype AND
Policypes. xtype = policypes. xusertype AND sysobjects. status> 0)
A LEFT OUTER JOIN
(SELECT sysobjects. name checkname, sysobjects. status, sysconstraints. constid,
Sysconstraints. id, sysconstraints. colid, syscomments. text AS content
FROM sysobjects, sysconstraints, syscomments
WHERE xtype = 'C' AND sysobjects. id = sysconstraints. constid AND
Sysconstraints. constid = syscomments. id) B ON a. id = B. id AND
A. colid = B. colid
Order by a. tablename, a. columnname, B. checkname
2. SELECT a. id AS tableid, a. tablename, B. constid AS checkid, B. checkname, B. status,
B. content
FROM (SELECT sysobjects. id, sysobjects. name AS tablename
FROM sysobjects
WHERE sysobjects. xtype = 'U' AND sysobjects. status> 0) a LEFT OUTER JOIN
(SELECT sysobjects. name checkname, sysobjects. status, sysconstraints. constid,
Sysconstraints. id, sysconstraints. colid, syscomments. text AS content
FROM sysobjects, sysconstraints, syscomments
WHERE xtype = 'C' AND sysobjects. id = sysconstraints. constid AND
Sysconstraints. constid = syscomments. id AND sysconstraints. colid = 0) B ON
A. id = B. id