RE: Cfloop List Multiple Charecter Delimiters
Hey guys thank you all for your help. I think the answer to my original question is no ColdFusion doesn't support multiple character delimiters however there are a few options for replacements. Charlie, I actually have been using conditional statements like your example for instances where I need to use multiple character delimiters, I just wasn't sure if there was a better way of doing this. Thanks though! Paul -Original Message- From: Leigh [mailto:cfsearch...@yahoo.com] Sent: Thursday, February 11, 2010 10:55 PM To: cf-talk Subject: Re: Cfloop List Multiple Charecter Delimiters My answer was just... keep it simple :) Always good advice :) ~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:330641 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: Cfloop List Multiple Charecter Delimiters
Why not make a duplicate of the list, use RegExp to replace oat with a single delimiter such as a pipe | and then loop though the list. That way you only have to do the loop once. On Fri, Feb 12, 2010 at 9:12 AM, Paul Alkema paulalkemadesi...@gmail.comwrote: Hey guys thank you all for your help. I think the answer to my original question is no ColdFusion doesn't support multiple character delimiters however there are a few options for replacements. Charlie, I actually have been using conditional statements like your example for instances where I need to use multiple character delimiters, I just wasn't sure if there was a better way of doing this. Thanks though! Paul -Original Message- From: Leigh [mailto:cfsearch...@yahoo.com] Sent: Thursday, February 11, 2010 10:55 PM To: cf-talk Subject: Re: Cfloop List Multiple Charecter Delimiters My answer was just... keep it simple :) Always good advice :) ~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:330643 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Cfloop List Multiple Charecter Delimiters
Do this: cfloop index=i array=#variables.exampleList.split('oat')# ... /cfloop ~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:330646 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Cfloop List Multiple Charecter Delimiters
Hi Paul, Just fyi, CF9 added a 4th parameter (boolean multiCharacterDelimiter) to the listToArray function: cfloop array=#listToArray(variables.myList, 'oat', false, true)# index=i You have a few options! HTH, -Aaron I have a list that I'm trying to loop, I was wondering if it was possible to have multiple character delimiter. ~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:330665 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: Cfloop List Multiple Charecter Delimiters
Hey Aaron, Thanks for the information. Very helpful. :) Paul -Original Message- From: Aaron Neff [mailto:w...@itisdesign.com] Sent: Friday, February 12, 2010 1:05 PM To: cf-talk Subject: Re: Cfloop List Multiple Charecter Delimiters Hi Paul, Just fyi, CF9 added a 4th parameter (boolean multiCharacterDelimiter) to the listToArray function: cfloop array=#listToArray(variables.myList, 'oat', false, true)# index=i You have a few options! HTH, -Aaron I have a list that I'm trying to loop, I was wondering if it was possible to have multiple character delimiter. ~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:330669 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: Cfloop List Multiple Charecter Delimiters
Treating 'OAT' as a deimiter isn't going to get you what you want. The delimiter is not considered part of the list element itself. So if you have GOAT,BOAT,MOAT,BOOBS, and you want to delimit on the string 'OAT', if you're successful then you'd end up with: G,B,M,BOOBS ... because the delimiter that you specified (OAT) is now defined as just that... a delimiter that's not going to be returned with the list element. I suppose you could output the loop index and concatenate an OAT onto it. But that's assuming the business rule that you're looking to satisfy is that the word *ends* with OAT. Originally you said contains. So what if it's Goats, plural? So... you've got working code that currently loops over the list, and does a conditional check for each iteration. You're looking for a better way. Better is subjective. Unless you're encountering performance issues that you can attribute to your loop and the subsequent conditional... what would be better? Doing it in one line? Is that better? If another developer has to work on this code, would he or she easily understand what the code does? For me, part of better is legible code. You described a need. I need to loop over this list, and if the list element contains OAT, show it. The loop/conditional code is almost a literal translation of that need. Anyone should be able to easily maintain that code. You can get into some ninja regular expression mindset and probably do what you're looking to do. But in the end... what does it buy you? Is the code more performant? Is it easier to read? Just my $0.02 :) On Fri, Feb 12, 2010 at 11:54 AM, Paul Alkema paulalkemadesi...@gmail.comwrote: Hey Aaron, Thanks for the information. Very helpful. :) Paul -Original Message- From: Aaron Neff [mailto:w...@itisdesign.com] Sent: Friday, February 12, 2010 1:05 PM To: cf-talk Subject: Re: Cfloop List Multiple Charecter Delimiters Hi Paul, Just fyi, CF9 added a 4th parameter (boolean multiCharacterDelimiter) to the listToArray function: cfloop array=#listToArray(variables.myList, 'oat', false, true)# index=i You have a few options! HTH, -Aaron I have a list that I'm trying to loop, I was wondering if it was possible to have multiple character delimiter. ~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:330671 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: Cfloop List Multiple Charecter Delimiters
I don't know if it would work and I'm shooting in the dark, but if you made oat into a variable, would that work? On Thu, Feb 11, 2010 at 1:57 PM, Paul Alkema paulalkemadesi...@gmail.com wrote: Hey all, I have a list that I'm trying to loop, I was wondering if it was possible to have multiple character delimiter. For example.. !--- create list --- cfset variables.exampleList = Boat,Goat,Moat,CherryPie !--- output only the words that contain oat --- cfloop list=#variables.exampleList# index=i delimiters=oat #i# /cfloop I would like something like the above to work, but instead it outputs all that contain a B,O,A or a T. Any ideas? :) Thanks, Paul ~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:330627 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: Cfloop List Multiple Charecter Delimiters
Good idea, but unfortunately it didn't work. Thanks though. :) -Original Message- From: Phillip Vector [mailto:vec...@mostdeadlygame.com] Sent: Thursday, February 11, 2010 5:00 PM To: cf-talk Subject: Re: Cfloop List Multiple Charecter Delimiters I don't know if it would work and I'm shooting in the dark, but if you made oat into a variable, would that work? On Thu, Feb 11, 2010 at 1:57 PM, Paul Alkema paulalkemadesi...@gmail.com wrote: Hey all, I have a list that I'm trying to loop, I was wondering if it was possible to have multiple character delimiter. For example.. !--- create list --- cfset variables.exampleList = Boat,Goat,Moat,CherryPie !--- output only the words that contain oat --- cfloop list=#variables.exampleList# index=i delimiters=oat #i# /cfloop I would like something like the above to work, but instead it outputs all that contain a B,O,A or a T. Any ideas? :) Thanks, Paul ~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:330629 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Cfloop List Multiple Charecter Delimiters
Ok.. then try this... !--- create list --- cfset variables.exampleList = Boat,Goat,Moat,CherryPie cfset changedlist=ReplaceNoCase(#variables.exampleList#,oat,%) !--- output only the words that contain oat --- cfloop list=#ChangedList# index=i delimiters=% cfset NewI=ReplaceNoCase(#changedlist#,%,oat) #NewI# /cfloop It's a bit of a kludge, but it should work if I understand the problem correctly. On Thu, Feb 11, 2010 at 2:06 PM, Paul Alkema paulalkemadesi...@gmail.com wrote: Good idea, but unfortunately it didn't work. Thanks though. :) -Original Message- From: Phillip Vector [mailto:vec...@mostdeadlygame.com] Sent: Thursday, February 11, 2010 5:00 PM To: cf-talk Subject: Re: Cfloop List Multiple Charecter Delimiters I don't know if it would work and I'm shooting in the dark, but if you made oat into a variable, would that work? On Thu, Feb 11, 2010 at 1:57 PM, Paul Alkema paulalkemadesi...@gmail.com wrote: Hey all, I have a list that I'm trying to loop, I was wondering if it was possible to have multiple character delimiter. For example.. !--- create list --- cfset variables.exampleList = Boat,Goat,Moat,CherryPie !--- output only the words that contain oat --- cfloop list=#variables.exampleList# index=i delimiters=oat #i# /cfloop I would like something like the above to work, but instead it outputs all that contain a B,O,A or a T. Any ideas? :) Thanks, Paul ~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:330630 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: Cfloop List Multiple Charecter Delimiters
Sorry... cfset variables.exampleList = Boat,Goat,Moat,CherryPie cfset changedlist=ReplaceNoCase(#variables.exampleList#,oat,%) !--- output only the words that contain oat --- cfloop list=#ChangedList# index=i delimiters=% cfset NewI=ReplaceNoCase(#i#,%,oat) #NewI# /cfloop Again, this isn't tested and off the cuff.. But I think you get what I'm trying to do here. :) On Thu, Feb 11, 2010 at 2:12 PM, Phillip Vector vec...@mostdeadlygame.com wrote: Ok.. then try this... !--- create list --- cfset variables.exampleList = Boat,Goat,Moat,CherryPie cfset changedlist=ReplaceNoCase(#variables.exampleList#,oat,%) !--- output only the words that contain oat --- cfloop list=#ChangedList# index=i delimiters=% cfset NewI=ReplaceNoCase(#changedlist#,%,oat) #NewI# /cfloop It's a bit of a kludge, but it should work if I understand the problem correctly. On Thu, Feb 11, 2010 at 2:06 PM, Paul Alkema paulalkemadesi...@gmail.com wrote: Good idea, but unfortunately it didn't work. Thanks though. :) -Original Message- From: Phillip Vector [mailto:vec...@mostdeadlygame.com] Sent: Thursday, February 11, 2010 5:00 PM To: cf-talk Subject: Re: Cfloop List Multiple Charecter Delimiters I don't know if it would work and I'm shooting in the dark, but if you made oat into a variable, would that work? On Thu, Feb 11, 2010 at 1:57 PM, Paul Alkema paulalkemadesi...@gmail.com wrote: Hey all, I have a list that I'm trying to loop, I was wondering if it was possible to have multiple character delimiter. For example.. !--- create list --- cfset variables.exampleList = Boat,Goat,Moat,CherryPie !--- output only the words that contain oat --- cfloop list=#variables.exampleList# index=i delimiters=oat #i# /cfloop I would like something like the above to work, but instead it outputs all that contain a B,O,A or a T. Any ideas? :) Thanks, Paul ~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:330631 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Cfloop List Multiple Charecter Delimiters
multiple character delimiter. I believe CF does not support that natively. Check cflib.org. I have not tried them, but it looks like there are a few functions for multi-character delimiters http://www.cflib.org/udf/splitMX http://www.cflib.org/udf/split ~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:330632 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Cfloop List Multiple Charecter Delimiters
Wouldn't it be pretty straightforward and more legible to just loop over the list and do a conditional on each loop iteration? Unless you've got a ridiculously large list it should still perform well enough. !--- create list --- cfset variables.exampleList = Boat,Goat,Moat,CherryPie !--- output only the words that contain oat --- cfloop list=#variables.exampleList# index=i cfif i contains oat#i#/cfif /cfloop As far as your original question regarding multiple delimiters... cfloop does accept multiple delimiters, but the implementation is that it looks for any of those characters... not the characters as a string. For example, cfloop list=#myList# index=i delimiters=,: will look for the comma as a delimiter -or- the colon. so Foo,Bar:Baz would be a 3 element list. On Thu, Feb 11, 2010 at 2:28 PM, Leigh cfsearch...@yahoo.com wrote: multiple character delimiter. I believe CF does not support that natively. Check cflib.org. I have not tried them, but it looks like there are a few functions for multi-character delimiters http://www.cflib.org/udf/splitMX http://www.cflib.org/udf/split ~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:330635 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Cfloop List Multiple Charecter Delimiters
Wouldn't it be pretty straightforward and more legible to Yes, it should not be that hard to implement and probably with less code than one of those udf's. But the other looks elegant enough. You might see if it does the trick first, before re-inventing the wheel. ~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:330636 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Cfloop List Multiple Charecter Delimiters
Leigh - just to clarify, I wasn't suggesting the straightforward loop w/conditional was more straightforward/legible than the UDFs on cflib... I meant in general compared to some of the suggestions so far in this thread. Not taking anything away from any the suggestions themselves... they're all good and I'm glad to see people making an effort to help and answer questions. My answer was just... keep it simple :) On Thu, Feb 11, 2010 at 6:03 PM, Leigh cfsearch...@yahoo.com wrote: Wouldn't it be pretty straightforward and more legible to Yes, it should not be that hard to implement and probably with less code than one of those udf's. But the other looks elegant enough. You might see if it does the trick first, before re-inventing the wheel. ~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:330637 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: Cfloop List Multiple Charecter Delimiters
My answer was just... keep it simple :) Always good advice :) ~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:330639 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: cfloop list
Wack some #'s in there. list=#incorrentList# Ade -Original Message- From: Saturday (Stuart Kidd) [mailto:[EMAIL PROTECTED] Sent: 03 October 2005 22:15 To: CF-Talk Subject: cfloop list Hi guys, I've appended a list and on this occasion my list outputs 1,3,5 (for instance). cfloop list=incorrectList index=thisItem cfoutput#GetQuizQuestions.questionText[thisItem]# this wrong/cfoutput /cfloop The problem i'm coming across an error which says: The value incorrectList cannot be converted to a number Does anyone know a way around this? Thanks, Saturday ~| Find out how CFTicket can increase your company's customer support efficiency by 100% http://www.houseoffusion.com/banners/view.cfm?bannerid=49 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:219975 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54
Re: cfloop list
put poundage around the LIST attribute of your CFLOOP tag. cfloop list=#incorrectList# index=thisItem otherwise you're looping over the literal list 'incorrectList' which is a one element list with the one element of 'incorrectList' :) On 10/3/05, Saturday (Stuart Kidd) [EMAIL PROTECTED] wrote: Hi guys, I've appended a list and on this occasion my list outputs 1,3,5 (for instance). cfloop list=incorrectList index=thisItem cfoutput#GetQuizQuestions.questionText[thisItem]# this wrong/cfoutput /cfloop The problem i'm coming across an error which says: The value incorrectList cannot be converted to a number Does anyone know a way around this? Thanks, Saturday ~| Discover CFTicket - The leading ColdFusion Help Desk and Trouble Ticket application http://www.houseoffusion.com/banners/view.cfm?bannerid=48 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:219976 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54
RE: cfloop list
You have to pound the list name or else it thinks you're trying to use the words incorrectList as the list. !//-- andy matthews web developer ICGLink, Inc. [EMAIL PROTECTED] 615.370.1530 x737 --//- -Original Message- From: Saturday (Stuart Kidd) [mailto:[EMAIL PROTECTED] Sent: Monday, October 03, 2005 4:15 PM To: CF-Talk Subject: cfloop list Hi guys, I've appended a list and on this occasion my list outputs 1,3,5 (for instance). cfloop list=incorrectList index=thisItem cfoutput#GetQuizQuestions.questionText[thisItem]# this wrong/cfoutput /cfloop The problem i'm coming across an error which says: The value incorrectList cannot be converted to a number Does anyone know a way around this? Thanks, Saturday ~| Logware (www.logware.us): a new and convenient web-based time tracking application. Start tracking and documenting hours spent on a project or with a client with Logware today. Try it for free with a 15 day trial account. http://www.houseoffusion.com/banners/view.cfm?bannerid=67 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:219977 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54
RE: cfloop list
Shouldn't that list variable have quotes around it? -Original Message- From: Saturday (Stuart Kidd) [mailto:[EMAIL PROTECTED] Sent: Monday, October 03, 2005 5:15 PM To: CF-Talk Subject: cfloop list Hi guys, I've appended a list and on this occasion my list outputs 1,3,5 (for instance). cfloop list=incorrectList index=thisItem cfoutput#GetQuizQuestions.questionText[thisItem]# this wrong/cfoutput /cfloop The problem i'm coming across an error which says: The value incorrectList cannot be converted to a number Does anyone know a way around this? Thanks, Saturday ~| Logware (www.logware.us): a new and convenient web-based time tracking application. Start tracking and documenting hours spent on a project or with a client with Logware today. Try it for free with a 15 day trial account. http://www.houseoffusion.com/banners/view.cfm?bannerid=67 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:219978 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54
Re: cfloop list
oh! easy as that, thanks everyone for your replies :) Thanks! On 3 Oct 2005, at 22:23, Adrian Lynch wrote: Wack some #'s in there. list=#incorrentList# Ade -Original Message- From: Saturday (Stuart Kidd) [mailto:[EMAIL PROTECTED] Sent: 03 October 2005 22:15 To: CF-Talk Subject: cfloop list Hi guys, I've appended a list and on this occasion my list outputs 1,3,5 (for instance). cfloop list=incorrectList index=thisItem cfoutput#GetQuizQuestions.questionText[thisItem]# this wrong/cfoutput /cfloop The problem i'm coming across an error which says: The value incorrectList cannot be converted to a number Does anyone know a way around this? Thanks, Saturday ~| Logware (www.logware.us): a new and convenient web-based time tracking application. Start tracking and documenting hours spent on a project or with a client with Logware today. Try it for free with a 15 day trial account. http://www.houseoffusion.com/banners/view.cfm?bannerid=67 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:219979 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54
Re: CFLOOP list=Query.Value ??
On 4/7/00, Todd Ashworth penned: The list="Query.Value" sounds good in theory, but I'm sure I'm doing it way wrong. Any suggestions? Try using the good ol' pound symbols: CFLOOP index="varLoopKidIDFromParentRelationships" list="#qryGetKidsFromParentsID.emer_ref#" delimiters="," Bud Schneehagen - Tropical Web Creations _/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/ ColdFusion Solutions / eCommerce Development [EMAIL PROTECTED] http://www.twcreations.com/ 954.721.3452 -- Archives: http://www.eGroups.com/list/cf-talk To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body.
Re: CFLOOP list=Query.Value ??
Actually, ValuList() worked. (thanks Dave), so I think you are both right, but if anyone has a better, more streamlined solution than the hack job I'm doing, I would love to hear it. Todd Ashworth -- Saber Corporation Web Application Development www.sabersite.com (803) 327-0137 [111] (803) 328-2868 (fax) - Original Message - From: "Sean Daniels" [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, April 07, 2000 2:38 PM Subject: RE: CFLOOP list="Query.Value" ?? I may be wrong on this, but my interpretation of his situation was that the field contents *was* in fact a comma delim list. Presumably he would be selecting only one row at a time so the valuelist function wouldn't do anything, right? It's not the ideal, normalized situation, but I think all he's missing are the #'s. - Sean Sean Daniels Manager, Engineering DealStream.com [EMAIL PROTECTED] http://www.dealstream.com tel: 207.439.6030 cel: 978.764.0779 -- Archives: http://www.eGroups.com/list/cf-talk To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body.
RE: CFLOOP list=Query.Value ??
I may be wrong on this, but my interpretation of his situation was that the field contents *was* in fact a comma delim list. Presumably he would be selecting only one row at a time so the valuelist function wouldn't do anything, right? That is certainly a possibility. It wouldn't be the first time I've misunderstood something. It's not the ideal, normalized situation, but I think all he's missing are the #'s. I guess I just assume that everyone normalizes their tables. Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ voice: (202) 797-5496 fax: (202) 797-5444 -- Archives: http://www.eGroups.com/list/cf-talk To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body.
Re: CFLOOP list=Query.Value ??
It's not the ideal, normalized situation, but I think all he's missing are the #'s. I guess I just assume that everyone normalizes their tables. Please explain how I could normalize this table? Database designs is not my forte, but unfortunately, I have the joy of learning that hard way. What I have is a list of relationships. For each contact in my database, I have a field in the contact table that contains the comma delimited list of numbers. These numbers are the primary key values for other contacts in the contact table that this person has set up a relationship to. Is this not the best way to handle this? Todd Ashworth -- Archives: http://www.eGroups.com/list/cf-talk To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body.
RE: CFLOOP list=Query.Value ??
Please explain how I could normalize this table? Database designs is not my forte, but unfortunately, I have the joy of learning that hard way. If you want to build database applications, it's a good idea to spend some time learning about designing data schemas. I can't overemphasize this. I see quite a few CF applications, and the biggest problems with those applications aren't the CF coding itself, but either the database design or the actual SQL used to query. What I have is a list of relationships. For each contact in my database, I have a field in the contact table that contains the comma delimited list of numbers. These numbers are the primary key values for other contacts in the contact table that this person has set up a relationship to. Is this not the best way to handle this? It sounds like each contact has one or more relationships with other contacts in the same table. This is essentially the same as a many-to-many relationship, except that both sides of the relationship are stored in the same table. You can create a linking table, which might have two fields: Contact_Relationship: Contact_ID - integer Relationship_Contact_ID - integer The table should have both fields related to the Contact_ID field within the Contact table, and should use both fields to define its primary key, and shouldn't have any identity column Instead of writing the list of numbers into a field within the contact table, loop over the list of numbers and insert each one as a relationship contact ID. For example, let's say that Contact 47 has relationships with 12, 15 and 92. You could then insert each of these relationships into your Contact_Relationship table: !--- Contact_ID = 47, ListOfRelationships = "12,15,92" --- CFLOOP INDEX="i" LIST="#ListOfRelationships#" CFQUERY NAME="qInsRelationship" ... INSERT INTO Contact_Relationship (Contact_ID, Relationship_Contact_ID) VALUES (#Contact_ID#, #i#) /CFQUERY /CFLOOP This should be enough to get you started. Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ voice: (202) 797-5496 fax: (202) 797-5444 -- Archives: http://www.eGroups.com/list/cf-talk To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body.