logo       

Should I Use A Structure?: msg#00058

cms.cold-fusion.user.azcfug

Subject: Should I Use A Structure?

Hi gang.

I have a Users table, and one of the fields is UserStateCode, a numeric
foreign key off the States table.

I have an application level query that maintains the States data
resident, so theoretically I can always call
Application.StateQuery.StateName or StateAbbrev if I know the
StateCode.

Here's my problem:

When I run a user query, I get the user's name, address, city,
StateCode, etc. I need to correlate that numeric StateCode against my
application.StateQuery so that when I output the User's record, "16" is
replaced with "Indiana" in the output.

How do I do this?

Right now, I'm running the following:

<cfoutput query="GetUserInfo">
State: #Application.StateCodes.StateName[UserStateCode]#
</cfoutput>

The only big problem with this is that I'm pulling the index, NOT the
key, right? In other words, I'm pulling the StateAbbrev for the 16th
record in the list, NOT necessarily for StateCode=16. I don't think
this is reliable; what if my States data changes?

Do I need a structure so I can run a key/value pair? Or am I making
this just ridiculously complicated? :-)

Thanks for any help...

---Judd




__________________________________________________
Do You Yahoo!?
Get Yahoo! Mail ? Free email you can access from anywhere!
http://mail.yahoo.com/





<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise