Tim,

As soon as I sent this I saw my mistake.   There's got to be one more
table.  Doc_Types and Doc_Attributes stay, but Documents gets changed and
Document_Attributes gets created.  Actually, if you wanted you could make a
single integer PK column for Doc_Type_Attributes and use that as the FK in
Document_Attributes.

Table Documents
       Doc_ID           Number            PK
      ,Doc_Descr        VarChar2(100)
      ,Doc_Body         BLOB        (store this segment out-of-line
somewhere)
      .... (other Document columns)

Table Document_Attributes
       Doc_ID           Number            PK and FK to Documents
      ,Doc_Type_ID            Number            PK and part of FK to
Doc_Type_Attributes
      ,Doc_Attrib_ID          Number            PK and part of FK to
Doc_Type_Attributes


Jack C. Applewhite
Database Administrator
Austin Independent School District
Austin, Texas
512.414.9715 (wk)
512.935.5929 (pager)
[EMAIL PROTECTED]



                                                                                       
                                      
                      Jack Applewhite                                                  
                                      
                                               To:      [EMAIL PROTECTED]              
                                   
                      08/07/2003 01:16         cc:                                     
                                      
                      PM                       Subject: Re: Implementing different 
document types with different attributes  
                                               (Document link: Jack Applewhite)        
                                      
                                                                                       
                                      



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)
[EMAIL PROTECTED]



                                                                                       
                                      
                      "Vernaillen Tim"                                                 
                                      
                      <[EMAIL PROTECTED]        To:       Multiple recipients of list 
ORACLE-L <[EMAIL PROTECTED]>         
                      gs.be>                   cc:                                     
                                      
                      Sent by:                 Subject:  Implementing different 
document types with different attributes     
                      [EMAIL PROTECTED]                                                
                                      
                      .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: [EMAIL PROTECTED]

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: [EMAIL PROTECTED] (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).

Reply via email to