Quick Search:
CODE
Oracle PL/SQL Code Library
JOBS
Find Or Post Oracle Jobs
FORUM
Oracle Discussion & Chat
 Oracle PL/SQL: Constraint Checks Jump to:  
Category: >> Oracle PL/SQL >> Constraint Checks Bookmark and Share

<< lastnext >>

Snippet Name: Constraint Checks

Description: A check constraint allows you to specify a condition on each row in a table.

A check constraint can NOT be defined on a VIEW.

The check constraint defined on a table must refer to only columns in that table. It can not refer to columns in other tables.

A check constraint can NOT include a SUBQUERY.

A check constraint can be defined in either a CREATE TABLE statement or an ALTER TABLE statement.

Also see:
» Check Constraint - Create
» Unique Constraint
» Primary Key Constraint
» Foreign Key Constraints
» Current_timestamp
» Deferring Constraint Checking
» Add Primary Key Constraint example
» Add constraint example

Comment: (none)

Language: PL/SQL
Highlight Mode: PLSQL
Last Modified: March 07th, 2009

clear columns;
clear breaks;
SET linesize 132;
col constraint_name format a20;
col r_constraint_name format a20;
break ON table_name;
 
SELECT cc.table_name, c.constraint_name,
       c.r_constraint_name, cc.column_name
FROM  user_cons_columns cc, user_constraints c
WHERE c.constraint_name = cc.constraint_name AND
      c.constraint_type IN ('P','R')
ORDER BY c.table_name, c.r_constraint_name, cc.position; 
 


Free
Oracle Magazine
Subscriptions
and Oracle White Papers


SQL University.net courses meet the most demanding needs of the business world for advanced education in a cost-effective manner. SQL University.net courses are available immediately for IT professionals and can be taken without disruption of your workplace schedule or processes.

Compared to traditional travel-based training, SQL University.net saves time and valuable corporate resources, allowing companies to do more with less. That's our mission, and that's what we deliver.

Click here to find out more
 
Home      :      Code Library      :      Sponsors      :      Privacy      :      Terms of Use      :      Contact Us 139 users online    © 2009 psoug.org

PSOUG LOGIN
Username: 
Password: 
Forgot your password?