logo       

Re: Should I Use A Structure?: msg#00059

cms.cold-fusion.user.azcfug

Subject: Re: Should I Use A Structure?

I discovered a simple solution to my problem: I added to my UserQuery a
left join on the States table against the UserStateCode, then I could
just call #StateAbbrev# like all the other user info.

However, I would still like to hear any suggestions/solutions you all
might have, and especially on using structures. I've never used them
before, and wonder when you would want to use them; where you guys like
to use them and why.

Thx again!

---Judd

--- "Judd M. Miller" <juddmiller@xxxxxxxxxxxxx> wrote:
> 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/
>


__________________________________________________
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