Friday, June 22, 2007

Script to report constraints in for a table

REM: Script to report constraints in for a table
REM:
REM: Author: Vigyan Kaushik
REM: Date Submitted: 22-Sep-2005
REM: Date Posted: 22-Sep-2005
REM:
REM:*****************************************
REM: NOTE: PLEASE TEST THIS SCRIPT BEFORE USE.
REM: Author will not be responsible for any damage that may be cause by this script.
REM:*****************************************

COL column_name format a30
SET linesize 999

SELECT c1.constraint_name, c2.column_name, c1.constraint_type, c1.delete_rule
FROM user_constraints c1, user_cons_columns c2
WHERE c1.table_name = UPPER ('&Table_Name')
AND c1.constraint_name = c2.constraint_name;

No comments: