Mark Fuqua wrote:
> I know I could do a another table with JobFileId's and Access levels, instead 
> of a
> list of access levels, but it seems cleaner this way.  
>   
It is not.  You have denormalized your data in such away that doing the 
type of select you want to do is very difficult.  If you had a 
normalized database scheme with this data in a related table it would be 
a trivial join and where clause to get the exact records you want.
> On JobFileList.cfm, I want to filter on jobId and the current users access 
> level which is stored in #session.PlumUserRoles#
>  
> Any idea how I might do that?
If you insist on using this database design you are going to have to use 
the LIKE operator in the where clause with a bunch of possibilities.  
Lets say you want to look for an AccessLevel of '3'.  You are going to 
have to write a where clause something like.

WHERE accessLevel LIKE '%,3,$' OR accessLevel LIKE '%,3' OR accessLevel 
LIKE '3,%' ect.

And this does not even address the problems of making sure you do not 
match threes in the possible values of '13', '32', '33' ect.

Contrast this with this.

SELECT stuff
FROM aTable JOIN bTable ON aTable.key = bTable.fKey
WHERE bTable.JobFileAccessLevel = 3

Personally I find the latter much cleaner.






~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;160198600;22374440;w

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:296284
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to