eg: UK or Brides UK or Classical Art or Buy Music or Spirituality
 
eg: UK or Brides UK or Classical Art or Buy Music or Spirituality
 

Your Online Guide » Computer Software » The Best Software Writing

[S261]Select Column From Table
by ,
alter table disable

constraint j primary key j unique[] [cascade];

To disable a primary key, one must disable all foreign key constraints that depend on this primary key. The clause cascade automatically disables foreign key constraints that depend on the (disabled) primary key.

Example: Disable the primary key of the table DEPT and disable the foreign key constraint in the table EMP:

alter table DEPT disable primary key cascade;

In order to enable an integrity constraint, the clause enable is used instead of disable. A constraint can only be enabled successfully if no tuple in the table violates the constraint. Otherwise an error message is displayed. Note that for enabling/disabling an integrity constraint it is important that you have named the constraints.

In order to identify those tuples that violate an integrity constraint whose activation failed, one can use the clause exceptions into EXCEPTIONS with the alter table statement. EXCEPTIONS is a table that stores information about violating tuples.3 Each tuple in this table is identi~ed by the attribute ROWID. Every tuple in a database has a pseudo-column ROWID that is used to identify tuples. Besides the rowid, the name of the table, the table owner as well as the name of the violated constraint are stored.

Example: Assume we want to add an integrity constraint to our table EMP which requires that each manager must earn more than 4000:

alter table EMP add constraint managersal

check(JOB != 'MANAGER' or SAL >= 4000) exceptions into EXCEPTIONS;

If the table EMP already contains tuples that violate the constraint, the constraint cannot be activated and information about violating tuples is automatically inserted into the table

EXCEPTIONS.
Detailed information about the violating tuples can be obtained by joining the tables EMP and EXCEPTIONS, based on the join attribute ROWID:

select EMP.~, CONSTRAINT from EMP, EXCEPTIONS where EMP.ROWID = EXCEPTIONS.ROWID;

3Before this table can be used, it must be created using the SQL script utlexcept.sql which can be found in the directory $ORACLEHOME/rdbms/admin.
Tuples contained in the query result now can be modi~ed (e.g., by increasing the salary of managers) such that adding the constraint can be performed successfully. Note that it is important to delete old" violations from the relation EXCEPTIONS before it is used again.

If a table is used as a reference of a foreign key, this table can only be dropped using the command drop table cascade constraints;. All other database objects that refer to this table (e.g., triggers, see Section 5.2) remain in the database system, but they are not valid.

Information about integrity constraints, their status (enabled, disabled) etc. is stored in the data dictionary, more precisely, in the tables USERCONSTRAINTS and USERCONSCONSTRAINTS.

has sinced written about articles on various topics from . . 's top article . to your Favourites.
EditorialToday Computer Software has 2 sub sections. Such as Software and All Microsoft Softwares. With over 20,000 authors and writers, we are a well known online resource and editorial services site in United Kingdom, Canada & America . Here, we cover all the major topics from self help guide to A Guide to Business, Guide to Finance, Ideas for Marketing, Legal Guide, Lettre De Motivation, Guide to Insurance, Guide to Health, Guide to Medical, Military Service, Guide to Women, Pet Guide, Politics and Policy , Guide to Technology, The Travel Guide, Information on Cars, Entertainment Guide, Family Guide to, Hobbies and Interests, Quality Home Improvement, Arts & Humanities and many more.
About Editorial Today | Contact Us | Terms of Use | Submit an Article | Our Authors