Home » Developer & Programmer » Designer » Non-relational database model
Non-relational database model [message #205098] Thu, 23 November 2006 05:26 Go to next message
davidleigh
Messages: 1
Registered: November 2006
Location: UK
Junior Member
I have an oracle (now 10.2 - originally 7.34) database where a lot of the joins are implemented by a flag and key method, i.e. the join columns are "Tablename Indicator", "Primary Key value". I would like an explanation of why this method should NOT be used (or am I wrong and this sort of model is a good idea).
Either a message (preferred) or pointer to a good publication would be very welcome.

Thanks.

Re: Non-relational database model [message #329842 is a reply to message #205098] Thu, 26 June 2008 13:04 Go to previous message
hhelgen
Messages: 12
Registered: April 2007
Location: Duluth MN
Junior Member
If I understand you correctly, the system uses the value of data in columns to determine the related table. For a legacy system, business needs may require you to continue with this.

However, for new data models - this technique ignores Oracle's referential integrity constraints. These constraints are static - coded into the definition of a table. The referential integrity is coded as a foreign key. Use Oracle's built-in features as much as possible, because Oracle's constraints automatically prevent adding records without a related parent. Oracle's constraints automatically prevent deleting a parent record if it has related children. It does this natively and consistently within the database. No application coding is needed.
CONSTRAINT FK_TABLE1_TABLE2 FOREIGN KEY(TABLE2COLUMN) 
    REFERENCES MYSCHEMA.TABLE1(TABLE1KEY)) 

Previous Topic: Composite key Problem
Next Topic: error in installation
Goto Forum:
  


Current Time: Sat Nov 23 07:37:07 CST 2024