|
Hi!
FlexFields are used in Oracle E-Business Suite,
they aren't nothing else than varchar2 fields where you can configure Apps to
write your custom data (either one logical field by database column, or several
fields separated by colon).
For your case, if you add 70 varchar2 or number
columns to your table, these columns which have null values will take only 1
byte (for column length which will be 0).
Also, if you have let say 20 last columns as
NULL for particular row, then even this 1 byte for last 20 null columns is
omitted (column count for row is decreased instead). But as soon as you got
some non-null value in your last colum of row, then all columns have to be
stored in row.
You could add a column doctype (which you probably
already have), use few attribute columns and use decode or some application side
construct to translate appropriate columns to appropriate attribute values for
current doctype.
Let say I got doc types: doc mp3 zip
For all types ATTR1 stores document size in bytes,
but ATTR2 is word count for doc, duration in seconds for mp3 and uncompressed
size for zip:
And table contains:
ID | DOCTYPE | ATTR1 | ATTR2
|
1 | doc
| 154332| 8850 |
2 | mp3 |
128000| 16 |
3 | zip
| 32768| 55980 |
And query or application takes doctype into
account:
select attr1 as bytes, decode(lower(doctype),
'doc', 'Word Count:',
'mp3', 'Minutes:',
'zip', 'Uncompressed size:',
'Unspecified') as
custom,
ATTR2
from my_table;
Also, you can combine boolean values to number or
varchar and use bitand function or substr function depending on data
type.
Also, function based indexes come handy
when your want to index these columns... Tanel.
|
Title: Implementing different document types with different attributes
- RE: Implementing different document types with different at... Vernaillen Tim
- Re: Implementing different document types with differe... JApplewhite
- Re: Implementing different document types with differe... Thomas Day
- Implementing different document types with different a... Tanel Poder
- Implementing different document types with different a... Vernaillen Tim
- Re: Implementing different document types with differe... John Thomas
- Re: Implementing different document types with differe... JApplewhite
- RE: Implementing different document types with differe... Vernaillen Tim
- RE: Implementing different document types with differe... Pardee, Roy E
- RE: Implementing different document types with differe... Thomas Day
- RE: Implementing different document types with differe... Thomas Day
