Query table constraint type by querying user_constraints table : user_constraints « System Tables Data Dictionary « Oracle PL/SQL Tutorial






SQL> select   table_name
  2  ,        constraint_name
  3  ,        case constraint_type
  4                when 'P' then 'PRIKEY'
  5                when 'U' then 'UNIQUE'
  6                when 'C' then ' CHECK'
  7                when 'R' then 'FORKEY'
  8                         else ' OTHER'
  9           end  as type
 10  ,        status
 11  from     user_constraints
 12  order by table_name
 13  ,        type;

TABLE_NAME                     CONSTRAINT_NAME                TYPE   STATUS
------------------------------ ------------------------------ ------ --------
AVAIL_TRACE_FILES              AVAIL_TRACE_FILES_PK           PRIKEY ENABLED
BIN$50P9fUVyS3CVhoJ8p86aww==$0 BIN$VMcdepmcR4ug/22rvF+1xw==$0  CHECK ENABLED
BIN$50P9fUVyS3CVhoJ8p86aww==$0 BIN$CiI/tY7QTzCYPzbRan2qug==$0  CHECK ENABLED
BIN$50P9fUVyS3CVhoJ8p86aww==$0 BIN$5CEHm8aoQI+QEJVhy5P0cQ==$0  CHECK ENABLED
BIN$50P9fUVyS3CVhoJ8p86aww==$0 BIN$Sub47Nl/TUy+yxXOAxEVEQ==$0  CHECK ENABLED
BIN$9NVb8X4RQD++Dre0uN5ukA==$0 BIN$uyol6urWTla+zIWnSplRmg==$0  CHECK ENABLED
BIN$9NVb8X4RQD++Dre0uN5ukA==$0 BIN$I9xRa3jJSBSAauBv1trS8g==$0  CHECK ENABLED
BIN$9NVb8X4RQD++Dre0uN5ukA==$0 BIN$wgvs7nkURFWztU+b57HYPQ==$0  CHECK ENABLED
BIN$9NVb8X4RQD++Dre0uN5ukA==$0 BIN$CtIz0hnsSXqaJPY8sw0+pQ==$0  CHECK ENABLED
BIN$9NVb8X4RQD++Dre0uN5ukA==$0 BIN$E2ZL/AWfSmCZCAacajsefw==$0 UNIQUE ENABLED
BIN$A2IWocWXS/mUCrAdQt9RoQ==$0 BIN$fYL/DxaDSy6P6z8F7l8h/w==$0  CHECK ENABLED
BIN$A2IWocWXS/mUCrAdQt9RoQ==$0 BIN$wyDlgiD/SrSprbYY1MWd1w==$0  CHECK ENABLED
BIN$A2IWocWXS/mUCrAdQt9RoQ==$0 BIN$dqIBTtLSTa+MD7AIx3qdPg==$0  CHECK ENABLED
BIN$A2IWocWXS/mUCrAdQt9RoQ==$0 BIN$NKGL/hLdS12D4ts14Ddtww==$0  CHECK ENABLED
BIN$cVJWgW8YSn6s3cAxBuliGQ==$0 BIN$rsD6uhRWQV6vdE3Z9UV2RA==$0  CHECK ENABLED
BIN$cVJWgW8YSn6s3cAxBuliGQ==$0 BIN$aL7CwqNTQHGbCUdghbAD1Q==$0  CHECK ENABLED
BIN$cVJWgW8YSn6s3cAxBuliGQ==$0 BIN$AfKMoPrLTt+44vfSMnIUGQ==$0  CHECK ENABLED
BIN$cVJWgW8YSn6s3cAxBuliGQ==$0 BIN$823WYDmCQ3iD6DihooQkPw==$0  CHECK ENABLED
BIN$cVJWgW8YSn6s3cAxBuliGQ==$0 BIN$hRwWn2gTQrGr8ley9ne59w==$0 PRIKEY ENABLED
BIN$qf21D14XRemOOpMbQAFcmA==$0 BIN$qv1rrdw5QruTMJ4OO+NEsg==$0  CHECK ENABLED
BIN$qf21D14XRemOOpMbQAFcmA==$0 BIN$Y1rnbAPqQhulusWZAN8UlA==$0  CHECK ENABLED
BIN$qf21D14XRemOOpMbQAFcmA==$0 BIN$T94dKQiqS2SwPcQ+SJCMVA==$0  CHECK ENABLED
BIN$qf21D14XRemOOpMbQAFcmA==$0 BIN$Z6p5I0ZiQAS94s0pILt7Uw==$0  CHECK ENABLED
DDL_AUDIT                      SYS_C004381                     CHECK ENABLED
DDL_AUDIT                      SYS_C004378                     CHECK ENABLED
DDL_AUDIT                      SYS_C004379                     CHECK ENABLED
DDL_AUDIT                      SYS_C004380                     CHECK ENABLED
HAZARD_LEVEL_T                 SYS_C004621                     CHECK ENABLED
HAZARD_LEVEL_T                 SYS_C004617                     CHECK ENABLED
HAZARD_LEVEL_T                 SYS_C004620                     CHECK ENABLED
HAZARD_LEVEL_T                 SYS_C004619                     CHECK ENABLED
HAZARD_LEVEL_T                 SYS_C004618                     CHECK ENABLED
HOME_ADDRESS_LIST              SYS_C004533                    PRIKEY ENABLED
HOME_ADDRESS_LIST              SYS_C004534                    UNIQUE ENABLED
I1                             SYS_C005790                    PRIKEY ENABLED
I2                             SYS_C005791                    PRIKEY ENABLED
MAP                            SYS_C005793                    FORKEY ENABLED
MAP                            SYS_C005794                    FORKEY ENABLED
MAP                            SYS_C005792                    PRIKEY ENABLED
P                              SYS_C006768                    PRIKEY ENABLED
PUBLICATION                    PUBLICATION_PK                 PRIKEY ENABLED
SITE_TAB                       SYS_C004442                     CHECK ENABLED
SITE_TAB                       SYS_C004441                     CHECK ENABLED
WORKING_CUSTOMERS              SYS_C006546                     CHECK ENABLED
WORKING_CUSTOMERS              SYS_C006545                     CHECK ENABLED

45 rows selected.

SQL>








30.78.user_constraints
30.78.1.Getting Information on Constraints
30.78.2.Getting Information on View Constraints
30.78.3.Query table constraint type by querying user_constraints table
30.78.4.Query user_constraints with constraint_type = 'R'
30.78.5.Query user_constraints for constraint_type = 'V'