Oracle getting started

Source: Internet
Author: User
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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.