Display names of all constraints for a table in Oracle SQL

前端 未结 6 794
失恋的感觉
失恋的感觉 2020-11-29 16:19

I have defined a name for each of the constraint for the multiple tables that I have created in Oracle SQL.

The problem is that to drop a constraint for the column

6条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-11-29 17:17

    Use either of the two commands below. Everything must be in uppercase. The table name must be wrapped in quotation marks:

    --SEE THE CONSTRAINTS ON A TABLE
    SELECT COLUMN_NAME, CONSTRAINT_NAME FROM USER_CONS_COLUMNS WHERE TABLE_NAME = 'TBL_CUSTOMER';
    
    --OR FOR LESS DETAIL
    SELECT CONSTRAINT_NAME FROM USER_CONSTRAINTS WHERE TABLE_NAME = 'TBL_CUSTOMER';
    

提交回复
热议问题