Join | Login | Why Join?   
SQL Server, Oracle, DB2, Sybase, MySQL Help - SSWUG.ORG HACKER SAFE certified sites prevent over 99.9% of hacker crime.
Search SSWUG:   
 
Access to 690 free guest articles, discussions and more, just create your free SSWUG User ID:
Email address:  
This will be your login ID - we'll email you your password - you'll even receive the newsletter, opt-out at any time.
Email to Friend //  Discuss Article //  Rate Article //  Digg Article //  Add to Del.icio.us //  Add to Technorati

Full site membership is required for this article. Already a full member? Login here.
You currently have a guest membership. You can upgrade to full site membership here (free trial available).

Referential Integrity Constraints on REFs in Nested Tables


 Article Abstract:

(Yuli Vasiliev) According to Oracle Documentation, you cannot specify referential integrity constraints on REFs that are in nested tables. This means that Oracle Database doesn’t have its own mechanism to solve this problem. However, you may try to develop your own method that is to fill in the gap. For example, you could create a BEFORE DELETE trigger on the table whose rows may be referred to from a REF column that is in a nested table. This trigger fires whenever the user tries to delete a row from the table. If the user is trying to delete a row that is referred to, the trigger is supposed to prevent it. At first glance, it sounds good. However, you must understand that in this case you will have to look through all the nested tables that can potentially contain references to the deleted row. If you have thousands rows in your outer table, you probably won’t like this approach. However, you can easily simplify your task if you work with the storage table instead of a large number of nested tables.

 Read this article...

 Related Articles - For Members.
All Articles By Author

Using Check Constraints to Simulate Domains
Tips for using SQL Server 2005 constraints (Part 1)
Utility Lists and Templates in IBM’s DB2 Utilities
SQL Server Constraints Optimization Tips
Domain Objects Persistence Pattern for .NET
Using Microsoft SQL Server Constraints
Understanding Yukon Schema Separation
JavaScript Objects Part 4: Exploring built-in Objects
Generate Script for objects and dependent objects



Key (Please note):
(R) - registration may be required for access at the target site
($) - target site may require paid membership for access to this or other content


No Comments/Feedback Posted Yet. Post Your Comments/Feedback

Email to Friend //  Discuss Article //  Rate Article //  Digg Article //  Add to Del.icio.us //  Add to Technorati

   




 

[ Register ] [ Webcasts ] [ Podcasts ] [ Newsletter Archive ] [ RSS/Feeds ]
[ About ] [ Advertise ] [ Contact ] [ Privacy ] [ Terms of Service ]
[ Link to SSWUG ] [ List Server Archives ] [ Recent Orig. Content ]
(c) 1997-2008, Bits on the Wire, Inc.  (0)

Some names and products covered by SSWUG are the registered trademarks of their respective owners.
DAA10354WWW004