Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> RE: Implementing different document types with different attribut

RE: Implementing different document types with different attribut

From: STEVE OLLIG <sollig_at_lifetouch.com>
Date: Thu, 07 Aug 2003 12:09:30 -0800
Message-ID: <F001.005C9825.20030807120930@fatcity.com>


i like it Jack. just 1 more suggestion - from reading a little more into the thread. i think he may also want another table to hold values for the attributes that go with each doc type. this might do it:

Table Doc_Types

       Doc_Type_ID            Number            PK

,Doc_Type_Descr VarChar2(100)
Table Doc_Attributes Doc_Attrib_ID Number PK
,Doc_Attrib_Descr VarChar2(100)
Table Doc_Type_Attributes ("Intersect" table of the above two) Doc_Type_ID Number PK and FK to Doc_Types
,Doc_Attrib_ID Numter PK and FK to Doc_Attributes
Table Documents Doc_ID Number PK
,Doc_Type_ID Number FK to Doc_Types
,Doc_Descr VarChar2(100)
,Doc_Body BLOB (store this segment out-of-line
somewhere)

Table Doc_Attrib_Values

       Doc_ID           Number   PK and FK to Documents

,Doc_Attrib_ID Number PK and FK to Doc_Attributes
,Doc_Attrib_Value VarChar2(100) (or whatever type sufficiently stores
all possible values for all attributes)

you might also want a constraint on Doc_Attrib_Values to be sure that only attributes with rows in the Doc_Type_Attributes table may be inserted.

TMTOWTDI -----Original Message-----
[mailto:JApplewhite_at_austin.isd.tenet.edu] Sent: Thursday, August 07, 2003 2:15 PM
To: Multiple recipients of list ORACLE-L attributes

Tim,

How about this?

Table Doc_Types

       Doc_Type_ID            Number            PK

,Doc_Type_Descr VarChar2(100)
Table Doc_Attributes Doc_Attrib_ID Number PK
,Doc_Attrib_Descr VarChar2(100)
Table Doc_Type_Attributes ("Intersect" table of the above two) Doc_Type_ID Number PK and FK to Doc_Types
,Doc_Attrib_ID Numter PK and FK to Doc_Attributes
Table Documents Doc_ID Number PK
,Doc_Type_ID Number part of FK to
Doc_Type_Attributes
,Doc_Attrib_ID Number part of FK to
Doc_Type_Attributes
,Doc_Descr VarChar2(100)
,Doc_Body BLOB (store this segment out-of-line
somewhere)

This way you can have as many Doc Types and Attributes as you want and never have to modify table designs if you add or remove some. Also, no blank columns.

Jack C. Applewhite
Database Administrator
Austin Independent School District
Austin, Texas
512.414.9715 (wk)
512.935.5929 (pager)
JApplewhite_at_austin.isd.tenet.edu  

                      "Vernaillen Tim"

                      <tim.vernaillen_at_x        To:       Multiple recipients
of list ORACLE-L <ORACLE-L_at_fatcity.com>         
                      gs.be>                   cc:

                      Sent by:                 Subject:  Implementing
different document types with different attributes     
                      ml-errors_at_fatcity

                      .com

 

 

                      08/07/2003 08:34

                      AM

                      Please respond to

                      ORACLE-L

 

 





Hello

I've an installation/implementation question! We've to analyse 50 document types, in total those 50 has 70 different attributes.
We don't want to put all those document types into one table, because more than the half (35) of the attributes are not always used for each document type. This will have to much disk space for each record, if most of the fields are just blank.

Has anyone suggestions how to build our table-structure? I've heart something about FlexFields, what are they? Takes every field diskspace, even if it's blank (null)?

Thanks in advance for the response!

Tim

-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.net
-- 
Author: 
  INET: JApplewhite_at_austin.isd.tenet.edu

Fat City Network Services    -- 858-538-5051 http://www.fatcity.com
San Diego, California        -- Mailing list and web hosting services
---------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).
-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.net
-- 
Author: STEVE OLLIG
  INET: sollig_at_lifetouch.com

Fat City Network Services    -- 858-538-5051 http://www.fatcity.com
San Diego, California        -- Mailing list and web hosting services
---------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).
Received on Thu Aug 07 2003 - 15:09:30 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US