>>By allowing multiple values in a single field, you are violating the
first normal form of relational
database normalization
Yeah, this is theory, what you learn in school, but in practice, life is
just a bit cooler ;-)
The most fundamental rule in database is "Don't use a database when you
don't need."
And it is not just because you have a list of options in a string that
you have
a so called "relation". In database theory, a relation exists between
two dynamic tables,
not when one of the tables is not even a table because options are fixed.
>>and, in so doing, you are not taking advantage of your DBMS's
inherent power.
The "advantage of your DBMS's inherent power" as you say can be very costly
if you use it when you don't need.
>>Why "jump through hoops" with LIKE (so slow)
In the example I gave, there is no LIKE, not even any access to the
database:
The list of option codes are read once at login time from one user field,
stored in a session variable, then later, if I want to know if the user
is allowed
to a certain task, I just check for the presence of the option code in
the session variable.
There is no access to the database anymore, it cannot be more efficient.
All my admin modules start with the same line, for example, in the
DOcuments edit template:
<CFMODULE TEMPLATE="/common/customTags/checkArea.cfm" AREA="DO">
This means "is the current user allowed to work on DOcuments?"
In checkArea, the code is like:
<CFIF listFind(session.areas, attributes.area) EQ 0>
<H2>Sorry, but you're not allowed in this section.</H2>
<CFABORT>
....
Of course, this is just in case someone thinks smart to try to get
directly to a template,
normally, he will not even see the options he is not allowed in the main
menu.
--
_______________________________________
REUSE CODE! Use custom tags;
See http://www.contentbox.com/claude/customtags/tagstore.cfm
(Please send any spam to this address: [EMAIL PROTECTED])
Thanks.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting,
up-to-date ColdFusion information by your peers, delivered to your door four
times a year.
http://www.fusionauthority.com/quarterly
Archive: http://www.houseoffusion.com/groups/SQL/message.cfm/messageid:2559
Subscription: http://www.houseoffusion.com/groups/SQL/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.6