RE: Short Question? CFOUTPUT converting " to "
>> Why is CFOUTPUT converting the value " to " on its own? It's not. " is the HTML command to display a quotation. When " it is outputted to the browser the browser will display the quotation mark not the literal command. The HTMLeditFormat() command prevents the rendering of a Quotation mark. Dennis Powers UXB Internet - A website Design and Hosting Company P.O. Box 6028, Wolcott, CT 06716 - T:203-879-2844 W: http://www.uxbinternet.com W: http://www.ctbusinesslist.com -Original Message- From: Robert Harrison [mailto:rob...@austin-williams.com] Sent: Tuesday, April 30, 2013 3:45 PM To: cf-talk Subject: Short Question? CFOUTPUT converting " to " So, I found a work around, but does anyone know why these would give me different values? ... the value is "mystring" #form.text# ... the value is "mystring" Why is CFOUTPUT converting the value " to " on its own? Robert Harrison Director of Interactive Services Austin & Williams Advertising I Branding I Digital I Direct 125 Kennedy Drive, Suite 100 I Hauppauge, NY 11788 T 631.231.6600 X 119 F 631.434.7022 http://www.austin-williams.com Blog: http://www.austin-williams.com/blog Twitter: http://www.twitter.com/austin_ ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:355637 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
RE: Strange Thing - CFOUTPUT converting " to "
The " is being rendered in the HTML engine of the browser as it should be if you want to display it as " then you should use #htmleditformat(form.text)# Dennis Powers UXB Internet - A website Design and Hosting Company P.O. Box 6028, Wolcott, CT 06716 - T:203-879-2844 W: http://www.uxbinternet.com W: http://www.ctbusinesslist.com -Original Message- From: Robert Harrison [mailto:rob...@austin-williams.com] Sent: Tuesday, April 30, 2013 2:10 PM To: cf-talk Subject: Strange Thing - CFOUTPUT converting " to " I have a field in a form with quoted values, but the values are ". When I post it to another page and output it, something is changing the " to a real " (in the source, not the just the display). I put the following on the page to test... #form.text# When I do view source the value of the dump is - "myvaule are " the value of the output is "myvalue" What am I missing? Why is " being converted to " on cfoutput? I don't want it changed. Thanks Robert Harrison Director of Interactive Services Austin & Williams Advertising I Branding I Digital I Direct 125 Kennedy Drive, Suite 100 I Hauppauge, NY 11788 T 631.231.6600 X 119 F 631.434.7022 http://www.austin-williams.com Blog: http://www.austin-williams.com/blog Twitter: http://www.twitter.com/austin_wi ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:355636 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Short Question? CFOUTPUT converting " to "
If you view source for the cfoutput block you will find "mystring" Looks like your html doc, not cfohtput, is rendering the entity code as expected. ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:355635 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Short Question? CFOUTPUT converting " to "
My guess would be that the dump ends up with doubled double quotes and that is throwing something off if FORM.tex = "my string" then your dump is As you may know, double quotes in say form input field values can cause tags to break unless you wrap the value in something like htmlEditFormat() - so based on seeing that happen I'm assuming something similar is going on with your dump tag. shot in the dark - hope it helps Cheers *Bryan Stevenson*B.Comm. VP & Director of E-Commerce Development Electric Edge Systems Group Inc. - makers of FACTS^(TM) phone: 250.480.0642 cell: 250.920.8830 e-mail: br...@electricedgesystems.com <mailto:br...@electricedgesystems.com> web: www.electricedgesystems.com <http://www.electricedgesystems.com> and www.fisheryfacts.com <http://www.fisheryfacts.com> Please consider the environment before printing this e-mail -CONFIDENTIALITY-- This message, including any attachments, is confidential and may contain information that is privileged or exempt from disclosure. It is intended only for the person to whom it is addressed unless expressly authorized otherwise by the sender. If you are not an authorized recipient, please notify the sender immediately and permanently destroy all copies of this message and attachments. On 13-04-30 12:44 PM, Robert Harrison wrote: > So, I found a work around, but does anyone know why these would give me > different values? > > >... the value is "mystring" > #form.text# > ... the value is "mystring" > > Why is CFOUTPUT converting the value " to " on its own? > > > Robert Harrison > Director of Interactive Services > > Austin & Williams > Advertising I Branding I Digital I Direct > 125 Kennedy Drive, Suite 100 I Hauppauge, NY 11788 > T 631.231.6600 X 119 F 631.434.7022 > http://www.austin-williams.com > > Blog: http://www.austin-williams.com/blog > Twitter: http://www.twitter.com/austin_ > > ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:355634 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Short Question? CFOUTPUT converting " to "
So, I found a work around, but does anyone know why these would give me different values? ... the value is "mystring" #form.text# ... the value is "mystring" Why is CFOUTPUT converting the value " to " on its own? Robert Harrison Director of Interactive Services Austin & Williams Advertising I Branding I Digital I Direct 125 Kennedy Drive, Suite 100 I Hauppauge, NY 11788 T 631.231.6600 X 119 F 631.434.7022 http://www.austin-williams.com Blog: http://www.austin-williams.com/blog Twitter: http://www.twitter.com/austin_ ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:355633 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
RE: Strange Thing - CFOUTPUT converting " to "
I can get around this by doing a replace of " to " and then it works as I need, but it seems stupid to have to do that when the value is actually " to begin with. Just plain strange. Robert Harrison Director of Interactive Services Austin & Williams Advertising I Branding I Digital I Direct 125 Kennedy Drive, Suite 100 I Hauppauge, NY 11788 T 631.231.6600 X 119 F 631.434.7022 http://www.austin-williams.com Blog: http://www.austin-williams.com/blog Twitter: http://www.twitter.com/austin_williams -Original Message- From: Robert Harrison [mailto:rob...@austin-williams.com] Sent: Tuesday, April 30, 2013 2:10 PM To: cf-talk Subject: Strange Thing - CFOUTPUT converting " to " I have a field in a form with quoted values, but the values are ". When I post it to another page and output it, something is changing the " to a real " (in the source, not the just the display). I put the following on the page to test... #form.text# When I do view source the value of the dump is - "myvaule are " the value of the output is "myvalue" What am I missing? Why is " being converted to " on cfoutput? I don't want it changed. Thanks Robert Harrison Director of Interactive Services Austin & Williams Advertising I Branding I Digital I Direct 125 Kennedy Drive, Suite 100 I Hauppauge, NY 11788 T 631.231.6600 X 119 F 631.434.7022 http://www.austin-williams.com Blog: http://www.austin-williams.com/blog Twitter: http://www.twitter.com/austin_wi ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:355631 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Strange Thing - CFOUTPUT converting " to "
I have a field in a form with quoted values, but the values are ". When I post it to another page and output it, something is changing the " to a real " (in the source, not the just the display). I put the following on the page to test... #form.text# When I do view source the value of the dump is - "myvaule are " the value of the output is "myvalue" What am I missing? Why is " being converted to " on cfoutput? I don't want it changed. Thanks Robert Harrison Director of Interactive Services Austin & Williams Advertising I Branding I Digital I Direct 125 Kennedy Drive, Suite 100 I Hauppauge, NY 11788 T 631.231.6600 X 119 F 631.434.7022 http://www.austin-williams.com Blog: http://www.austin-williams.com/blog Twitter: http://www.twitter.com/austin_wi ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:355630 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: cfoutput and <>
Brilliant Matt Thanks Rob On 5 Nov 2012 at 12:19, Matt Quackenbush wrote: > > <#email#> > > ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:353062 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: cfoutput and <>
<#email#> On Mon, Nov 5, 2012 at 12:17 PM, Rob Voyle wrote: > > Hi folks > > I need to output email addresses enclosed in <> as is <#email#> > > I am using #name# <#email#> > just gives the name how do I escape the < > (doubling doesn't work) > > Thanks > > Rob > > > ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:353061 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
cfoutput and <>
Hi folks I need to output email addresses enclosed in <> as is <#email#> I am using #name# <#email#> just gives the name how do I escape the < > (doubling doesn't work) Thanks Rob ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:353060 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
RE: cfoutput or cfloop? which is the more practical solution
Of course, after all that, I've been pulled away to another project. Although I haven't worked on it in mulling it over I haven't yet crossed the conceptual barrier. You have a series of dates when someone takes and leaves office. TABLE: Governor FNAME MNAME LNAME DATE START DATE END STATE PARTY DOB DODeath GENDER RACE RELIGION PLACE BORN PLACE DIED MILITARY SERVICE (ARMY CAPTAIN, etc) ... Say you want to do a query for all female governors in the 1990s SELECT FNAME MNAME LNAME DATESTART DATEEND GENDER FROM GOVERNOR WHERE DATEEND is greater or equal to January 1, 1990 and DATESTART is lesser or equal to December 31, 1999 (If a person is still in office the date is listed as December 31, 3000.) I'm trying to get my brain around how best to use a numbers/date table. How to create the query. Funny I just read you email a few minutes ago, after working on this for the past hour. -Original Message- From: Maureen [mailto:mamamaur...@gmail.com] Sent: Thursday, September 30, 2010 10:15 PM To: cf-talk Subject: Re: cfoutput or cfloop? which is the more practical solution Did you get this working? If not, could you post the structure of your data table and I'll see if I can send you the SQL to generate it. On Fri, Sep 24, 2010 at 4:23 PM, GLM wrote: > > I have a database with presidents, governors, etc. and need to be able to > pull out information such as: > > > > Get the number of all female governors over the years and spit out something > on the order of: > This seems like a foolish way to do this. Is there a better way to do it? Is > it better to make one query and then use CF to parse it ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:337793 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: cfoutput or cfloop? which is the more practical solution
Did you get this working? If not, could you post the structure of your data table and I'll see if I can send you the SQL to generate it. On Fri, Sep 24, 2010 at 4:23 PM, GLM wrote: > > I have a database with presidents, governors, etc. and need to be able to > pull out information such as: > > > > Get the number of all female governors over the years and spit out something > on the order of: > This seems like a foolish way to do this. Is there a better way to do it? Is > it better to make one query and then use CF to parse it ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:337727 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: cfoutput or cfloop? which is the more practical solution
If you're using MSSQL, you can use my generateDateTable for creating a dynamic date table which you can use: http://blog.pengoworks.com/index.cfm/2009/1/8/Dynamically-generating-a-table-of-dates-in-Microsoft-SQL-Part-Deux While a numbers table is more efficient if you're dealing with 1000s of rows, this works really well for most use cases. -Dan On Sun, Sep 26, 2010 at 10:46 PM, GLM wrote: > > Thx Mike, > > I've started my reading early. One of my questions was: how much space > would > the numbers table occupy? > > Found that that 2G rows (2,000,000,000) is roughly 8GB in size. > > http://code.msdn.microsoft.com/SQLExamples/Wiki/View.aspx?title=NumbersTable > > I'll need at the most 365 x 3000 years if the clients wanted one database > that went from Egyptian pharaohs to American Presidents (yeah right) that > would be roughly 1,000,000 rows. This expanded table would be roughly 4MBs > (1/2000 of 8GBs) so I don't particularly have to worry about size. > > Since a numbers table for the US is "only" about 80,000 rows the numbers > table would be less than 400K. Not bad at all. > > - Gil > > -Original Message- > From: Mike Chabot [mailto:mcha...@gmail.com] > Sent: Sunday, September 26, 2010 8:08 PM > To: cf-talk > Subject: Re: cfoutput or cfloop? which is the more practical solution > > > I was thinking years, but you could do days as well. It depends on > what you want to group on in the output. > > To save you some searching, below is SQL to fill a numbers table for > SQL Server, if you go that route. As I said earlier, the other methods > work fine also. I tend to prefer doing as much as possible on the > database server, since databases are optimized for handling data. > > CREATE TABLE [dbo].[numbers]( > [number] [int] NOT NULL, > CONSTRAINT [PK_numbers] PRIMARY KEY CLUSTERED > ( > [number] ASC > )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY > = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = > 100) ON [PRIMARY] > ) ON [PRIMARY] > > > declare @counter int > set @counter = 0 > begin tran > while @counter < 8000 > begin > set @counter = @counter + 1 > INSERT INTO numbers (number) > VALUES (@counter) > print 'The counter is ' + cast(@counter as char) > end > commit > > -Mike Chabot > > http://www.linkedin.com/in/chabot/ > > On Sun, Sep 26, 2010 at 2:50 PM, GLM wrote: > > > > Maybe I don't have a clear concept of a numbers table (I'll be reading up > on > > them tomorrow.) but wouldn't I need a "number" to correspond to the units > in > > question (in this case days.) > > > > ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:337584 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: cfoutput or cfloop? which is the more practical solution
ok sorry I must have missed that in the original post. On Mon, Sep 27, 2010 at 12:58 AM, Mike Chabot wrote: > > If someone is in office with a range of 2004 - 2006, the year 2005 > does not appear in the SQL results, yet 2005 needs to be grouped on. > You can't group on a value that doesn't exist. There is no year column > in the output to group on, only a start date and an end date. > > -Mike Chabot > > On Sun, Sep 26, 2010 at 4:02 PM, Russ Michaels > wrote: > > > > Mike, > > > > why do you would you need to know the exact years to use grouped output? > > This is not how it works. > > Grouped output simply groups the output by the defined column > > So if you group ny year, it will output all records with the same year > > together allowing you to then separate the output, add headings etc. > > > > > > On Sun, Sep 26, 2010 at 4:34 PM, Mike Chabot wrote: > > > >> > >> The grouped output doesn't work because the exact years are not known > >> in the query output. Only the date range is known. > >> > >> -Mike Chabot > >> > >> On Sun, Sep 26, 2010 at 5:20 AM, Russ Michaels > >> wrote: > >> > > >> > did the grouped cfoutpout not work for you then ? > >> > > >> > On Sun, Sep 26, 2010 at 4:55 AM, GLM wrote: > >> > > >> >> > >> >> Mike thanks for the lead. It had crossed my mind to build a numbers > >> table > >> >> but I didn't think it would work. (I've never used them myself.) > >> >> > >> >> I thought that it was somewhat excessive as there would have to be at > >> least > >> >> 365x220 rows (over 80,000). In the examples I gave I think one row > per > >> year > >> >> (220) would be more than good enough but there are numerous > exceptions > >> >> (people dying in office, getting nominated to higher office, etc...) > >> >> > >> >> I'll give it a shot. > >> >> > >> >> Thx > >> >> > >> >> -Original Message- > >> >> From: Mike Chabot [mailto:mcha...@gmail.com] > >> >> Sent: Saturday, September 25, 2010 10:50 PM > >> >> To: cf-talk > >> >> Subject: Re: cfoutput or cfloop? which is the more practical solution > >> >> > >> >> > >> >> You can do this in SQL, although the methods I can think of involve > >> >> advanced techniques so I hesitate to recommend them based on your > >> >> stated SQL experience. One technique involves joining to a "numbers > >> >> table" which will transform the start and end dates into one row per > >> >> year. > >> >> > >> >> You can use the cfloop technique in your first post. It should get > the > >> >> job done. It isn't the fastest method, but it could be fast enough. > >> >> One alternative to consider would be to have one big database query, > >> >> then loop over the one query once and build up an array or a > structure > >> >> containing the data you want to output, then cfoutput the array or > >> >> structure. > >> >> > >> >> -Mike Chabot > >> >> > >> >> On Fri, Sep 24, 2010 at 10:28 PM, GLM wrote: > >> >> > > >> >> > Thanks Mike, > >> >> > > >> >> > I'm not a SQL expert but I don't see how. I can do something with > >> >> particular > >> >> > fields such as the year the person was elected (governorDateStart) > or > >> >> when > >> >> > the person left office governorDateEnd > >> >> > > >> >> > > >> >> >SELECT > >> >> >governorParty, > >> >> >COUNT(governorState), > >> >> >governorDateStart > >> >> >WHERE gender=female > >> >> > > >> >> >FROM > >> >> >governors > >> >> > > >> >> >GROUP BY governorParty, governorDateStart > >> >> > > >> >> > And get something along the line of: > >> >> > > >> >> > 2001 - Republican - 2 > >> >> > 2002 - Republican - 1 > >> >> >
RE: cfoutput or cfloop? which is the more practical solution
Thx Mike, I've started my reading early. One of my questions was: how much space would the numbers table occupy? Found that that 2G rows (2,000,000,000) is roughly 8GB in size. http://code.msdn.microsoft.com/SQLExamples/Wiki/View.aspx?title=NumbersTable I'll need at the most 365 x 3000 years if the clients wanted one database that went from Egyptian pharaohs to American Presidents (yeah right) that would be roughly 1,000,000 rows. This expanded table would be roughly 4MBs (1/2000 of 8GBs) so I don't particularly have to worry about size. Since a numbers table for the US is "only" about 80,000 rows the numbers table would be less than 400K. Not bad at all. - Gil -Original Message- From: Mike Chabot [mailto:mcha...@gmail.com] Sent: Sunday, September 26, 2010 8:08 PM To: cf-talk Subject: Re: cfoutput or cfloop? which is the more practical solution I was thinking years, but you could do days as well. It depends on what you want to group on in the output. To save you some searching, below is SQL to fill a numbers table for SQL Server, if you go that route. As I said earlier, the other methods work fine also. I tend to prefer doing as much as possible on the database server, since databases are optimized for handling data. CREATE TABLE [dbo].[numbers]( [number] [int] NOT NULL, CONSTRAINT [PK_numbers] PRIMARY KEY CLUSTERED ( [number] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 100) ON [PRIMARY] ) ON [PRIMARY] declare @counter int set @counter = 0 begin tran while @counter < 8000 begin set @counter = @counter + 1 INSERT INTO numbers (number) VALUES (@counter) print 'The counter is ' + cast(@counter as char) end commit -Mike Chabot http://www.linkedin.com/in/chabot/ On Sun, Sep 26, 2010 at 2:50 PM, GLM wrote: > > Maybe I don't have a clear concept of a numbers table (I'll be reading up on > them tomorrow.) but wouldn't I need a "number" to correspond to the units in > question (in this case days.) ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:337569 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: cfoutput or cfloop? which is the more practical solution
How about dynamically generating a set of UNIONed queries (one for each of the years in the range)? -- WSS4CF - WS-Security framework for CF http://wss4cf.riaforge.org/ On 27 September 2010 07:58, Mike Chabot wrote: > > If someone is in office with a range of 2004 - 2006, the year 2005 > does not appear in the SQL results, yet 2005 needs to be grouped on. > You can't group on a value that doesn't exist. There is no year column > in the output to group on, only a start date and an end date. > > -Mike Chabot > > On Sun, Sep 26, 2010 at 4:02 PM, Russ Michaels wrote: >> >> Mike, >> >> why do you would you need to know the exact years to use grouped output? >> This is not how it works. >> Grouped output simply groups the output by the defined column >> So if you group ny year, it will output all records with the same year >> together allowing you to then separate the output, add headings etc. >> >> >> On Sun, Sep 26, 2010 at 4:34 PM, Mike Chabot wrote: >> >>> >>> The grouped output doesn't work because the exact years are not known >>> in the query output. Only the date range is known. >>> >>> -Mike Chabot >>> >>> On Sun, Sep 26, 2010 at 5:20 AM, Russ Michaels >>> wrote: >>> > >>> > did the grouped cfoutpout not work for you then ? >>> > >>> > On Sun, Sep 26, 2010 at 4:55 AM, GLM wrote: >>> > >>> >> >>> >> Mike thanks for the lead. It had crossed my mind to build a numbers >>> table >>> >> but I didn't think it would work. (I've never used them myself.) >>> >> >>> >> I thought that it was somewhat excessive as there would have to be at >>> least >>> >> 365x220 rows (over 80,000). In the examples I gave I think one row per >>> year >>> >> (220) would be more than good enough but there are numerous exceptions >>> >> (people dying in office, getting nominated to higher office, etc...) >>> >> >>> >> I'll give it a shot. >>> >> >>> >> Thx >>> >> >>> >> -Original Message- >>> >> From: Mike Chabot [mailto:mcha...@gmail.com] >>> >> Sent: Saturday, September 25, 2010 10:50 PM >>> >> To: cf-talk >>> >> Subject: Re: cfoutput or cfloop? which is the more practical solution >>> >> >>> >> >>> >> You can do this in SQL, although the methods I can think of involve >>> >> advanced techniques so I hesitate to recommend them based on your >>> >> stated SQL experience. One technique involves joining to a "numbers >>> >> table" which will transform the start and end dates into one row per >>> >> year. >>> >> >>> >> You can use the cfloop technique in your first post. It should get the >>> >> job done. It isn't the fastest method, but it could be fast enough. >>> >> One alternative to consider would be to have one big database query, >>> >> then loop over the one query once and build up an array or a structure >>> >> containing the data you want to output, then cfoutput the array or >>> >> structure. >>> >> >>> >> -Mike Chabot >>> >> >>> >> On Fri, Sep 24, 2010 at 10:28 PM, GLM wrote: >>> >> > >>> >> > Thanks Mike, >>> >> > >>> >> > I'm not a SQL expert but I don't see how. I can do something with >>> >> particular >>> >> > fields such as the year the person was elected (governorDateStart) or >>> >> when >>> >> > the person left office governorDateEnd >>> >> > >>> >> > >>> >> > SELECT >>> >> > governorParty, >>> >> > COUNT(governorState), >>> >> > governorDateStart >>> >> > WHERE gender=female >>> >> > >>> >> > FROM >>> >> > governors >>> >> > >>> >> > GROUP BY governorParty, governorDateStart >>> >> > >>> >> > And get something along the line of: >>> >> > >>> >> > 2001 - Republican - 2 >>> >> > 2002 - Republican - 1 &
Re: cfoutput or cfloop? which is the more practical solution
I was thinking years, but you could do days as well. It depends on what you want to group on in the output. To save you some searching, below is SQL to fill a numbers table for SQL Server, if you go that route. As I said earlier, the other methods work fine also. I tend to prefer doing as much as possible on the database server, since databases are optimized for handling data. CREATE TABLE [dbo].[numbers]( [number] [int] NOT NULL, CONSTRAINT [PK_numbers] PRIMARY KEY CLUSTERED ( [number] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 100) ON [PRIMARY] ) ON [PRIMARY] declare @counter int set @counter = 0 begin tran while @counter < 8000 begin set @counter = @counter + 1 INSERT INTO numbers (number) VALUES (@counter) print 'The counter is ' + cast(@counter as char) end commit -Mike Chabot http://www.linkedin.com/in/chabot/ On Sun, Sep 26, 2010 at 2:50 PM, GLM wrote: > > Maybe I don't have a clear concept of a numbers table (I'll be reading up on > them tomorrow.) but wouldn't I need a "number" to correspond to the units in > question (in this case days.) ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:337567 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: cfoutput or cfloop? which is the more practical solution
If someone is in office with a range of 2004 - 2006, the year 2005 does not appear in the SQL results, yet 2005 needs to be grouped on. You can't group on a value that doesn't exist. There is no year column in the output to group on, only a start date and an end date. -Mike Chabot On Sun, Sep 26, 2010 at 4:02 PM, Russ Michaels wrote: > > Mike, > > why do you would you need to know the exact years to use grouped output? > This is not how it works. > Grouped output simply groups the output by the defined column > So if you group ny year, it will output all records with the same year > together allowing you to then separate the output, add headings etc. > > > On Sun, Sep 26, 2010 at 4:34 PM, Mike Chabot wrote: > >> >> The grouped output doesn't work because the exact years are not known >> in the query output. Only the date range is known. >> >> -Mike Chabot >> >> On Sun, Sep 26, 2010 at 5:20 AM, Russ Michaels >> wrote: >> > >> > did the grouped cfoutpout not work for you then ? >> > >> > On Sun, Sep 26, 2010 at 4:55 AM, GLM wrote: >> > >> >> >> >> Mike thanks for the lead. It had crossed my mind to build a numbers >> table >> >> but I didn't think it would work. (I've never used them myself.) >> >> >> >> I thought that it was somewhat excessive as there would have to be at >> least >> >> 365x220 rows (over 80,000). In the examples I gave I think one row per >> year >> >> (220) would be more than good enough but there are numerous exceptions >> >> (people dying in office, getting nominated to higher office, etc...) >> >> >> >> I'll give it a shot. >> >> >> >> Thx >> >> >> >> -Original Message- >> >> From: Mike Chabot [mailto:mcha...@gmail.com] >> >> Sent: Saturday, September 25, 2010 10:50 PM >> >> To: cf-talk >> >> Subject: Re: cfoutput or cfloop? which is the more practical solution >> >> >> >> >> >> You can do this in SQL, although the methods I can think of involve >> >> advanced techniques so I hesitate to recommend them based on your >> >> stated SQL experience. One technique involves joining to a "numbers >> >> table" which will transform the start and end dates into one row per >> >> year. >> >> >> >> You can use the cfloop technique in your first post. It should get the >> >> job done. It isn't the fastest method, but it could be fast enough. >> >> One alternative to consider would be to have one big database query, >> >> then loop over the one query once and build up an array or a structure >> >> containing the data you want to output, then cfoutput the array or >> >> structure. >> >> >> >> -Mike Chabot >> >> >> >> On Fri, Sep 24, 2010 at 10:28 PM, GLM wrote: >> >> > >> >> > Thanks Mike, >> >> > >> >> > I'm not a SQL expert but I don't see how. I can do something with >> >> particular >> >> > fields such as the year the person was elected (governorDateStart) or >> >> when >> >> > the person left office governorDateEnd >> >> > >> >> > >> >> > SELECT >> >> > governorParty, >> >> > COUNT(governorState), >> >> > governorDateStart >> >> > WHERE gender=female >> >> > >> >> > FROM >> >> > governors >> >> > >> >> > GROUP BY governorParty, governorDateStart >> >> > >> >> > And get something along the line of: >> >> > >> >> > 2001 - Republican - 2 >> >> > 2002 - Republican - 1 >> >> > 2003 - Democratic - 3 >> >> > 2003 - Republican - 1 >> >> > 2004 - Democratic - 1 >> >> > 2004 - Republican - 1 >> >> > 2005 - Democratic - 1 >> >> > 2006 - Republican - 1 >> >> > 2009 - Democratic - 1 >> >> > 2009 - Republican - 1 >> >> > >> >> > But what's desired is: how many are in office at a particular time. >> >> > For instance: >> >> > list the governors in 1889; >> >> > list the number of female governors in 2005 >> &g
Re: cfoutput or cfloop? which is the more practical solution
Mike, why do you would you need to know the exact years to use grouped output? This is not how it works. Grouped output simply groups the output by the defined column So if you group ny year, it will output all records with the same year together allowing you to then separate the output, add headings etc. On Sun, Sep 26, 2010 at 4:34 PM, Mike Chabot wrote: > > The grouped output doesn't work because the exact years are not known > in the query output. Only the date range is known. > > -Mike Chabot > > On Sun, Sep 26, 2010 at 5:20 AM, Russ Michaels > wrote: > > > > did the grouped cfoutpout not work for you then ? > > > > On Sun, Sep 26, 2010 at 4:55 AM, GLM wrote: > > > >> > >> Mike thanks for the lead. It had crossed my mind to build a numbers > table > >> but I didn't think it would work. (I've never used them myself.) > >> > >> I thought that it was somewhat excessive as there would have to be at > least > >> 365x220 rows (over 80,000). In the examples I gave I think one row per > year > >> (220) would be more than good enough but there are numerous exceptions > >> (people dying in office, getting nominated to higher office, etc...) > >> > >> I'll give it a shot. > >> > >> Thx > >> > >> -Original Message- > >> From: Mike Chabot [mailto:mcha...@gmail.com] > >> Sent: Saturday, September 25, 2010 10:50 PM > >> To: cf-talk > >> Subject: Re: cfoutput or cfloop? which is the more practical solution > >> > >> > >> You can do this in SQL, although the methods I can think of involve > >> advanced techniques so I hesitate to recommend them based on your > >> stated SQL experience. One technique involves joining to a "numbers > >> table" which will transform the start and end dates into one row per > >> year. > >> > >> You can use the cfloop technique in your first post. It should get the > >> job done. It isn't the fastest method, but it could be fast enough. > >> One alternative to consider would be to have one big database query, > >> then loop over the one query once and build up an array or a structure > >> containing the data you want to output, then cfoutput the array or > >> structure. > >> > >> -Mike Chabot > >> > >> On Fri, Sep 24, 2010 at 10:28 PM, GLM wrote: > >> > > >> > Thanks Mike, > >> > > >> > I'm not a SQL expert but I don't see how. I can do something with > >> particular > >> > fields such as the year the person was elected (governorDateStart) or > >> when > >> > the person left office governorDateEnd > >> > > >> > > >> >SELECT > >> >governorParty, > >> >COUNT(governorState), > >> >governorDateStart > >> >WHERE gender=female > >> > > >> >FROM > >> >governors > >> > > >> >GROUP BY governorParty, governorDateStart > >> > > >> > And get something along the line of: > >> > > >> > 2001 - Republican - 2 > >> > 2002 - Republican - 1 > >> > 2003 - Democratic - 3 > >> > 2003 - Republican - 1 > >> > 2004 - Democratic - 1 > >> > 2004 - Republican - 1 > >> > 2005 - Democratic - 1 > >> > 2006 - Republican - 1 > >> > 2009 - Democratic - 1 > >> > 2009 - Republican - 1 > >> > > >> > But what's desired is: how many are in office at a particular time. > >> > For instance: > >> > list the governors in 1889; > >> > list the number of female governors in 2005 > >> > > >> > thx > >> > > >> > > >> > > >> > > >> > -Original Message- > >> > From: Mike Chabot [mailto:mcha...@gmail.com] > >> > Sent: Friday, September 24, 2010 7:35 PM > >> > To: cf-talk > >> > Subject: Re: cfoutput or cfloop? which is the more practical solution > >> > > >> > > >> > Are you able to craft a query that will return the results you need > >> > without ColdFusion having to do any extra parsing of it? That is the > >> > first thing I would try. In your brief example it seems like that > >> > would be solved using a GROUP BY statement in the query. &g
RE: cfoutput or cfloop? which is the more practical solution
Maybe I don't have a clear concept of a numbers table (I'll be reading up on them tomorrow.) but wouldn't I need a "number" to correspond to the units in question (in this case days.) thx -Original Message- From: Mike Chabot [mailto:mcha...@gmail.com] Sent: Sunday, September 26, 2010 11:42 AM To: cf-talk Subject: Re: cfoutput or cfloop? which is the more practical solution If you go with the numbers table route, I should clarify that this is a standard technique that is commonly used, so you should be able to find a lot of information by searching on "sql server numbers table." I use these all the time. I would think that your numbers table only needs to contain numbers 1900 - 2100 or so, to cover the years someone would be in office. The only purpose the table would have would be to join to the start and end date ranges to create artificial rows that can be grouped on. I suppose you could call your table "years" instead of "numbers." -Mike Chabot On Sat, Sep 25, 2010 at 11:55 PM, GLM wrote: > > Mike thanks for the lead. It had crossed my mind to build a numbers table > but I didn't think it would work. (I've never used them myself.) > > I thought that it was somewhat excessive as there would have to be at least > 365x220 rows (over 80,000). In the examples I gave I think one row per year > (220) would be more than good enough but there are numerous exceptions > (people dying in office, getting nominated to higher office, etc...) > > I'll give it a shot. > > Thx ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:337564 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
RE: cfoutput or cfloop? which is the more practical solution
I didn't see it working as I only have the dateStart and dateEnd. I guess it's time I learn how a numbers table works. Thx -Original Message- From: Russ Michaels [mailto:r...@michaels.me.uk] Sent: Sunday, September 26, 2010 5:21 AM To: cf-talk Subject: Re: cfoutput or cfloop? which is the more practical solution did the grouped cfoutpout not work for you then ? On Sun, Sep 26, 2010 at 4:55 AM, GLM wrote: > > Mike thanks for the lead. It had crossed my mind to build a numbers table > but I didn't think it would work. (I've never used them myself.) > > I thought that it was somewhat excessive as there would have to be at least > 365x220 rows (over 80,000). In the examples I gave I think one row per year > (220) would be more than good enough but there are numerous exceptions > (people dying in office, getting nominated to higher office, etc...) > > I'll give it a shot. > > Thx > > -Original Message- > From: Mike Chabot [mailto:mcha...@gmail.com] > Sent: Saturday, September 25, 2010 10:50 PM > To: cf-talk > Subject: Re: cfoutput or cfloop? which is the more practical solution > > > You can do this in SQL, although the methods I can think of involve > advanced techniques so I hesitate to recommend them based on your > stated SQL experience. One technique involves joining to a "numbers > table" which will transform the start and end dates into one row per > year. > > You can use the cfloop technique in your first post. It should get the > job done. It isn't the fastest method, but it could be fast enough. > One alternative to consider would be to have one big database query, > then loop over the one query once and build up an array or a structure > containing the data you want to output, then cfoutput the array or > structure. > > -Mike Chabot > ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:337563 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: cfoutput or cfloop? which is the more practical solution
If you go with the numbers table route, I should clarify that this is a standard technique that is commonly used, so you should be able to find a lot of information by searching on "sql server numbers table." I use these all the time. I would think that your numbers table only needs to contain numbers 1900 - 2100 or so, to cover the years someone would be in office. The only purpose the table would have would be to join to the start and end date ranges to create artificial rows that can be grouped on. I suppose you could call your table "years" instead of "numbers." -Mike Chabot On Sat, Sep 25, 2010 at 11:55 PM, GLM wrote: > > Mike thanks for the lead. It had crossed my mind to build a numbers table > but I didn't think it would work. (I've never used them myself.) > > I thought that it was somewhat excessive as there would have to be at least > 365x220 rows (over 80,000). In the examples I gave I think one row per year > (220) would be more than good enough but there are numerous exceptions > (people dying in office, getting nominated to higher office, etc...) > > I'll give it a shot. > > Thx ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:337562 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: cfoutput or cfloop? which is the more practical solution
The grouped output doesn't work because the exact years are not known in the query output. Only the date range is known. -Mike Chabot On Sun, Sep 26, 2010 at 5:20 AM, Russ Michaels wrote: > > did the grouped cfoutpout not work for you then ? > > On Sun, Sep 26, 2010 at 4:55 AM, GLM wrote: > >> >> Mike thanks for the lead. It had crossed my mind to build a numbers table >> but I didn't think it would work. (I've never used them myself.) >> >> I thought that it was somewhat excessive as there would have to be at least >> 365x220 rows (over 80,000). In the examples I gave I think one row per year >> (220) would be more than good enough but there are numerous exceptions >> (people dying in office, getting nominated to higher office, etc...) >> >> I'll give it a shot. >> >> Thx >> >> -Original Message- >> From: Mike Chabot [mailto:mcha...@gmail.com] >> Sent: Saturday, September 25, 2010 10:50 PM >> To: cf-talk >> Subject: Re: cfoutput or cfloop? which is the more practical solution >> >> >> You can do this in SQL, although the methods I can think of involve >> advanced techniques so I hesitate to recommend them based on your >> stated SQL experience. One technique involves joining to a "numbers >> table" which will transform the start and end dates into one row per >> year. >> >> You can use the cfloop technique in your first post. It should get the >> job done. It isn't the fastest method, but it could be fast enough. >> One alternative to consider would be to have one big database query, >> then loop over the one query once and build up an array or a structure >> containing the data you want to output, then cfoutput the array or >> structure. >> >> -Mike Chabot >> >> On Fri, Sep 24, 2010 at 10:28 PM, GLM wrote: >> > >> > Thanks Mike, >> > >> > I'm not a SQL expert but I don't see how. I can do something with >> particular >> > fields such as the year the person was elected (governorDateStart) or >> when >> > the person left office governorDateEnd >> > >> > >> > SELECT >> > governorParty, >> > COUNT(governorState), >> > governorDateStart >> > WHERE gender=female >> > >> > FROM >> > governors >> > >> > GROUP BY governorParty, governorDateStart >> > >> > And get something along the line of: >> > >> > 2001 - Republican - 2 >> > 2002 - Republican - 1 >> > 2003 - Democratic - 3 >> > 2003 - Republican - 1 >> > 2004 - Democratic - 1 >> > 2004 - Republican - 1 >> > 2005 - Democratic - 1 >> > 2006 - Republican - 1 >> > 2009 - Democratic - 1 >> > 2009 - Republican - 1 >> > >> > But what's desired is: how many are in office at a particular time. >> > For instance: >> > list the governors in 1889; >> > list the number of female governors in 2005 >> > >> > thx >> > >> > >> > >> > >> > -Original Message- >> > From: Mike Chabot [mailto:mcha...@gmail.com] >> > Sent: Friday, September 24, 2010 7:35 PM >> > To: cf-talk >> > Subject: Re: cfoutput or cfloop? which is the more practical solution >> > >> > >> > Are you able to craft a query that will return the results you need >> > without ColdFusion having to do any extra parsing of it? That is the >> > first thing I would try. In your brief example it seems like that >> > would be solved using a GROUP BY statement in the query. >> > >> > -Mike Chabot >> > >> > On Fri, Sep 24, 2010 at 7:23 PM, GLM wrote: >> >> >> >> I have a database with presidents, governors, etc. and need to be able >> to >> >> pull out information such as: >> >> >> >> >> >> >> >> Get the number of all female governors over the years and spit out >> > something >> >> on the order of: >> >> >> >> >> >> >> >> 1789 : 0 >> >> >> >> 1790 : 0 >> >> >> >> . >> >> >> >> 2005 : 10 >> >> >> >> . >> >> >> >> 2010 : 6 >> >> >> >> >> >> >> >> The database has dateStarted, dateEnded >> >> >> >> >> >> >> >> I can loop through this [SIMPLIFIED CODE] >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> SELECT >> >> >> >> FROM >> >> >> >> WHERE year == #desiredYear# >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> This seems like a foolish way to do this. Is there a better way to do >> it? >> > Is >> >> it better to make one query and then use CF to parse it >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> > >> > >> > >> > >> >> >> >> > > ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:337561 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: cfoutput or cfloop? which is the more practical solution
did the grouped cfoutpout not work for you then ? On Sun, Sep 26, 2010 at 4:55 AM, GLM wrote: > > Mike thanks for the lead. It had crossed my mind to build a numbers table > but I didn't think it would work. (I've never used them myself.) > > I thought that it was somewhat excessive as there would have to be at least > 365x220 rows (over 80,000). In the examples I gave I think one row per year > (220) would be more than good enough but there are numerous exceptions > (people dying in office, getting nominated to higher office, etc...) > > I'll give it a shot. > > Thx > > -Original Message- > From: Mike Chabot [mailto:mcha...@gmail.com] > Sent: Saturday, September 25, 2010 10:50 PM > To: cf-talk > Subject: Re: cfoutput or cfloop? which is the more practical solution > > > You can do this in SQL, although the methods I can think of involve > advanced techniques so I hesitate to recommend them based on your > stated SQL experience. One technique involves joining to a "numbers > table" which will transform the start and end dates into one row per > year. > > You can use the cfloop technique in your first post. It should get the > job done. It isn't the fastest method, but it could be fast enough. > One alternative to consider would be to have one big database query, > then loop over the one query once and build up an array or a structure > containing the data you want to output, then cfoutput the array or > structure. > > -Mike Chabot > > On Fri, Sep 24, 2010 at 10:28 PM, GLM wrote: > > > > Thanks Mike, > > > > I'm not a SQL expert but I don't see how. I can do something with > particular > > fields such as the year the person was elected (governorDateStart) or > when > > the person left office governorDateEnd > > > > > >SELECT > >governorParty, > >COUNT(governorState), > >governorDateStart > >WHERE gender=female > > > >FROM > >governors > > > >GROUP BY governorParty, governorDateStart > > > > And get something along the line of: > > > > 2001 - Republican - 2 > > 2002 - Republican - 1 > > 2003 - Democratic - 3 > > 2003 - Republican - 1 > > 2004 - Democratic - 1 > > 2004 - Republican - 1 > > 2005 - Democratic - 1 > > 2006 - Republican - 1 > > 2009 - Democratic - 1 > > 2009 - Republican - 1 > > > > But what's desired is: how many are in office at a particular time. > > For instance: > > list the governors in 1889; > > list the number of female governors in 2005 > > > > thx > > > > > > > > > > -Original Message- > > From: Mike Chabot [mailto:mcha...@gmail.com] > > Sent: Friday, September 24, 2010 7:35 PM > > To: cf-talk > > Subject: Re: cfoutput or cfloop? which is the more practical solution > > > > > > Are you able to craft a query that will return the results you need > > without ColdFusion having to do any extra parsing of it? That is the > > first thing I would try. In your brief example it seems like that > > would be solved using a GROUP BY statement in the query. > > > > -Mike Chabot > > > > On Fri, Sep 24, 2010 at 7:23 PM, GLM wrote: > >> > >> I have a database with presidents, governors, etc. and need to be able > to > >> pull out information such as: > >> > >> > >> > >> Get the number of all female governors over the years and spit out > > something > >> on the order of: > >> > >> > >> > >> 1789 : 0 > >> > >> 1790 : 0 > >> > >> . > >> > >> 2005 : 10 > >> > >> . > >> > >> 2010 : 6 > >> > >> > >> > >> The database has dateStarted, dateEnded > >> > >> > >> > >> I can loop through this [SIMPLIFIED CODE] > >> > >> > >> > >> > >> > >> > >> > >>SELECT > >> > >>FROM > >> > >>WHERE year == #desiredYear# > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> This seems like a foolish way to do this. Is there a better way to do > it? > > Is > >> it better to make one query and then use CF to parse it > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > > > > > > > > > > > > ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:337556 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
RE: cfoutput or cfloop? which is the more practical solution
Mike thanks for the lead. It had crossed my mind to build a numbers table but I didn't think it would work. (I've never used them myself.) I thought that it was somewhat excessive as there would have to be at least 365x220 rows (over 80,000). In the examples I gave I think one row per year (220) would be more than good enough but there are numerous exceptions (people dying in office, getting nominated to higher office, etc...) I'll give it a shot. Thx -Original Message- From: Mike Chabot [mailto:mcha...@gmail.com] Sent: Saturday, September 25, 2010 10:50 PM To: cf-talk Subject: Re: cfoutput or cfloop? which is the more practical solution You can do this in SQL, although the methods I can think of involve advanced techniques so I hesitate to recommend them based on your stated SQL experience. One technique involves joining to a "numbers table" which will transform the start and end dates into one row per year. You can use the cfloop technique in your first post. It should get the job done. It isn't the fastest method, but it could be fast enough. One alternative to consider would be to have one big database query, then loop over the one query once and build up an array or a structure containing the data you want to output, then cfoutput the array or structure. -Mike Chabot On Fri, Sep 24, 2010 at 10:28 PM, GLM wrote: > > Thanks Mike, > > I'm not a SQL expert but I don't see how. I can do something with particular > fields such as the year the person was elected (governorDateStart) or when > the person left office governorDateEnd > > > SELECT > governorParty, > COUNT(governorState), > governorDateStart > WHERE gender=female > > FROM > governors > > GROUP BY governorParty, governorDateStart > > And get something along the line of: > > 2001 - Republican - 2 > 2002 - Republican - 1 > 2003 - Democratic - 3 > 2003 - Republican - 1 > 2004 - Democratic - 1 > 2004 - Republican - 1 > 2005 - Democratic - 1 > 2006 - Republican - 1 > 2009 - Democratic - 1 > 2009 - Republican - 1 > > But what's desired is: how many are in office at a particular time. > For instance: > list the governors in 1889; > list the number of female governors in 2005 > > thx > > > > > -Original Message- > From: Mike Chabot [mailto:mcha...@gmail.com] > Sent: Friday, September 24, 2010 7:35 PM > To: cf-talk > Subject: Re: cfoutput or cfloop? which is the more practical solution > > > Are you able to craft a query that will return the results you need > without ColdFusion having to do any extra parsing of it? That is the > first thing I would try. In your brief example it seems like that > would be solved using a GROUP BY statement in the query. > > -Mike Chabot > > On Fri, Sep 24, 2010 at 7:23 PM, GLM wrote: >> >> I have a database with presidents, governors, etc. and need to be able to >> pull out information such as: >> >> >> >> Get the number of all female governors over the years and spit out > something >> on the order of: >> >> >> >> 1789 : 0 >> >> 1790 : 0 >> >> . >> >> 2005 : 10 >> >> . >> >> 2010 : 6 >> >> >> >> The database has dateStarted, dateEnded >> >> >> >> I can loop through this [SIMPLIFIED CODE] >> >> >> >> >> >> >> >> SELECT >> >> FROM >> >> WHERE year == #desiredYear# >> >> >> >> >> >> >> >> >> >> This seems like a foolish way to do this. Is there a better way to do it? > Is >> it better to make one query and then use CF to parse it >> >> >> >> >> >> >> >> >> >> >> >> > > > > ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:337555 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: cfoutput or cfloop? which is the more practical solution
You can do this in SQL, although the methods I can think of involve advanced techniques so I hesitate to recommend them based on your stated SQL experience. One technique involves joining to a "numbers table" which will transform the start and end dates into one row per year. You can use the cfloop technique in your first post. It should get the job done. It isn't the fastest method, but it could be fast enough. One alternative to consider would be to have one big database query, then loop over the one query once and build up an array or a structure containing the data you want to output, then cfoutput the array or structure. -Mike Chabot On Fri, Sep 24, 2010 at 10:28 PM, GLM wrote: > > Thanks Mike, > > I'm not a SQL expert but I don't see how. I can do something with particular > fields such as the year the person was elected (governorDateStart) or when > the person left office governorDateEnd > > > SELECT > governorParty, > COUNT(governorState), > governorDateStart > WHERE gender=female > > FROM > governors > > GROUP BY governorParty, governorDateStart > > And get something along the line of: > > 2001 - Republican - 2 > 2002 - Republican - 1 > 2003 - Democratic - 3 > 2003 - Republican - 1 > 2004 - Democratic - 1 > 2004 - Republican - 1 > 2005 - Democratic - 1 > 2006 - Republican - 1 > 2009 - Democratic - 1 > 2009 - Republican - 1 > > But what's desired is: how many are in office at a particular time. > For instance: > list the governors in 1889; > list the number of female governors in 2005 > > thx > > > > > -Original Message- > From: Mike Chabot [mailto:mcha...@gmail.com] > Sent: Friday, September 24, 2010 7:35 PM > To: cf-talk > Subject: Re: cfoutput or cfloop? which is the more practical solution > > > Are you able to craft a query that will return the results you need > without ColdFusion having to do any extra parsing of it? That is the > first thing I would try. In your brief example it seems like that > would be solved using a GROUP BY statement in the query. > > -Mike Chabot > > On Fri, Sep 24, 2010 at 7:23 PM, GLM wrote: >> >> I have a database with presidents, governors, etc. and need to be able to >> pull out information such as: >> >> >> >> Get the number of all female governors over the years and spit out > something >> on the order of: >> >> >> >> 1789 : 0 >> >> 1790 : 0 >> >> . >> >> 2005 : 10 >> >> . >> >> 2010 : 6 >> >> >> >> The database has dateStarted, dateEnded >> >> >> >> I can loop through this [SIMPLIFIED CODE] >> >> >> >> >> >> >> >> SELECT >> >> FROM >> >> WHERE year == #desiredYear# >> >> >> >> >> >> >> >> >> >> This seems like a foolish way to do this. Is there a better way to do it? > Is >> it better to make one query and then use CF to parse it >> >> >> >> >> >> >> >> >> >> >> >> > > > > ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:337553 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
RE: cfoutput or cfloop? which is the more practical solution
Thanks Mike, I'm not a SQL expert but I don't see how. I can do something with particular fields such as the year the person was elected (governorDateStart) or when the person left office governorDateEnd SELECT governorParty, COUNT(governorState), governorDateStart WHERE gender=female FROM governors GROUP BY governorParty, governorDateStart And get something along the line of: 2001 - Republican - 2 2002 - Republican - 1 2003 - Democratic - 3 2003 - Republican - 1 2004 - Democratic - 1 2004 - Republican - 1 2005 - Democratic - 1 2006 - Republican - 1 2009 - Democratic - 1 2009 - Republican - 1 But what's desired is: how many are in office at a particular time. For instance: list the governors in 1889; list the number of female governors in 2005 thx -Original Message- From: Mike Chabot [mailto:mcha...@gmail.com] Sent: Friday, September 24, 2010 7:35 PM To: cf-talk Subject: Re: cfoutput or cfloop? which is the more practical solution Are you able to craft a query that will return the results you need without ColdFusion having to do any extra parsing of it? That is the first thing I would try. In your brief example it seems like that would be solved using a GROUP BY statement in the query. -Mike Chabot On Fri, Sep 24, 2010 at 7:23 PM, GLM wrote: > > I have a database with presidents, governors, etc. and need to be able to > pull out information such as: > > > > Get the number of all female governors over the years and spit out something > on the order of: > > > > 1789 : 0 > > 1790 : 0 > > . > > 2005 : 10 > > . > > 2010 : 6 > > > > The database has dateStarted, dateEnded > > > > I can loop through this [SIMPLIFIED CODE] > > > > > > > > SELECT > > FROM > > WHERE year == #desiredYear# > > > > > > > > > > This seems like a foolish way to do this. Is there a better way to do it? Is > it better to make one query and then use CF to parse it > > > > > > > > > > > > ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:337533 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: cfoutput or cfloop? which is the more practical solution
in your query only select only female governess then use the cfoutput group attribute to group by year, this will then only output records for the same year. you need to next 2 cfoutput. your output here On Sat, Sep 25, 2010 at 12:23 AM, GLM wrote: > > I have a database with presidents, governors, etc. and need to be able to > pull out information such as: > > > > Get the number of all female governors over the years and spit out > something > on the order of: > > > > 1789 : 0 > > 1790 : 0 > > . > > 2005 : 10 > > . > > 2010 : 6 > > > > The database has dateStarted, dateEnded > > > > I can loop through this [SIMPLIFIED CODE] > > > > > > > >SELECT > >FROM > >WHERE year == #desiredYear# > > > > > > > > > > This seems like a foolish way to do this. Is there a better way to do it? > Is > it better to make one query and then use CF to parse it > > > > > > > > > > > > ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:337526 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: cfoutput or cfloop? which is the more practical solution
Are you able to craft a query that will return the results you need without ColdFusion having to do any extra parsing of it? That is the first thing I would try. In your brief example it seems like that would be solved using a GROUP BY statement in the query. -Mike Chabot On Fri, Sep 24, 2010 at 7:23 PM, GLM wrote: > > I have a database with presidents, governors, etc. and need to be able to > pull out information such as: > > > > Get the number of all female governors over the years and spit out something > on the order of: > > > > 1789 : 0 > > 1790 : 0 > > . > > 2005 : 10 > > . > > 2010 : 6 > > > > The database has dateStarted, dateEnded > > > > I can loop through this [SIMPLIFIED CODE] > > > > > > > > SELECT > > FROM > > WHERE year == #desiredYear# > > > > > > > > > > This seems like a foolish way to do this. Is there a better way to do it? Is > it better to make one query and then use CF to parse it > > > > > > > > > > > > ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:337524 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
cfoutput or cfloop? which is the more practical solution
I have a database with presidents, governors, etc. and need to be able to pull out information such as: Get the number of all female governors over the years and spit out something on the order of: 1789 : 0 1790 : 0 . 2005 : 10 . 2010 : 6 The database has dateStarted, dateEnded I can loop through this [SIMPLIFIED CODE] SELECT FROM WHERE year == #desiredYear# This seems like a foolish way to do this. Is there a better way to do it? Is it better to make one query and then use CF to parse it ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:337523 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: cfoutput query within cfoutput query
I think my first post failed :-( SQL with JOIN CFOUTPUT with group SELECT tblPerson.id, tblPerson.name, tblPets.pet FROM tblPerson, tblPets WHERE tblPets.ownerID = tblPerson.id order by tblPerson.id #ID# #name# #pet# On 20 March 2010 06:32, brandon kennedy wrote: > > I have a situation where i need to display info from two queries on the > same row of a table. Here is the background, each person in a database > table has a name and ID which is then linked to another table that lists > pets. Each person can have as many as 4 pets. Now i need to display the > ID, name, and each pet on the same row of table, preferably with the pets > all listed in the same cell. I'm not that experienced with ColdFusion so my > first attempt looked like this: > > > SELECT * > FROM tblPerson > > > > > #ID# > #name# > >SELECT * >FROM tblPets >WHERE ownerID = #person.ID# > > >#pet# > > > > > > If you've read this far, i'm sure you know this won't work but i hope can > see what i'm trying to do. Please help if have any solutions > > ~| 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:331910 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: cfoutput query within cfoutput query
Hi Brandon, 1) Use a cfloop in place of a cfoutput tag for the inner loop. 2) in situations like these I recommend also scoping your variables, eg. the pets in the inner loop would be #pets.pet# 3) in general your approach should be revisited, mainly because it will create and execute a new query for each row returned by query "person", consider performing a join operation and reducing your approach to have only one query. Hope that helps, Dan On Fri, Mar 19, 2010 at 4:32 PM, brandon kennedy wrote: > > I have a situation where i need to display info from two queries on the > same row of a table. Here is the background, each person in a database > table has a name and ID which is then linked to another table that lists > pets. Each person can have as many as 4 pets. Now i need to display the > ID, name, and each pet on the same row of table, preferably with the pets > all listed in the same cell. I'm not that experienced with ColdFusion so my > first attempt looked like this: > > > SELECT * > FROM tblPerson > > > > > #ID# > #name# > >SELECT * >FROM tblPets >WHERE ownerID = #person.ID# > > >#pet# > > > > > > If you've read this far, i'm sure you know this won't work but i hope can > see what i'm trying to do. Please help if have any solutions > > ~| 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:331909 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
cfoutput query within cfoutput query
I have a situation where i need to display info from two queries on the same row of a table. Here is the background, each person in a database table has a name and ID which is then linked to another table that lists pets. Each person can have as many as 4 pets. Now i need to display the ID, name, and each pet on the same row of table, preferably with the pets all listed in the same cell. I'm not that experienced with ColdFusion so my first attempt looked like this: SELECT * FROM tblPerson #ID# #name# SELECT * FROM tblPets WHERE ownerID = #person.ID# #pet# If you've read this far, i'm sure you know this won't work but i hope can see what i'm trying to do. Please help if have any solutions ~| 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:331908 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: script.js file inside cfoutput
That's not much to work with, but my guess would be that you have an opening hash sign (#) before your javascript call and that's throwing ColdFusion off. Whenever you want to display a hash sign between tags you need to escape it like so: This would throw an error: Go to this section This would not: Go to this section Francois Levesque http://blog.critical-web.com/ On Fri, Jul 10, 2009 at 8:15 AM, RamaDevi Dobbala wrote: > > hi frnds, > > i have a problem > > like > > . > . > .Here i have my date field, > where i have to insert .js file, where ever i am insert it is not taking > the file > i am calling js function like this javascript:showID(..) > error is this > > ColdFusion was looking at the following text: > > javascript > . > . > . > > > > ~| 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:324423 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
script.js file inside cfoutput
hi frnds, i have a problem like . . .Here i have my date field, where i have to insert .js file, where ever i am insert it is not taking the file i am calling js function like this javascript:showID(..) error is this ColdFusion was looking at the following text: javascript . . . ~| 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:324422 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: Eliminating repeated data in CFoutput field
Bob, did you try the code I posted earlier? Using rowspan is the ideal way to do this, and it looks like what I wrote should work fine... ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:320726 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Eliminating repeated data in CFoutput field
Yep ! That's it. http://ttcfm.open.ac.uk/~bs3578/test1/abEmpAssets_02.cfm Thanks - Original Message - From: "Nick G" To: "cf-talk" Sent: Thursday, March 19, 2009 9:14 PM Subject: Re: Eliminating repeated data in CFoutput field > > You should be able to do this but I haven't tried it. > > > > Name > Asset > Category > > > > >#qEmpAssets.eName# > > #qEmpAssets.aTitle# > #qEmpAssets.cCategory# > > > > > > > > On Thu, Mar 19, 2009 at 1:45 PM, BobSharp wrote: > >> >> Tried it several ways, yet to get it to work as I want it. >> http://ttcfm.open.ac.uk/~bs3578/test1/abEmpAssets_02.cfm<http://ttcfm.open.ac.uk/%7Ebs3578/test1/abEmpAssets_02.cfm> >> >> Must be the postion of the , in relation to the table >> cells. >> >> >> >>SELECT concat(e.firstname, ' ', e.lastname) AS eName, >>LEFT(a.assetdescription,30) AS aTitle, >>c.assetcategory AS cCategory >>FROM employees e >>INNER JOIN assets a ON e.employeeID = a.employeeID >>INNER JOIN assetcategories c ON a.assetcategoryID = c.assetcategoryID >>ORDER BY eName >> >> >> >> >> Name >>Asset >>Category >> >> >> >> >> #qEmpAssets.eName# >> >> #qEmpAssets.aTitle# >> #qEmpAssets.cCategory# >> >> >> >> >> >> >> >> >> >> - Original Message - >> From: "Dave Watts" >> To: "cf-talk" >> Sent: Thursday, March 19, 2009 2:23 PM >> Subject: Re: Eliminating repeated data in CFoutput field >> >> >> > >> >> Thanks for the tip about Grouping >> >> >> >> Sadly, it would remove the eName column, when I just want it blank. >> >> ( ie. output shifts left one column ) >> > >> > No, it needn't do that, and grouping is really the correct way to >> > solve this problem. You can find an example here: >> > >> > >> http://www.adobe.com/education/instruction/teach/coldfusion/CF8-2_advanced_cf8_development_unit3.pdf >> > >> > Dave Watts, CTO, Fig Leaf Software >> > http://www.figleaf.com/ >> > >> > Fig Leaf Software provides the highest caliber vendor-authorized >> > instruction at our training centers in Washington DC, Atlanta, >> > Chicago, Baltimore, Northern Virginia, or on-site at your location. >> > Visit http://training.figleaf.com/ for more informatio >> > >> > >> >> > > ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:320723 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Eliminating repeated data in CFoutput field
You should be able to do this but I haven't tried it. Name Asset Category #qEmpAssets.eName# #qEmpAssets.aTitle# #qEmpAssets.cCategory# On Thu, Mar 19, 2009 at 1:45 PM, BobSharp wrote: > > Tried it several ways, yet to get it to work as I want it. > http://ttcfm.open.ac.uk/~bs3578/test1/abEmpAssets_02.cfm<http://ttcfm.open.ac.uk/%7Ebs3578/test1/abEmpAssets_02.cfm> > > Must be the postion of the , in relation to the table cells. > > > >SELECT concat(e.firstname, ' ', e.lastname) AS eName, >LEFT(a.assetdescription,30) AS aTitle, >c.assetcategory AS cCategory >FROM employees e >INNER JOIN assets a ON e.employeeID = a.employeeID >INNER JOIN assetcategories c ON a.assetcategoryID = c.assetcategoryID >ORDER BY eName > > > > > Name >Asset >Category > > > > > #qEmpAssets.eName# > > #qEmpAssets.aTitle# > #qEmpAssets.cCategory# > > > > > > > > > > - Original Message - > From: "Dave Watts" > To: "cf-talk" > Sent: Thursday, March 19, 2009 2:23 PM > Subject: Re: Eliminating repeated data in CFoutput field > > > > > >> Thanks for the tip about Grouping > >> > >> Sadly, it would remove the eName column, when I just want it blank. > >> ( ie. output shifts left one column ) > > > > No, it needn't do that, and grouping is really the correct way to > > solve this problem. You can find an example here: > > > > > http://www.adobe.com/education/instruction/teach/coldfusion/CF8-2_advanced_cf8_development_unit3.pdf > > > > Dave Watts, CTO, Fig Leaf Software > > http://www.figleaf.com/ > > > > Fig Leaf Software provides the highest caliber vendor-authorized > > instruction at our training centers in Washington DC, Atlanta, > > Chicago, Baltimore, Northern Virginia, or on-site at your location. > > Visit http://training.figleaf.com/ for more informatio > > > > > > ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:320714 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Eliminating repeated data in CFoutput field
Tried it several ways, yet to get it to work as I want it. http://ttcfm.open.ac.uk/~bs3578/test1/abEmpAssets_02.cfm Must be the postion of the , in relation to the table cells. SELECT concat(e.firstname, ' ', e.lastname) AS eName, LEFT(a.assetdescription,30) AS aTitle, c.assetcategory AS cCategory FROM employees e INNER JOIN assets a ON e.employeeID = a.employeeID INNER JOIN assetcategories c ON a.assetcategoryID = c.assetcategoryID ORDER BY eName Name Asset Category #qEmpAssets.eName# #qEmpAssets.aTitle# #qEmpAssets.cCategory# - Original Message - From: "Dave Watts" To: "cf-talk" Sent: Thursday, March 19, 2009 2:23 PM Subject: Re: Eliminating repeated data in CFoutput field > >> Thanks for the tip about Grouping >> >> Sadly, it would remove the eName column, when I just want it blank. >> ( ie. output shifts left one column ) > > No, it needn't do that, and grouping is really the correct way to > solve this problem. You can find an example here: > > http://www.adobe.com/education/instruction/teach/coldfusion/CF8-2_advanced_cf8_development_unit3.pdf > > Dave Watts, CTO, Fig Leaf Software > http://www.figleaf.com/ > > Fig Leaf Software provides the highest caliber vendor-authorized > instruction at our training centers in Washington DC, Atlanta, > Chicago, Baltimore, Northern Virginia, or on-site at your location. > Visit http://training.figleaf.com/ for more informatio > > ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:320711 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Eliminating repeated data in CFoutput field
> Thanks for the tip about Grouping > > Sadly, it would remove the eName column, when I just want it blank. > ( ie. output shifts left one column ) No, it needn't do that, and grouping is really the correct way to solve this problem. You can find an example here: http://www.adobe.com/education/instruction/teach/coldfusion/CF8-2_advanced_cf8_development_unit3.pdf Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ Fig Leaf Software provides the highest caliber vendor-authorized instruction at our training centers in Washington DC, Atlanta, Chicago, Baltimore, Northern Virginia, or on-site at your location. Visit http://training.figleaf.com/ for more informatio ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:320694 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Eliminating repeated data in CFoutput field
your current code, if you have posted it correctly, creates malformed html: since you have the opening tag outside of your query output but the closing inside of it, all your table rows after the first one are missing the opening tag (check the generated source of the page you posted a link to if you do not believe me). for a change, try this for a CFOUTPUT with GROUP attribute solution: ... Name Asset Category #qEmpAssets.eName# #aTitle# #cCategory# plus: your total cell widths only amount to 80% of table width... Azadi Saryev Sabai-dee.com http://www.sabai-dee.com/ Bob Sharp wrote: > Thanks guys, some useful tips that led me to this ... > http://ttcfm.open.ac.uk/~bs3578/test1/abEmpAssets.cfm > > ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:320687 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Eliminating repeated data in CFoutput field
Thanks guys, some useful tips that led me to this ... http://ttcfm.open.ac.uk/~bs3578/test1/abEmpAssets.cfm SELECT concat(e.firstname, ' ', e.lastname) AS eName, LEFT(a.assetdescription,30) AS aTitle, c.assetcategory AS cCategory FROM employees e INNER JOIN assets a ON e.employeeID = a.employeeID INNER JOIN assetcategories c ON a.assetcategoryID = c.assetcategoryID ORDER BY e.lastname Name Asset Category #qEmpAssets.eName# #aTitle# #cCategory# >from this output, I would like to eliminate repeated names > > eName aTitle cCategory >Doug Briggs HP Omni 510Notebook PC >Nick Heap IBM Netfinity Server Desktop PC >Nick Heap HP Omni 510Notebook PC >Nick Heap Motorola T60Mobile Phone >Audrey Ibbotson Toshiba Satelite XL Notebook PC >Karen Kear Viglen 733 Desktop PC >Karen Kear HP Omni 510 Notebook PC >Office Manager HP LaserJet XLLaser Printer >Office Manager Epson Phaser Laser Printer >Glyn Martin Toshiba Tecra 8000Notebook PC >Glyn Martin Nokia 7650 Mobile Phone Bluetooth > >I am trying to use a variable LastEmp and but the >output is just the same as the original. > >My script is ... > > > > Name Asset Category > > > > > > > > > #eName# > #aTitle# > #cCategory# > > > > > > >Am in anyway close to achieving it ? > > > >-- >I am using the free version of SPAMfighter. >We are a community of 6 million users fighting spam. >SPAMfighter has removed 12747 of my spam emails to date. >Get the free SPAMfighter here: http://www.spamfighter.com/len > >The Professional version does not have this message ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:320686 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Eliminating repeated data in CFoutput field
it won't if you code it properly. Azadi Saryev Sabai-dee.com http://www.sabai-dee.com/ BobSharp wrote: > Thanks for the tip about Grouping > > Sadly, it would remove the eName column, when I just want it blank. > ( ie. output shifts left one column ) > > > ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:320685 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Eliminating repeated data in CFoutput field
Thanks for the tip about Grouping Sadly, it would remove the eName column, when I just want it blank. ( ie. output shifts left one column ) - Original Message - From: "Adrian Lynch" To: "cf-talk" Sent: Wednesday, March 18, 2009 11:26 PM Subject: RE: Eliminating repeated data in CFoutput field > > Order your query by eName then do something like this: > > > #yourQuery.eName# > > #yourQuery.aTitle# > #yourQuery.cCategory# > > > > You'll need to tweak it to fit in your table layout mind. > > Adrian > >> -Original Message- >> From: BobSharp [mailto:bobsh...@ntlworld.com] >> Sent: 18 March 2009 22:45 >> To: cf-talk >> Subject: Eliminating repeated data in CFoutput field >> >> >> rom this output, I would like to eliminate repeated names >> >> eName aTitle cCategory >> Doug Briggs HP Omni 510Notebook PC >> Nick Heap IBM Netfinity Server Desktop PC >> Nick Heap HP Omni 510Notebook PC >> Nick Heap Motorola T60Mobile Phone >> Audrey Ibbotson Toshiba Satelite XL Notebook PC >> Karen Kear Viglen 733 Desktop PC >> Karen Kear HP Omni 510 Notebook PC >> Office Manager HP LaserJet XLLaser Printer >> Office Manager Epson Phaser Laser Printer >> Glyn Martin Toshiba Tecra 8000Notebook PC >> Glyn Martin Nokia 7650 Mobile Phone >> Bluetooth >> >> I am trying to use a variable LastEmp and but the >> output is just the same as the original. >> >> My script is ... >> >> >> >> Name Asset Category >> >> >> >> >> >> >> >> >> #eName# >> #aTitle# >> #cCategory# >> >> >> >> >> >> >> Am in anyway close to achieving it ? > > > ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:320684 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: Eliminating repeated data in CFoutput field
This is not perfect (should really be using functions, for starters), but I think it will do what you want... SELECT DISTINCT eName FROM qEmpAssets Name Asset Category SELECT * FROM qEmpAssets WHERE eName = #eName# #aTitle# #cCategory# ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:320683 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Eliminating repeated data in CFoutput field
Hi Bob, That's not working because is just setting a empty variable named eName it's not updating the query variable eName. Since your in a cfoutput with a query attribute CF's going to look for a query variable that matches first. IIRC the order of lookup is query, arguments, local, cgi, url, form, cookie, client. I think this accomplishes what you are trying to do. Name Asset Category #variables.lastEmp# #aTitle# #cCategory# Since it appears you are sorting the query by the ename you could group output like so: #eName# - #aTitle# - #cCategory# Of course you'd have to customize the layout Nik On Wed, Mar 18, 2009 at 3:45 PM, BobSharp wrote: > > rom this output, I would like to eliminate repeated names > > eName aTitle cCategory > Doug Briggs HP Omni 510Notebook PC > Nick Heap IBM Netfinity Server Desktop PC > Nick Heap HP Omni 510Notebook PC > Nick Heap Motorola T60Mobile Phone > Audrey Ibbotson Toshiba Satelite XL Notebook PC > Karen Kear Viglen 733 Desktop PC > Karen Kear HP Omni 510 Notebook PC > Office Manager HP LaserJet XLLaser Printer > Office Manager Epson Phaser Laser Printer > Glyn Martin Toshiba Tecra 8000Notebook PC > Glyn Martin Nokia 7650 Mobile Phone Bluetooth > > I am trying to use a variable LastEmp and but the > output is just the same as the original. > > My script is ... > > > > Name Asset Category > > > > > > > > > #eName# > #aTitle# > #cCategory# > > > > > > > Am in anyway close to achieving it ? > > > > -- > I am using the free version of SPAMfighter. > We are a community of 6 million users fighting spam. > SPAMfighter has removed 12747 of my spam emails to date. > Get the free SPAMfighter here: http://www.spamfighter.com/len > > The Professional version does not have this message > > > ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:320681 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
RE: Eliminating repeated data in CFoutput field
Order your query by eName then do something like this: #yourQuery.eName# #yourQuery.aTitle# #yourQuery.cCategory# You'll need to tweak it to fit in your table layout mind. Adrian > -Original Message- > From: BobSharp [mailto:bobsh...@ntlworld.com] > Sent: 18 March 2009 22:45 > To: cf-talk > Subject: Eliminating repeated data in CFoutput field > > > rom this output, I would like to eliminate repeated names > > eName aTitle cCategory > Doug Briggs HP Omni 510Notebook PC > Nick Heap IBM Netfinity Server Desktop PC > Nick Heap HP Omni 510Notebook PC > Nick Heap Motorola T60Mobile Phone > Audrey Ibbotson Toshiba Satelite XL Notebook PC > Karen Kear Viglen 733 Desktop PC > Karen Kear HP Omni 510 Notebook PC > Office Manager HP LaserJet XLLaser Printer > Office Manager Epson Phaser Laser Printer > Glyn Martin Toshiba Tecra 8000Notebook PC > Glyn Martin Nokia 7650 Mobile Phone > Bluetooth > > I am trying to use a variable LastEmp and but the > output is just the same as the original. > > My script is ... > > > > Name Asset Category > > > > > > > > > #eName# > #aTitle# > #cCategory# > > > > > > > Am in anyway close to achieving it ? ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:320680 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Eliminating repeated data in CFoutput field
rom this output, I would like to eliminate repeated names eName aTitle cCategory Doug Briggs HP Omni 510Notebook PC Nick Heap IBM Netfinity Server Desktop PC Nick Heap HP Omni 510Notebook PC Nick Heap Motorola T60Mobile Phone Audrey Ibbotson Toshiba Satelite XL Notebook PC Karen Kear Viglen 733 Desktop PC Karen Kear HP Omni 510 Notebook PC Office Manager HP LaserJet XLLaser Printer Office Manager Epson Phaser Laser Printer Glyn Martin Toshiba Tecra 8000Notebook PC Glyn Martin Nokia 7650 Mobile Phone Bluetooth I am trying to use a variable LastEmp and but the output is just the same as the original. My script is ... Name Asset Category #eName# #aTitle# #cCategory# Am in anyway close to achieving it ? -- I am using the free version of SPAMfighter. We are a community of 6 million users fighting spam. SPAMfighter has removed 12747 of my spam emails to date. Get the free SPAMfighter here: http://www.spamfighter.com/len The Professional version does not have this message ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:320679 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: setting a var from Inside cfoutput group
Or, if you don't need to loop the output for any other reason, just do this once, without using CFOUTPUT at all: ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:319925 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: setting a var from Inside cfoutput group
Thanks Guys! worked like a charm! On Fri, Feb 27, 2009 at 12:18 PM, morgan l wrote: > > You're restarting the variable by setting it inside the output group. Try: > > > > > > > > On Fri, Feb 27, 2009 at 11:10 AM, Paul Ihrig wrote: > > > > > > > > > > > > > > > > ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:319921 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: setting a var from Inside cfoutput group
You're restarting the variable by setting it inside the output group. Try: On Fri, Feb 27, 2009 at 11:10 AM, Paul Ihrig wrote: > > > > > > ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:319918 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: setting a var from Inside cfoutput group
returns: myList: 6, myListX: 6,,6 #n1Id#, returns: 1,7,2,6, which is what i want, but as a carible i can call outside of the output. ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:319917 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: setting a var from Inside cfoutput group
Adrian > -Original Message- > From: Paul Ihrig [mailto:pih...@gmail.com] > Sent: 27 February 2009 16:58 > To: cf-talk > Subject: setting a var from Inside cfoutput group > > > #n1Id#, > > i need to set a variable as a list from the results above. > i tried putting a cfset inside the cfoutput, but it didn't work. > > some thing like > ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:319914 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
setting a var from Inside cfoutput group
#n1Id#, i need to set a variable as a list from the results above. i tried putting a cfset inside the cfoutput, but it didn't work. some thing like ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:319913 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: cfc/query/cfoutput question
> In my reading, I came upon an example similar to this: > > > > > ... > > > > Would it be possible to do this instead: > > > ... > Yes, I'm pretty sure it would work. That said, it might not work as efficiently. With some CF tags, evaluation might occur on every loop iteration, and so you'd call the getallusers method over and over unnecessarily. I don't know if this would be the case with CFOUTPUT, but you could test that. Also, creating another variable has very little cost, especially since queries are passed by reference. I'd probably just create the variable and leave it at that. Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ Fig Leaf Software provides the highest caliber vendor-authorized instruction at our training centers in Washington DC, Atlanta, Chicago, Baltimore, Northern Virginia, or on-site at your location. Visit http://training.figleaf.com/ for more information! ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:319101 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: cfc/query/cfoutput question
As long as IsQuery(object.getallusers()) returns "true." :-) On Mon, Feb 9, 2009 at 7:05 PM, Mike Soultanian wrote: > > So I'm reading this guide and it's really helpful! > > > http://www.iknowkungfoo.com/blog/index.cfm/2007/8/22/Object-Oriented-Coldfusion--1--Intro-to-Objectcfc > > In my reading, I came upon an example similar to this: > > > > > ... > > > > Would it be possible to do this instead: > > > ... > > > > It just seems like a neat way to avoid involving an extra variable if > you don't need it. Would it work? > > thanks! > Mike > > ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:319099 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
cfc/query/cfoutput question
So I'm reading this guide and it's really helpful! http://www.iknowkungfoo.com/blog/index.cfm/2007/8/22/Object-Oriented-Coldfusion--1--Intro-to-Objectcfc In my reading, I came upon an example similar to this: ... Would it be possible to do this instead: ... It just seems like a neat way to avoid involving an extra variable if you don't need it. Would it work? thanks! Mike ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:319097 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: Calling functions with cfoutput
Yeah...I find I can get tremendous leverage by creating "display methods"...such as if you have a Person object (cfc), you can have a method displayAsTableRow, displayAsDiv, displayFormDetail etc. You can really limit code repetition this way. -- Josh -Original Message- From: Dave Watts [mailto:dwa...@figleaf.com] Sent: Thursday, January 15, 2009 6:18 AM To: cf-talk Subject: Re: Calling functions with cfoutput > Custom tags, cfmodule and cfinclude all exist for good reason, they > are designed for modularising output. If you fully understand their > use, you most likely would not desire to use a function to modularise > your output though, of course, you are perfectly free to do so. > > While you are free to do what you will in any language, learning > established practice is far from trivial or ridiculous. Things are > usually done for good reason. It is a mistake to confuse conventions, no matter how common they are or how widely they're shared, with best practices. There is nothing inherently wrong with generating output from within a CFFUNCTION, and it has an OUTPUT attribute for exactly this reason. Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ Fig Leaf Software provides the highest caliber vendor-authorized instruction at our training centers in Washington DC, Atlanta, Chicago, Baltimore, Northern Virginia, or on-site at your location. Visit http://training.figleaf.com/ for more information! ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:317996 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Calling functions with cfoutput
No, there is nothing inheritently wrong with it (though there are articled reasons for not doing it: http://www.adobe.com/devnet/coldfusion/extreme/bforta_cfc.html). I don't think there are any good reasons for doing it over using modules/includes/custom tags either. But anyways, the OP seemed to be having trouble with a simple problem and the language used (ie. "not getting printed to the form") suggested that perhaps he had come from another coding language and was not aware of the other options, hence my hint. I may be wrong in those assumptions but being aware of standard practice is no irrelevent thing. Dominic ps. I am not confused with best practice / convention! :p 2009/1/15 Dave Watts : >> Custom tags, cfmodule and cfinclude all exist for good reason, they >> are designed for modularising output. If you fully understand their >> use, you most likely would not desire to use a function to modularise >> your output though, of course, you are perfectly free to do so. >> >> While you are free to do what you will in any language, learning >> established practice is far from trivial or ridiculous. Things are >> usually done for good reason. > > It is a mistake to confuse conventions, no matter how common they are > or how widely they're shared, with best practices. There is nothing > inherently wrong with generating output from within a CFFUNCTION, and > it has an OUTPUT attribute for exactly this reason. > > Dave Watts, CTO, Fig Leaf Software > http://www.figleaf.com/ > > Fig Leaf Software provides the highest caliber vendor-authorized > instruction at our training centers in Washington DC, Atlanta, > Chicago, Baltimore, Northern Virginia, or on-site at your location. > Visit http://training.figleaf.com/ for more information! > > ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:317995 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: Calling functions with cfoutput
> Custom tags, cfmodule and cfinclude all exist for good reason, they > are designed for modularising output. If you fully understand their > use, you most likely would not desire to use a function to modularise > your output though, of course, you are perfectly free to do so. > > While you are free to do what you will in any language, learning > established practice is far from trivial or ridiculous. Things are > usually done for good reason. It is a mistake to confuse conventions, no matter how common they are or how widely they're shared, with best practices. There is nothing inherently wrong with generating output from within a CFFUNCTION, and it has an OUTPUT attribute for exactly this reason. Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ Fig Leaf Software provides the highest caliber vendor-authorized instruction at our training centers in Washington DC, Atlanta, Chicago, Baltimore, Northern Virginia, or on-site at your location. Visit http://training.figleaf.com/ for more information! ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:317993 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: Calling functions with cfoutput
Custom tags, cfmodule and cfinclude all exist for good reason, they are designed for modularising output. If you fully understand their use, you most likely would not desire to use a function to modularise your output though, of course, you are perfectly free to do so. While you are free to do what you will in any language, learning established practice is far from trivial or ridiculous. Things are usually done for good reason. Dominic 2009/1/15 Gaulin, Mark : > I just have to comment... Saying that "using a function to output isn't > really the done thing in CF" is ridiculous... The CF language has many > features and, used appropriately, they can all be used for just about > anything in a safe, consistent, and understandable way. Good designs do > not have to be constrained by trivially simply rules like that one. > > That said, good designs also follow guides such as using naming > conventions, encapsulation, separation of concerns, use of inheritance > where appropriate, etc. These are the practices that people should > strive to improve. > > Thanks >Mark > > -Original Message- > From: Dominic Watson [mailto:watson.domi...@googlemail.com] > Sent: Wednesday, January 14, 2009 5:50 PM > To: cf-talk > Subject: Re: Calling functions with cfoutput > > Using a function to output isn't really the done thing in CF. Use either > a custom tag, module include or plain cfinclude to modularise your > output logic. If the function performs some action on a string and you > want it output, you should do something like: > > > . > > > > > . > #myFunction()# > > > HTH > > Dominic > > 2009/1/14 Gerald Guido : >> Is it getting rendered out side the cfform? >> >> >> On Wed, Jan 14, 2009 at 12:16 PM, Damayanti Gupta > wrote: >> >>> I have a cfform. From this I call a function, which has cfoutput tags > >>> to output text. However this text is not getting printed to the form. > >>> Is this expected? Is there a way around this? >>> Thanks >>> NG >>> >>> e.g. >>> >>> >>> This is a form >>> >>> >>> >>> >>> This is data to be printed >>> >>> STATEMENT OF CONFIDENTIALITY: >>> The information contained in this electronic message and any >>> attachments to this message are intended for the exclusive use of the > >>> addressee(s) and may contain confidential or privileged information. >>> If you are not the intended recipient, or the person responsible for >>> delivering the e-mail to the intended recipient, be advised you have >>> received this message in error and that any use, dissemination, >>> forwarding, printing, or copying is strictly prohibited. Please >>> notify Archemix Corp. immediately at either (617) 621-7700 or by >>> return fax at (617) 621-9300 and destroy all copies of this message > and any attachments. >>> >>> >>> >> >> > > > > ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:317992 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: Calling functions with cfoutput
I just have to comment... Saying that "using a function to output isn't really the done thing in CF" is ridiculous... The CF language has many features and, used appropriately, they can all be used for just about anything in a safe, consistent, and understandable way. Good designs do not have to be constrained by trivially simply rules like that one. That said, good designs also follow guides such as using naming conventions, encapsulation, separation of concerns, use of inheritance where appropriate, etc. These are the practices that people should strive to improve. Thanks Mark -Original Message- From: Dominic Watson [mailto:watson.domi...@googlemail.com] Sent: Wednesday, January 14, 2009 5:50 PM To: cf-talk Subject: Re: Calling functions with cfoutput Using a function to output isn't really the done thing in CF. Use either a custom tag, module include or plain cfinclude to modularise your output logic. If the function performs some action on a string and you want it output, you should do something like: . . #myFunction()# HTH Dominic 2009/1/14 Gerald Guido : > Is it getting rendered out side the cfform? > > > On Wed, Jan 14, 2009 at 12:16 PM, Damayanti Gupta wrote: > >> I have a cfform. From this I call a function, which has cfoutput tags >> to output text. However this text is not getting printed to the form. >> Is this expected? Is there a way around this? >> Thanks >> NG >> >> e.g. >> >> >> This is a form >> >> >> >> >> This is data to be printed >> >> STATEMENT OF CONFIDENTIALITY: >> The information contained in this electronic message and any >> attachments to this message are intended for the exclusive use of the >> addressee(s) and may contain confidential or privileged information. >> If you are not the intended recipient, or the person responsible for >> delivering the e-mail to the intended recipient, be advised you have >> received this message in error and that any use, dissemination, >> forwarding, printing, or copying is strictly prohibited. Please >> notify Archemix Corp. immediately at either (617) 621-7700 or by >> return fax at (617) 621-9300 and destroy all copies of this message and any attachments. >> >> >> > > ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:317990 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: Calling functions with cfoutput
Using a function to output isn't really the done thing in CF. Use either a custom tag, module include or plain cfinclude to modularise your output logic. If the function performs some action on a string and you want it output, you should do something like: #myFunction()# HTH Dominic 2009/1/14 Gerald Guido : > Is it getting rendered out side the cfform? > > > On Wed, Jan 14, 2009 at 12:16 PM, Damayanti Gupta wrote: > >> I have a cfform. From this I call a function, which has cfoutput tags to >> output text. However this text is not getting printed to the form. Is this >> expected? Is there a way around this? >> Thanks >> NG >> >> e.g. >> >> >> This is a form >> >> >> >> >> This is data to be printed >> >> >> STATEMENT OF CONFIDENTIALITY: >> The information contained in this electronic message and any attachments to >> this message are intended for the exclusive use of the addressee(s) and may >> contain confidential or privileged information. If you are not the intended >> recipient, or the person responsible for delivering the e-mail to the >> intended recipient, be advised you have received this message in error and >> that any use, dissemination, forwarding, printing, or copying is strictly >> prohibited. Please notify Archemix Corp. immediately at either (617) >> 621-7700 or by return fax at (617) 621-9300 and destroy all copies of this >> message and any attachments. >> >> >> > > ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:317963 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: Calling functions with cfoutput
Is it getting rendered out side the cfform? On Wed, Jan 14, 2009 at 12:16 PM, Damayanti Gupta wrote: > I have a cfform. From this I call a function, which has cfoutput tags to > output text. However this text is not getting printed to the form. Is this > expected? Is there a way around this? > Thanks > NG > > e.g. > > > This is a form > > > > > This is data to be printed > > > STATEMENT OF CONFIDENTIALITY: > The information contained in this electronic message and any attachments to > this message are intended for the exclusive use of the addressee(s) and may > contain confidential or privileged information. If you are not the intended > recipient, or the person responsible for delivering the e-mail to the > intended recipient, be advised you have received this message in error and > that any use, dissemination, forwarding, printing, or copying is strictly > prohibited. Please notify Archemix Corp. immediately at either (617) > 621-7700 or by return fax at (617) 621-9300 and destroy all copies of this > message and any attachments. > > > ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:317946 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Calling functions with cfoutput
You're not outputting it. You're setting it. this is a form. #doPrint()# On Wed, Jan 14, 2009 at 9:16 AM, Damayanti Gupta wrote: > I have a cfform. From this I call a function, which has cfoutput tags to > output text. However this text is not getting printed to the form. Is this > expected? Is there a way around this? > Thanks > NG > > e.g. > > > This is a form > > > > > This is data to be printed > > > STATEMENT OF CONFIDENTIALITY: > The information contained in this electronic message and any attachments to > this message are intended for the exclusive use of the addressee(s) and may > contain confidential or privileged information. If you are not the intended > recipient, or the person responsible for delivering the e-mail to the > intended recipient, be advised you have received this message in error and > that any use, dissemination, forwarding, printing, or copying is strictly > prohibited. Please notify Archemix Corp. immediately at either (617) > 621-7700 or by return fax at (617) 621-9300 and destroy all copies of this > message and any attachments. > > > ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:317943 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Calling functions with cfoutput
Try other way around: cfoutput in form: This is a form #doPrint()# This is data to be printed ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:317942 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Calling functions with cfoutput
I have a cfform. From this I call a function, which has cfoutput tags to output text. However this text is not getting printed to the form. Is this expected? Is there a way around this? Thanks NG e.g. This is a form This is data to be printed STATEMENT OF CONFIDENTIALITY: The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain confidential or privileged information. If you are not the intended recipient, or the person responsible for delivering the e-mail to the intended recipient, be advised you have received this message in error and that any use, dissemination, forwarding, printing, or copying is strictly prohibited. Please notify Archemix Corp. immediately at either (617) 621-7700 or by return fax at (617) 621-9300 and destroy all copies of this message and any attachments. ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:317941 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: cfoutput
I believe this is (and has been) true. put the conditional outside. #variables.i#, not found #variables.i#, #getShots.Filename#, #getShots.JID#, #getShots.status# On Tue, Jun 10, 2008 at 10:33 AM, Chad Gray <[EMAIL PROTECTED]> wrote: > If I use cfoutput with query="foo" and the queries record count is 0. The > CFoutput is not stepped into. > > Has this always been true? > > I have some code like this and noticed that I never returned the "NOT FOUND" > statement because if the recordcount is zero the cfoutput is skipped over. > > > > >#variables.i#, NOT FOUND > >#variables.i#,#getShots.Filename#,#getShots.JID#,#getShots.status# /> > > > > > > > ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;192386516;25150098;k Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:307190 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
cfoutput
If I use cfoutput with query="foo" and the queries record count is 0. The CFoutput is not stepped into. Has this always been true? I have some code like this and noticed that I never returned the "NOT FOUND" statement because if the recordcount is zero the cfoutput is skipped over. #variables.i#, NOT FOUND #variables.i#,#getShots.Filename#,#getShots.JID#,#getShots.status# ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;192386516;25150098;k Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:307186 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: cfoutput in a cfouput
BAH!!! Heh.. I caught myself thinking "Back during ColdFusion 5, I learned the hard way not to nest cfoutputs... These kids today have it easy". :) On Wed, May 28, 2008 at 9:07 AM, Rick Faircloth <[EMAIL PROTECTED]> wrote: > Hate to break it to you...but you've been in the "Geezer" category > for a couple of years now. :oP ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;192386516;25150098;k Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:306179 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: cfoutput in a cfouput
>> My god Have I officially passed into "Old Time ColdFusion Geezer" after 8 years? :) Ha! Look here sonny. Back in my day when we wanted to query a database we did it by rubbing two sticks together. ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;192386516;25150098;k Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:306178 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
RE: cfoutput in a cfouput
> Since when have we been able to nest cfoutputs? > > I have always thought that you could not do this. Maybe it > was a CF4.5/5.0 thing and in never learned it was possible in MX? > > I just tried this and it works in my CF8 installation: > > > #foo.id# > #foo.b# > > You have been able to nest CFOUTPUTs using the GROUP attribute since version 2, at least. You can now nest CFOUTPUTs generally since version 6, I believe. Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ Fig Leaf Software provides the highest caliber vendor-authorized instruction at our training centers in Washington DC, Atlanta, Chicago, Baltimore, Northern Virginia, or on-site at your location. Visit http://training.figleaf.com/ for more information! ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;192386516;25150098;k Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:306177 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: cfoutput in a cfouput
Hate to break it to you...but you've been in the "Geezer" category for a couple of years now. :oP Rick > -Original Message- > From: Phillip Vector [mailto:[EMAIL PROTECTED] > Sent: Wednesday, May 28, 2008 11:45 AM > To: CF-Talk > Subject: Re: cfoutput in a cfouput > > I guess to make things easier for those people just starting out... > > My god Have I officially passed into "Old Time ColdFusion Geezer" > after 8 years? :) > ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;192386516;25150098;k Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:306171 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: cfoutput in a cfouput
I guess to make things easier for those people just starting out... My god Have I officially passed into "Old Time ColdFusion Geezer" after 8 years? :) On Wed, May 28, 2008 at 8:41 AM, Charlie Griefer <[EMAIL PROTECTED]> wrote: > I can't imagine a scenario where you would. > > that's why i alluded to the fact that you can now do it (as of MX) as > being either a "feature" or a "bug" :) But the fact remains that > pre-MX it would throw an error, where post-MX it does not. ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;192386516;25150098;k Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:306165 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: cfoutput in a cfouput
I can't imagine a scenario where you would. that's why i alluded to the fact that you can now do it (as of MX) as being either a "feature" or a "bug" :) But the fact remains that pre-MX it would throw an error, where post-MX it does not. On Wed, May 28, 2008 at 8:37 AM, Rick Faircloth <[EMAIL PROTECTED]> wrote: > But why would you ever want to next cfoutput tags? > > Rick > >> -Original Message- >> From: Charlie Griefer [mailto:[EMAIL PROTECTED] >> Sent: Wednesday, May 28, 2008 10:55 AM >> To: CF-Talk >> Subject: Re: cfoutput in a cfouput >> >> you've always been able to nest cfoutputs within one another when the >> outer cfoutput made use of the "group" attribute. i'm pretty sure the >> docs have always, even back in the day, said something to the effect >> of "you cannot nest tags *unless the outermost tag used the >> group attribute*". >> >> as an aside... >> as of cfmx (i believe), it became possible to do >> #now()#. it's not something >> that i recall ever being announced as a "feature" ...or "bug"... it >> just started working. > > > > ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;192386516;25150098;k Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:306164 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
RE: cfoutput in a cfouput
But why would you ever want to next cfoutput tags? Rick > -Original Message- > From: Charlie Griefer [mailto:[EMAIL PROTECTED] > Sent: Wednesday, May 28, 2008 10:55 AM > To: CF-Talk > Subject: Re: cfoutput in a cfouput > > you've always been able to nest cfoutputs within one another when the > outer cfoutput made use of the "group" attribute. i'm pretty sure the > docs have always, even back in the day, said something to the effect > of "you cannot nest tags *unless the outermost tag used the > group attribute*". > > as an aside... > as of cfmx (i believe), it became possible to do > #now()#. it's not something > that i recall ever being announced as a "feature" ...or "bug"... it > just started working. ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;192386516;25150098;k Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:306160 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: cfoutput in a cfouput
On Wed, May 28, 2008 at 6:47 AM, Chad Gray <[EMAIL PROTECTED]> wrote: > Since when have we been able to nest cfoutputs? > > I have always thought that you could not do this. Maybe it was a CF4.5/5.0 > thing and in never learned it was possible in MX? > > I just tried this and it works in my CF8 installation: > > > #foo.id# > #foo.b# > > tags *unless the outermost tag used the group attribute*". as an aside... as of cfmx (i believe), it became possible to do #now()#. it's not something that i recall ever being announced as a "feature" ...or "bug"... it just started working. -- A byte walks into a bar and orders a pint. Bartender asks him "What's wrong?" Byte says "Parity error." Bartender nods and says "Yeah, I thought you looked a bit off." ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;192386516;25150098;k Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:306151 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: cfoutput in a cfouput
You've always been able to nest outputs when placed within a grouped output. -Original Message- From: Chad Gray [mailto:[EMAIL PROTECTED] Sent: Wednesday, May 28, 2008 8:48 AM To: CF-Talk Subject: cfoutput in a cfouput Since when have we been able to nest cfoutputs? I have always thought that you could not do this. Maybe it was a CF4.5/5.0 thing and in never learned it was possible in MX? I just tried this and it works in my CF8 installation: #foo.id# #foo.b# http://ad.doubleclick.net/clk;192386516;25150098;k Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:306148 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: cfoutput in a cfouput
Good morning Chad, Try it without the group attribute in the foo query output. Cheers, Mark Chad Gray wrote: > Since when have we been able to nest cfoutputs? > > I have always thought that you could not do this. Maybe it was a CF4.5/5.0 > thing and in never learned it was possible in MX? > > I just tried this and it works in my CF8 installation: > > > #foo.id# > #foo.b# > > > > ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;192386516;25150098;k Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:306146 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
cfoutput in a cfouput
Since when have we been able to nest cfoutputs? I have always thought that you could not do this. Maybe it was a CF4.5/5.0 thing and in never learned it was possible in MX? I just tried this and it works in my CF8 installation: #foo.id# #foo.b# http://ad.doubleclick.net/clk;192386516;25150098;k Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:306145 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: easy one! : comma separated list from cfoutput
Ian, Thank You! http://63.144.103.199/products/index.cfm?n1ID=5&n2ID=46&n3ID=148 cant really even to attempt to explain the db structure... never worked with arrays or structures. i do appreciate it.. On Tue, May 13, 2008 at 2:12 PM, Ian Skinner <[EMAIL PROTECTED]> wrote: > Paul Ihrig wrote: > > lets try this > > productTable > > pId, acList > > 1.3,5,7 > > 2.2,3 > > > > accessoryTable > > aID, Products > > 2.1,2,3 > > 3.3,4 > > 5.2 > > 7.12,15, et.. > > > > the user basically selects aa aid from the accessories table > > in the form of a check box. > > and ascociates as many id's containg producta [which are accesories] to > what > > ever real product he wants.. > > > Normalized Database Design Best Pratice > ProductTable-Accessory Join > Product ID > AccessoryID > > 1 3 > 1 5 > 1 7 > 2 2 > 2 3 > > AccessoryTable_Product Join > 2 1 > 2 2 > 2 3 > 3 3 > 3 4 > 5 2 > 7 12 > 7 15 > > Are these some type of recipical thing? Are are these two different > relationships? > > > this really does seem to work quite well. > > > For now. But if you have to maintain and enhance this application it > will bite you in the behind someday. There is a very good reason that > 50 years of database design has been working this way and I don't see it > changing any time soon. > > > i was just trying to look through all the stabndard functions out there > to > > remove duplicates. > > listToArray throws me a error converting simple something to > something... > > Don't for an array it is not going to get you the consilidation you > want. Just create a structure, loop over the valueList() result > creating a node for each value then extrat the list. Structures can > not have key duplicates they will get consilidated into one key. > > > > > > #structKeyList(something)# > > ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;192386516;25150098;k Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:305199 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: easy one! : comma separated list from cfoutput
Paul Ihrig wrote: > lets try this > productTable > pId, acList > 1.3,5,7 > 2.2,3 > > accessoryTable > aID, Products > 2.1,2,3 > 3.3,4 > 5.2 > 7.12,15, et.. > > the user basically selects aa aid from the accessories table > in the form of a check box. > and ascociates as many id's containg producta [which are accesories] to what > ever real product he wants.. > Normalized Database Design Best Pratice ProductTable-Accessory Join Product ID AccessoryID 1 3 1 5 1 7 2 2 2 3 AccessoryTable_Product Join 2 1 2 2 2 3 3 3 3 4 5 2 7 12 7 15 Are these some type of recipical thing? Are are these two different relationships? > this really does seem to work quite well. > For now. But if you have to maintain and enhance this application it will bite you in the behind someday. There is a very good reason that 50 years of database design has been working this way and I don't see it changing any time soon. > i was just trying to look through all the stabndard functions out there to > remove duplicates. > listToArray throws me a error converting simple something to something... Don't for an array it is not going to get you the consilidation you want. Just create a structure, loop over the valueList() result creating a node for each value then extrat the list. Structures can not have key duplicates they will get consilidated into one key. #structKeyList(something)# ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;192386516;25150098;k Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:305197 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: easy one! : comma separated list from cfoutput
lets try this productTable pId, acList 1.3,5,7 2.2,3 accessoryTable aID, Products 2.1,2,3 3.3,4 5.2 7.12,15, et.. the user basically selects aa aid from the accessories table in the form of a check box. and ascociates as many id's containg producta [which are accesories] to what ever real product he wants.. this really does seem to work quite well. all my code seems fine now. thanks to that valueList thing... i was just trying to clean up the result sets... WHERE aId IN (#accList#) works... accList: #ListSort(accList, "Numeric")# shows accList: 132,132,135,135,136,136,136,136 i was just trying to look through all the stabndard functions out there to remove duplicates. listToArray throws me a error converting simple something to something... ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;192386516;25150098;k Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:305194 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: easy one! : comma separated list from cfoutput
Paul Ihrig wrote: > ian, that is exactly what i am doing. > but i am storing a list inside a column to refer to user created groupings > of items. Ok, this would be fairly easy to normalize with a join table. user_grouping -- userID groupID Then you would have records something like iskinner 135 jblow132 pIhrig135 pIhrig132 Your query would then work exactly as you want it to. Without the modification to your database you are not going to be able to get these results. You are going to have to finish the processing in your CFML. One of the easiest ways would be to convert the valueList() resutls to a structure which would consolidate all duplicates then retrieve the list again with structKeyList(). But if you have a choice, normalizing your database is much more flexible and scalable. ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;192386516;25150098;k Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:305192 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: easy one! : comma separated list from cfoutput
If that's what you're doing then why not have a user_groupings relational table that holds the user_id and group_id? On Tue, May 13, 2008 at 12:11 PM, Paul Ihrig <[EMAIL PROTECTED]> wrote: > ian, that is exactly what i am doing. > but i am storing a list inside a column to refer to user created groupings > of items. > > > > ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;192386516;25150098;k Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:305191 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: easy one! : comma separated list from cfoutput
In that case you would probably either have to move the values to a look up table (normalize) or uses a function to tease out the dupes. G On Tue, May 13, 2008 at 1:11 PM, Paul Ihrig <[EMAIL PROTECTED]> wrote: > ian, that is exactly what i am doing. > but i am storing a list inside a column to refer to user created groupings > of items. > > > ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;192386516;25150098;k Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:305189 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: easy one! : comma separated list from cfoutput
ian, that is exactly what i am doing. but i am storing a list inside a column to refer to user created groupings of items. ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;192386516;25150098;k Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:305187 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: easy one! : comma separated list from cfoutput
Paul Ihrig wrote: > ORDER BY ascList > > that still gives me > ascList > 132 > 135 > 135,132 It looks to me like you have a de-normalized database scheme there that stores a list of values in a column. If that case then that is the result you are going to get. '132', '135' and '135,132' are three distinct and separate values. If this is the case then you are not going to get a SQL solution. You will need to do something in ColdFusion after the fact. Or better yet, if you can, normalize your database so that you are not storing lists of values in a column. ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;192386516;25150098;k Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:305184 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: easy one! : comma separated list from cfoutput
ORDER BY ascList that still gives me ascList 132 135 135,132 On Tue, May 13, 2008 at 12:37 PM, Robert Harrison < [EMAIL PROTECTED]> wrote: > Order by ascList... that should get DISTINCT to work. > > > > SELECT DISTINCT ascList > FROM dbo.list > WHERE (specs_partnum IN (#columns#)) AND (ascList IS NOT NULL) > ORDER BY ascList > > > Robert B. Harrison > Director of Interactive services > Austin & Williams > 125 Kennedy Drive, Suite 100 Hauppauge NY 11788 > T : 631.231.6600 Ext. 119 > F : 631.434.7022 > www.austin-williams.com > > Great advertising can't be either/or... It must be &. > > > > ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;192386516;25150098;k Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:305182 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: easy one! : comma separated list from cfoutput
Order by ascList... that should get DISTINCT to work. SELECT DISTINCT ascList FROM dbo.list WHERE (specs_partnum IN (#columns#)) AND (ascList IS NOT NULL) ORDER BY ascList Robert B. Harrison Director of Interactive services Austin & Williams 125 Kennedy Drive, Suite 100 Hauppauge NY 11788 T : 631.231.6600 Ext. 119 F : 631.434.7022 www.austin-williams.com Great advertising can't be either/or... It must be &. ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;192386516;25150098;k Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:305181 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
RE: easy one! : comma separated list from cfoutput
Try this: http://www.bennadel.com/blog/432-Using-ColdFusion-Structures-To-Remove-D uplicate-List-Values.htm m!ke -Original Message- From: morchella [mailto:[EMAIL PROTECTED] Sent: Tuesday, May 13, 2008 11:08 AM To: CF-Talk Subject: Re: easy one! : comma separated list from cfoutput right but my result of the query could be 134 135 135, 134 134, 135, 2 so the result is distinct. so when it puts them into a list i get 134, 135, 135, 134, 134, 135, 2 i am going to to try to look at list to array? and then back to list? ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;192386516;25150098;k Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:305177 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: easy one! : comma separated list from cfoutput
right but my result of the query could be 134 135 135, 134 134, 135, 2 so the result is distinct. so when it puts them into a list i get 134, 135, 135, 134, 134, 135, 2 i am going to to try to look at list to array? and then back to list? On Tue, May 13, 2008 at 11:57 AM, Andy Matthews <[EMAIL PROTECTED]> wrote: > If you're doing a distinct in your query, or a group by, then you > shouldn't > have any dupes. > > -Original Message- > From: morchella [mailto:[EMAIL PROTECTED] > Sent: Tuesday, May 13, 2008 10:47 AM > To: CF-Talk > Subject: Re: easy one! : comma separated list from cfoutput > > awsome... > thank you! > > now.. =] > how would i remove doubles? > > name="getAccessory" datasource="listit"> SELECT DISTINCT ascList FROM > dbo.list WHERE (specs_partnum IN (#columns#)) AND (ascList IS NOT NULL) > > > gives me... > > ascList > 132 > 135 > 135,132 > > so my list looks like > aclist: 132,135,135,132 > > just want 132,135 > > thanks again! > > > > > ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;192386516;25150098;k Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:305175 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: easy one! : comma separated list from cfoutput
Wait... I cant remember if I wrote those or not. I have a library of list functions... Some I wrote, some I got offa CFlib. Don;t want to take credit for someone else's work. G On Tue, May 13, 2008 at 12:04 PM, Gerald Guido <[EMAIL PROTECTED]> wrote: > You can do it using a QoQ and Select DISTINCT > > OR > > I wrote a couple of functions to do this. One day I will post them to > CFLib. > > /** > * Case-sensitive function for removing duplicate entries in a list. > * @param list The list to be modified. > * @return Returns a list. > */ > function ListDeleteDuplicates(list) { > var i = 1; > var delimiter = ','; > var returnValue = ''; > if(ArrayLen(arguments) GTE 2) > delimiter = arguments[2]; > list = ListToArray(list, delimiter); > for(i = 1; i LTE ArrayLen(list); i = i + 1) > if(NOT ListFind(returnValue, list[i], delimiter)) > returnValue = ListAppend(returnValue, list[i], delimiter); > > return returnValue; > } > > > /** > * Case-INsensitive function for removing duplicate entries in a list. > * @param list List to be modified. > * @return Returns a list. > */ > function ListDeleteDuplicatesNoCase(list) > { > var i = 1; > var delimiter = ','; > var returnValue = ''; > if(ArrayLen(arguments) GTE 2) > delimiter = arguments[2]; > list = ListToArray(list, delimiter); > for(i = 1; i LTE ArrayLen(list); i = i + 1) > if(NOT ListFindNoCase(returnValue, list[i], delimiter)) > returnValue = ListAppend(returnValue, list[i], delimiter); > return returnValue; > > } > > > On Tue, May 13, 2008 at 11:46 AM, morchella <[EMAIL PROTECTED]> > wrote: > > > awsome... > > thank you! > > > > now.. =] > > how would i remove doubles? > > > > > > > > SELECT DISTINCT ascList > > FROM dbo.list > > WHERE (specs_partnum IN (#columns#)) AND (ascList IS NOT NULL) > > > > > > gives me... > > > > ascList > > 132 > > 135 > > 135,132 > > > > so my list looks like > > aclist: 132,135,135,132 > > > > just want 132,135 > > > > thanks again! > > > > > > ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;192386516;25150098;k Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:305174 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: easy one! : comma separated list from cfoutput
You can do it using a QoQ and Select DISTINCT OR I wrote a couple of functions to do this. One day I will post them to CFLib. /** * Case-sensitive function for removing duplicate entries in a list. * @param list The list to be modified. * @return Returns a list. */ function ListDeleteDuplicates(list) { var i = 1; var delimiter = ','; var returnValue = ''; if(ArrayLen(arguments) GTE 2) delimiter = arguments[2]; list = ListToArray(list, delimiter); for(i = 1; i LTE ArrayLen(list); i = i + 1) if(NOT ListFind(returnValue, list[i], delimiter)) returnValue = ListAppend(returnValue, list[i], delimiter); return returnValue; } /** * Case-INsensitive function for removing duplicate entries in a list. * @param list List to be modified. * @return Returns a list. */ function ListDeleteDuplicatesNoCase(list) { var i = 1; var delimiter = ','; var returnValue = ''; if(ArrayLen(arguments) GTE 2) delimiter = arguments[2]; list = ListToArray(list, delimiter); for(i = 1; i LTE ArrayLen(list); i = i + 1) if(NOT ListFindNoCase(returnValue, list[i], delimiter)) returnValue = ListAppend(returnValue, list[i], delimiter); return returnValue; } On Tue, May 13, 2008 at 11:46 AM, morchella <[EMAIL PROTECTED]> wrote: > awsome... > thank you! > > now.. =] > how would i remove doubles? > > > > SELECT DISTINCT ascList > FROM dbo.list > WHERE (specs_partnum IN (#columns#)) AND (ascList IS NOT NULL) > > > gives me... > > ascList > 132 > 135 > 135,132 > > so my list looks like > aclist: 132,135,135,132 > > just want 132,135 > > thanks again! > > > ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;192386516;25150098;k Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:305173 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: easy one! : comma separated list from cfoutput
If you're doing a distinct in your query, or a group by, then you shouldn't have any dupes. -Original Message- From: morchella [mailto:[EMAIL PROTECTED] Sent: Tuesday, May 13, 2008 10:47 AM To: CF-Talk Subject: Re: easy one! : comma separated list from cfoutput awsome... thank you! now.. =] how would i remove doubles? SELECT DISTINCT ascList FROM dbo.list WHERE (specs_partnum IN (#columns#)) AND (ascList IS NOT NULL) gives me... ascList 132 135 135,132 so my list looks like aclist: 132,135,135,132 just want 132,135 thanks again! ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;192386516;25150098;k Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:305172 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: easy one! : comma separated list from cfoutput
also why is it not listed in my wack books under functions? also where did functions go in the 8 series of wack books.. i know its there in 4.5-7... On Tue, May 13, 2008 at 11:46 AM, morchella <[EMAIL PROTECTED]> wrote: > awsome... > thank you! > > now.. =] > how would i remove doubles? > > > > SELECT DISTINCT ascList > FROM dbo.list > WHERE (specs_partnum IN (#columns#)) AND (ascList IS NOT NULL) > > > gives me... > > ascList > 132 > 135 > 135,132 > > so my list looks like > aclist: 132,135,135,132 > > just want 132,135 > > thanks again! > > > ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;192386516;25150098;k Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:305170 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: easy one! : comma separated list from cfoutput
awsome... thank you! now.. =] how would i remove doubles? SELECT DISTINCT ascList FROM dbo.list WHERE (specs_partnum IN (#columns#)) AND (ascList IS NOT NULL) gives me... ascList 132 135 135,132 so my list looks like aclist: 132,135,135,132 just want 132,135 thanks again! ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;192386516;25150098;k Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:305168 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: easy one! : comma separated list from cfoutput
morchella wrote: > ok. i am having a serious brain fart... > i know there is a beter way to ooutput a list the is comma seperated then > this.. > > > > > > > > > #columns# > > but again, i am drawing a complete blank... > any help would be appreciated > thanks! valueList(getProd,'specs_partnum') OR quotedValueList(getProd,'specs_partnum') ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;192386516;25150098;k Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:305167 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: easy one! : comma separated list from cfoutput
ValueList(getProd.specs_partnum, ",") G On Tue, May 13, 2008 at 11:26 AM, morchella <[EMAIL PROTECTED]> wrote: > ok. i am having a serious brain fart... > i know there is a beter way to ooutput a list the is comma seperated then > this.. > > > > > > > > > #columns# > > but again, i am drawing a complete blank... > any help would be appreciated > thanks! > > > ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;192386516;25150098;k Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:305166 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: easy one! : comma separated list from cfoutput
#valueList(getProd.specs_partnum)# -Joe On Tue, May 13, 2008 at 11:26 AM, morchella <[EMAIL PROTECTED]> wrote: > ok. i am having a serious brain fart... > i know there is a beter way to ooutput a list the is comma seperated then > this.. > > > > > > > > > #columns# > > but again, i am drawing a complete blank... > any help would be appreciated > thanks! > > > ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;192386516;25150098;k Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:305165 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4