Strange Thing - CFOUTPUT converting quot; to

2013-04-30 Thread Robert Harrison

I have a field in a form with quoted values, but the values are quot;.   When 
I post it to another page and output it, something is changing the quot; to a 
real  (in the source, not the just the display). 

I put the following on the page to test...

cfdump var=#form.text#
cfoutput#form.text#/cfoutput
cfabort

When I do view source the 

value of the dump is -  quot;myvaule are quot;
the value of the output is  myvalue

What am I missing?  Why is  quot; 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: Strange Thing - CFOUTPUT converting quot; to

2013-04-30 Thread Robert Harrison

I can get around this by doing a replace of  to quot; and then it works as I 
need, but it seems stupid to have to do that when the value is actually quot; 
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 quot; to 


I have a field in a form with quoted values, but the values are quot;.   When 
I post it to another page and output it, something is changing the quot; to a 
real  (in the source, not the just the display). 

I put the following on the page to test...

cfdump var=#form.text#
cfoutput#form.text#/cfoutput
cfabort

When I do view source the 

value of the dump is -  quot;myvaule are quot;
the value of the output is  myvalue

What am I missing?  Why is  quot; 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


Short Question? CFOUTPUT converting quot; to

2013-04-30 Thread Robert Harrison

So, I found a work around, but does anyone know why these would give me 
different values?

cfdump var=#form.text#  
 ... the value is quot;mystringquot;
cfoutput#form.text#/cfoutput
   ... the value is mystring  

Why is CFOUTPUT converting the value quot; 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: Short Question? CFOUTPUT converting quot; to

2013-04-30 Thread Bryan Stevenson

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 cfdump var=mystring

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?

 cfdump var=#form.text#
... the value is quot;mystringquot;
 cfoutput#form.text#/cfoutput  
  ... the value is mystring

 Why is CFOUTPUT converting the value quot; 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


Re: Short Question? CFOUTPUT converting quot; to

2013-04-30 Thread Captain Obvious

If you view source for the cfoutput block you will find
quot;mystringquot; 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: Strange Thing - CFOUTPUT converting quot; to

2013-04-30 Thread UXB

The quot; is being rendered in the HTML engine of the browser as it should
be if you want to display it as quot; 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 quot; to 


I have a field in a form with quoted values, but the values are quot;.
When I post it to another page and output it, something is changing the
quot; to a real  (in the source, not the just the display). 

I put the following on the page to test...

cfdump var=#form.text#
cfoutput#form.text#/cfoutput
cfabort

When I do view source the 

value of the dump is -  quot;myvaule are quot;
the value of the output is  myvalue

What am I missing?  Why is  quot; 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 quot; to

2013-04-30 Thread UXB

 Why is CFOUTPUT converting the value quot; to   on its own?  

It's not.  quot; is the HTML command to display a quotation. When quot; 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 quot; to 


So, I found a work around, but does anyone know why these would give me
different values?

cfdump var=#form.text#
... the value is quot;mystringquot;
cfoutput#form.text#/cfoutput
... the value is mystring  

Why is CFOUTPUT converting the value quot; 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


cfoutput and

2012-11-05 Thread Rob Voyle

Hi folks

I need to output email addresses  enclosed in  as is  #email#

I am using cfoutput #name# #email# /cfoutput 
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 and

2012-11-05 Thread Matt Quackenbush

lt;#email#gt;


On Mon, Nov 5, 2012 at 12:17 PM, Rob Voyle robvo...@voyle.com wrote:


 Hi folks

 I need to output email addresses  enclosed in  as is  #email#

 I am using cfoutput #name# #email# /cfoutput
 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


Re: cfoutput and

2012-11-05 Thread Rob Voyle

Brilliant Matt
Thanks
Rob

On 5 Nov 2012 at 12:19, Matt Quackenbush wrote:

 
 lt;#email#gt;
 
 



~|
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 or cfloop? which is the more practical solution

2010-10-02 Thread GLM

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 g...@glmdesigns.com 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

2010-09-30 Thread Maureen

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 g...@glmdesigns.com 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

2010-09-27 Thread Russ Michaels

ok sorry I must have missed that in the original post.


On Mon, Sep 27, 2010 at 12:58 AM, Mike Chabot mcha...@gmail.com 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 r...@michaels.me.uk
 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 mcha...@gmail.com 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 r...@michaels.me.uk
  wrote:
  
   did the grouped cfoutpout not work for you then ?
  
   On Sun, Sep 26, 2010 at 4:55 AM, GLM g...@glmdesigns.com 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 g...@glmdesigns.com 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 g...@glmdesigns.com 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]
   
   
   
cfloop
   
   cfquery
   
   SELECT
   
   FROM
   
   WHERE year

Re: cfoutput or cfloop? which is the more practical solution

2010-09-27 Thread Dan G. Switzer, II

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 g...@glmdesigns.com 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 g...@glmdesigns.com 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

2010-09-26 Thread Russ Michaels

did the grouped cfoutpout not work for you then ?

On Sun, Sep 26, 2010 at 4:55 AM, GLM g...@glmdesigns.com 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 g...@glmdesigns.com 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 g...@glmdesigns.com 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]
 
 
 
  cfloop
 
 cfquery
 
 SELECT
 
 FROM
 
 WHERE year == #desiredYear#
 
 
 
 /cfquery
 
  /cfloop
 
 
 
  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

2010-09-26 Thread Mike Chabot

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 r...@michaels.me.uk wrote:

 did the grouped cfoutpout not work for you then ?

 On Sun, Sep 26, 2010 at 4:55 AM, GLM g...@glmdesigns.com 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 g...@glmdesigns.com 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 g...@glmdesigns.com 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]
 
 
 
  cfloop
 
                 cfquery
 
                                 SELECT
 
                                 FROM
 
                                 WHERE year == #desiredYear#
 
 
 
                 /cfquery
 
  /cfloop
 
 
 
  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

2010-09-26 Thread Mike Chabot

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 g...@glmdesigns.com 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

2010-09-26 Thread GLM

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 g...@glmdesigns.com 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

2010-09-26 Thread GLM

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 g...@glmdesigns.com 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

2010-09-26 Thread Russ Michaels

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 mcha...@gmail.com 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 r...@michaels.me.uk
 wrote:
 
  did the grouped cfoutpout not work for you then ?
 
  On Sun, Sep 26, 2010 at 4:55 AM, GLM g...@glmdesigns.com 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 g...@glmdesigns.com 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 g...@glmdesigns.com 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]
  
  
  
   cfloop
  
  cfquery
  
  SELECT
  
  FROM
  
  WHERE year == #desiredYear#
  
  
  
  /cfquery
  
   /cfloop
  
  
  
   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:337565
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http

Re: cfoutput or cfloop? which is the more practical solution

2010-09-26 Thread Mike Chabot

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 r...@michaels.me.uk 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 mcha...@gmail.com 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 r...@michaels.me.uk
 wrote:
 
  did the grouped cfoutpout not work for you then ?
 
  On Sun, Sep 26, 2010 at 4:55 AM, GLM g...@glmdesigns.com 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 g...@glmdesigns.com 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 g...@glmdesigns.com 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]
  
  
  
   cfloop
  
                  cfquery
  
                                  SELECT
  
                                  FROM
  
                                  WHERE year == #desiredYear#
  
  
  
                  /cfquery
  
   /cfloop
  
  
  
   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

Re: cfoutput or cfloop? which is the more practical solution

2010-09-26 Thread Mike Chabot

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 g...@glmdesigns.com 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

2010-09-26 Thread James Holmes

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 mcha...@gmail.com 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 r...@michaels.me.uk 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 mcha...@gmail.com 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 r...@michaels.me.uk
 wrote:
 
  did the grouped cfoutpout not work for you then ?
 
  On Sun, Sep 26, 2010 at 4:55 AM, GLM g...@glmdesigns.com 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 g...@glmdesigns.com 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 g...@glmdesigns.com 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]
  
  
  
   cfloop
  
                  cfquery
  
                                  SELECT
  
                                  FROM
  
                                  WHERE year == #desiredYear#
  
  
  
                  /cfquery
  
   /cfloop

RE: cfoutput or cfloop? which is the more practical solution

2010-09-26 Thread GLM

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 g...@glmdesigns.com 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

2010-09-25 Thread Mike Chabot

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 g...@glmdesigns.com 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 g...@glmdesigns.com 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]



 cfloop

                cfquery

                                SELECT

                                FROM

                                WHERE year == #desiredYear#



                /cfquery

 /cfloop



 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

2010-09-25 Thread GLM

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 g...@glmdesigns.com 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 g...@glmdesigns.com 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]



 cfloop

                cfquery

                                SELECT

                                FROM

                                WHERE year == #desiredYear#



                /cfquery

 /cfloop



 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


cfoutput or cfloop? which is the more practical solution

2010-09-24 Thread GLM

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]

 

cfloop

cfquery

SELECT

FROM

WHERE year == #desiredYear#



/cfquery

/cfloop

 

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 or cfloop? which is the more practical solution

2010-09-24 Thread Mike Chabot

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 g...@glmdesigns.com 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]



 cfloop

                cfquery

                                SELECT

                                FROM

                                WHERE year == #desiredYear#



                /cfquery

 /cfloop



 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


Re: cfoutput or cfloop? which is the more practical solution

2010-09-24 Thread Russ Michaels

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.

cfoutput query=myquery
   cfoutput  group=year
 your output here
   /cfoutput
/cfoutput



On Sat, Sep 25, 2010 at 12:23 AM, GLM g...@glmdesigns.com 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]



 cfloop

cfquery

SELECT

FROM

WHERE year == #desiredYear#



/cfquery

 /cfloop



 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

2010-09-24 Thread GLM

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 g...@glmdesigns.com 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]



 cfloop

                cfquery

                                SELECT

                                FROM

                                WHERE year == #desiredYear#



                /cfquery

 /cfloop



 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


cfoutput query within cfoutput query

2010-03-19 Thread brandon kennedy

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:

cfquery datasource=#dsn# name=person
  SELECT *
  FROM tblPerson
/cfquery
table
  cfoutput query=person
tr
  td#ID#/td
  td#name#/td
  cfquery datasource=#dsn# name=pets
SELECT *
FROM tblPets
WHERE ownerID = #person.ID#
  /cfquery
  cfoutput query=pets
td#pet#br/td
  /cfoutput
/tr
  /cfoutput
/table

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: cfoutput query within cfoutput query

2010-03-19 Thread Dan Baughman

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 laxtwenty...@gmail.comwrote:


 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:

 cfquery datasource=#dsn# name=person
  SELECT *
  FROM tblPerson
 /cfquery
 table
  cfoutput query=person
tr
  td#ID#/td
  td#name#/td
  cfquery datasource=#dsn# name=pets
SELECT *
FROM tblPets
WHERE ownerID = #person.ID#
  /cfquery
  cfoutput query=pets
td#pet#br/td
  /cfoutput
/tr
  /cfoutput
 /table

 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


Re: cfoutput query within cfoutput query

2010-03-19 Thread AJ Mercer

I think my first post failed :-(

SQL with JOIN
CFOUTPUT with group


cfquery datasource=#dsn# name=qryPetPerson
 SELECT tblPerson.id, tblPerson.name,
tblPets.pet
 FROM tblPerson, tblPets
 WHERE tblPets.ownerID = tblPerson.id
order by tblPerson.id
/cfquery
table
 cfoutput query=qryPetPerson group=id
   tr
 td#ID#/td
 td#name#/td

 cfoutput
   td#pet#br/td
 /cfoutput
   /tr
 /cfoutput
/table

On 20 March 2010 06:32, brandon kennedy laxtwenty...@gmail.com 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:

 cfquery datasource=#dsn# name=person
  SELECT *
  FROM tblPerson
 /cfquery
 table
  cfoutput query=person
tr
  td#ID#/td
  td#name#/td
  cfquery datasource=#dsn# name=pets
SELECT *
FROM tblPets
WHERE ownerID = #person.ID#
  /cfquery
  cfoutput query=pets
td#pet#br/td
  /cfoutput
/tr
  /cfoutput
 /table

 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


script.js file inside cfoutput

2009-07-10 Thread RamaDevi Dobbala

hi frnds,

i have a problem

like 
cfoutput
.
.
.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
.
.
.
/cfoutput


~|
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: script.js file inside cfoutput

2009-07-10 Thread Francois Levesque

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 cfoutput tags you
need to escape it like so:
This would throw an error:
cfoutput
a href=#anchorGo to this section/a
/cfoutput

This would not:
cfoutput
a href=##anchorGo to this section/a
/cfoutput

Francois Levesque
http://blog.critical-web.com/


On Fri, Jul 10, 2009 at 8:15 AM, RamaDevi Dobbala ramadobb...@gmail.comwrote:


 hi frnds,

 i have a problem

 like
 cfoutput
 .
 .
 .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
 .
 .
 .
 /cfoutput


 

~|
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


Re: Eliminating repeated data in CFoutput field

2009-03-19 Thread Azadi Saryev

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

2009-03-19 Thread Bob Sharp

Thanks  guys,   some useful tips that led me to this ...  
http://ttcfm.open.ac.uk/~bs3578/test1/abEmpAssets.cfm 

CFquery name=qEmpAssets datasource=bs3578  
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 
/CFquery 

table 
tr
th width=20% Name /th th width=30% Asset /th th 
width=30% Category /th
/tr
tr
 CFset LastEmp = *  
 CFoutput query=qEmpAssets  
   CFif  VARIABLES.LastEmp  IS NOT  trim(qEmpAssets.eName)  
 CFset VARIABLES.LastEmp = trim(qEmpAssets.eName) 
  
 CFelse  
 CFset  #qEmpAssets.eName# =   
   /CFif
   td  #qEmpAssets.eName#  /td 
   td  #aTitle#   /td 
   td  #cCategory#   /td
/tr
/CFoutput 
/table



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  CFif CFset   but the 
output is just the same as the original. 

My script is  ...  

table 
tr
th Name /th th Asset /th th Category /th
/tr
tr   
CFoutput query=qEmpAssets   
 CFif  VARIABLES.LastEmp IS eName  
CFset  eName = ' ' 
   CFelse  
CFset VARIABLES.LastEmp = eName 
/CFif
td  #eName#   /td 
td  #aTitle#   /td 
td  #cCategory#   /td   
/CFoutput   
/tr
/table



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

2009-03-19 Thread BobSharp

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 cont...@adrianlynch.co.uk
To: cf-talk cf-talk@houseoffusion.com
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:

 cfoutput query=yourQuery group=eName
 #yourQuery.eName#
 cfoutput
 #yourQuery.aTitle#
 #yourQuery.cCategory#
 /cfoutput
 /cfoutput

 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  CFif CFset   but the
 output is just the same as the original.

 My script is  ...

 table 
 tr
 th Name /th th Asset /th th Category /th
 /tr
 tr 
 CFoutput query=qEmpAssets 
  CFif  VARIABLES.LastEmp IS eName 
 CFset  eName = ' ' 
CFelse
 CFset VARIABLES.LastEmp = eName 
 /CFif
 td  #eName#   /td
 td  #aTitle#   /td
 td  #cCategory#   /td
 /CFoutput
 /tr
 /table



 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

2009-03-19 Thread Azadi Saryev

your current code, if you have posted it correctly, creates malformed
html: since you have the opening tr tag outside of your query output
but the closing /tr inside of it, all your table rows after the first
one are missing the opening tr 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:

CFquery name=qEmpAssets datasource=bs3578  
...
/CFquery
table
  tr
th width=20% Name /th th width=30% Asset /th th width=30% 
Category /th
  /tr
  CFoutput query=qEmpAssets group=eName
cfset lcount = 1
tr
  td #qEmpAssets.eName# /td
  cfoutput
cfif lcount gt 1/trtrtd /td/cfif
td #aTitle# /td
td #cCategory# /td
cfset lcount = lcount+1
  /cfoutput
/tr
  /CFoutput   
/table

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

2009-03-19 Thread Dave Watts

 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

2009-03-19 Thread BobSharp

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 CFoutput, in relation to the TD table cells. 


CFquery name=qEmpAssets datasource=bs3578  
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  
/CFquery 

table border=1 
tr
th width=20%  Name /th 
   th width=30%  Asset /th 
   th width=30%  Category /th
/tr
 
CFoutput query=qEmpAssets group=eName
tr   
td  #qEmpAssets.eName#  /td 
   CFoutput  
td   #qEmpAssets.aTitle#  /td  
td#qEmpAssets.cCategory#  /td   
   /CFoutput
/tr  
/CFoutput
/table





- Original Message - 
From: Dave Watts dwa...@figleaf.com
To: cf-talk cf-talk@houseoffusion.com
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

2009-03-19 Thread Nick G

You should be able to do this but I haven't tried it.

table border=1 
   tr
  th width=20%  Name /th
  th width=30%  Asset /th
th width=30%  Category /th
   /tr

   CFoutput query=qEmpAssets group=eName 
   tr 
   td  #qEmpAssets.eName#  /td

   td  CFoutput #qEmpAssets.aTitle# br //CFoutput /td
   td  cfoutput  #qEmpAssets.cCategory# br / /cfoutput/td

   /tr
   /CFoutput
/table



On Thu, Mar 19, 2009 at 1:45 PM, BobSharp bobsh...@ntlworld.com wrote:


 Tried it several ways,  yet to get it to work as I want it.
 http://ttcfm.open.ac.uk/~bs3578/test1/abEmpAssets_02.cfmhttp://ttcfm.open.ac.uk/%7Ebs3578/test1/abEmpAssets_02.cfm

 Must be the postion of the CFoutput, in relation to the TD table cells.


 CFquery name=qEmpAssets datasource=bs3578 
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
 /CFquery

 table border=1 
tr
th width=20%  Name /th
   th width=30%  Asset /th
   th width=30%  Category /th
/tr

CFoutput query=qEmpAssets group=eName 
tr 
td  #qEmpAssets.eName#  /td
   CFoutput 
td   #qEmpAssets.aTitle#  /td
td#qEmpAssets.cCategory#  /td
   /CFoutput
/tr
/CFoutput
 /table





 - Original Message -
 From: Dave Watts dwa...@figleaf.com
 To: cf-talk cf-talk@houseoffusion.com
 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

2009-03-19 Thread BobSharp

Yep ! That's it.

http://ttcfm.open.ac.uk/~bs3578/test1/abEmpAssets_02.cfm


Thanks



- Original Message - 
From: Nick G ngiova...@gmail.com
To: cf-talk cf-talk@houseoffusion.com
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.

 table border=1 
   tr
  th width=20%  Name /th
  th width=30%  Asset /th
th width=30%  Category /th
   /tr

   CFoutput query=qEmpAssets group=eName 
   tr 
   td  #qEmpAssets.eName#  /td

   td  CFoutput #qEmpAssets.aTitle# br //CFoutput /td
   td  cfoutput  #qEmpAssets.cCategory# br / /cfoutput/td

   /tr
   /CFoutput
 /table



 On Thu, Mar 19, 2009 at 1:45 PM, BobSharp bobsh...@ntlworld.com wrote:


 Tried it several ways,  yet to get it to work as I want it.
 http://ttcfm.open.ac.uk/~bs3578/test1/abEmpAssets_02.cfmhttp://ttcfm.open.ac.uk/%7Ebs3578/test1/abEmpAssets_02.cfm

 Must be the postion of the CFoutput, in relation to the TD table 
 cells.


 CFquery name=qEmpAssets datasource=bs3578 
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
 /CFquery

 table border=1 
tr
th width=20%  Name /th
   th width=30%  Asset /th
   th width=30%  Category /th
/tr

CFoutput query=qEmpAssets group=eName 
tr 
td  #qEmpAssets.eName#  /td
   CFoutput 
td   #qEmpAssets.aTitle#  /td
td#qEmpAssets.cCategory#  /td
   /CFoutput
/tr
/CFoutput
 /table





 - Original Message -
 From: Dave Watts dwa...@figleaf.com
 To: cf-talk cf-talk@houseoffusion.com
 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

2009-03-19 Thread Peter Boughton

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


Eliminating repeated data in CFoutput field

2009-03-18 Thread BobSharp

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  CFif CFset   but the 
output is just the same as the original. 

My script is  ...  

table 
tr
th Name /th th Asset /th th Category /th
/tr
tr   
CFoutput query=qEmpAssets   
 CFif  VARIABLES.LastEmp IS eName  
CFset  eName = ' ' 
   CFelse  
CFset VARIABLES.LastEmp = eName 
/CFif
td  #eName#   /td 
td  #aTitle#   /td 
td  #cCategory#   /td   
/CFoutput   
/tr
/table



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: Eliminating repeated data in CFoutput field

2009-03-18 Thread Adrian Lynch

Order your query by eName then do something like this:

cfoutput query=yourQuery group=eName
#yourQuery.eName#
cfoutput
#yourQuery.aTitle#
#yourQuery.cCategory#
/cfoutput
/cfoutput

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  CFif CFset   but the
 output is just the same as the original.
 
 My script is  ...
 
 table 
 tr
 th Name /th th Asset /th th Category /th
 /tr
 tr 
 CFoutput query=qEmpAssets 
  CFif  VARIABLES.LastEmp IS eName 
 CFset  eName = ' ' 
CFelse
 CFset VARIABLES.LastEmp = eName 
 /CFif
 td  #eName#   /td
 td  #aTitle#   /td
 td  #cCategory#   /td
 /CFoutput
 /tr
 /table
 
 
 
 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


Re: Eliminating repeated data in CFoutput field

2009-03-18 Thread Nick G

Hi Bob,

That's not working because cfset eName =  / 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.

table 
   tr
   th Name /th th Asset /th th Category /th
   /tr
   tr 
   cfset variables.lastEmp =  /
   CFoutput query=qEmpAssets 
cfif comparenocase(variables.lastEmp, trim(eName))
cfset variables.lastEmp = trim(eName) /
cfelse
cfset variables.lastEmp =  /
/cfif

   td  #variables.lastEmp#   /td
   td  #aTitle#   /td
   td  #cCategory#   /td
   /CFoutput
   /tr
/table


Since it appears you are sorting the query by the ename you could group
output like so:

 CFoutput query=qEmpAssets group=ename
#eName# br
cfoutput
 - #aTitle#
 - #cCategory#
/cfoutput
/CFoutput

Of course you'd have to customize the layout

Nik



On Wed, Mar 18, 2009 at 3:45 PM, BobSharp bobsh...@ntlworld.com 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  CFif CFset   but the
 output is just the same as the original.

 My script is  ...

 table 
tr
th Name /th th Asset /th th Category /th
/tr
tr 
CFoutput query=qEmpAssets 
 CFif  VARIABLES.LastEmp IS eName 
CFset  eName = ' ' 
   CFelse
CFset VARIABLES.LastEmp = eName 
/CFif
td  #eName#   /td
td  #aTitle#   /td
td  #cCategory#   /td
/CFoutput
/tr
 /table



 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

2009-03-18 Thread Peter Boughton

This is not perfect (should really be using functions, for starters), but I 
think it will do what you want...

cfquery name=qEmployees dbtype=Query
SELECT DISTINCT eName
FROM qEmpAssets
/cfquery

table
thead
tr
th Name /th
th Asset /th
th Category /th
/tr
/thead
tbody
cfloop query=qEmployees
cfquery name=qAssets dbtype=Query
SELECT *
FROM qEmpAssets
WHERE eName = cfqueryparam value=#eName#/
/cfquery
tr
td rowspan=#qAssets.RecordCount# #eName# /td
cfloop query=qAssets
cfif qAssets.CurrentRow NEQ 1
tr
/cfif
td #aTitle# /td
td #cCategory# /td
/tr
/cfloop
/cfloop
/tbody
/table


~|
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


setting a var from Inside cfoutput group

2009-02-27 Thread Paul Ihrig

cfoutput group=n1#n1Id#,/cfoutput

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
cfset myList = 7,4,9


~|
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: setting a var from Inside cfoutput group

2009-02-27 Thread Adrian Lynch

cfset myList = ListAppend(myList, ni.id)

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
 
 
 cfoutput group=n1#n1Id#,/cfoutput
 
 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
 cfset myList = 7,4,9


~|
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


Re: setting a var from Inside cfoutput group

2009-02-27 Thread Paul Ihrig

cfoutput group=n1
cfset myList = #n1Id#,
cfset myListx = ListAppend(myList, n1Id)
/cfoutput

returns:
myList: 6,
myListX: 6,,6

cfoutput group=n1#n1Id#,/cfoutput
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

2009-02-27 Thread morgan l

You're restarting the variable by setting it inside the output group. Try:

cfset myList = 

cfoutput group=n1
cfset myListx = ListAppend(myList, n1Id)
/cfoutput

On Fri, Feb 27, 2009 at 11:10 AM, Paul Ihrig pih...@gmail.com wrote:


 cfoutput group=n1
 cfset myList = #n1Id#,
 cfset myListx = ListAppend(myList, n1Id)
 /cfoutput



~|
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

2009-02-27 Thread Paul Ihrig

Thanks Guys!
worked like a charm!

On Fri, Feb 27, 2009 at 12:18 PM, morgan l greyk...@gmail.com wrote:


 You're restarting the variable by setting it inside the output group. Try:

 cfset myList = 

 cfoutput group=n1
 cfset myListx = ListAppend(myList, n1Id)
 /cfoutput

 On Fri, Feb 27, 2009 at 11:10 AM, Paul Ihrig pih...@gmail.com wrote:

 
  cfoutput group=n1
  cfset myList = #n1Id#,
  cfset myListx = ListAppend(myList, n1Id)
  /cfoutput
 


 

~|
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

2009-02-27 Thread Jason Fisher

Or, if you don't need to loop the output for any other reason, just do this 
once, without using CFOUTPUT at all:

cfset myList = valueList(n1.n1Id) / 

~|
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


cfc/query/cfoutput question

2009-02-09 Thread Mike Soultanian

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:

cfset qUsers = object.getallusers()

cfoutput query=qUsers
   ...
/cfoutput


Would it be possible to do this instead:

cfoutput query=object.getallusers()
   ...
/cfoutput


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: cfc/query/cfoutput question

2009-02-09 Thread John M Bliss

As long as IsQuery(object.getallusers()) returns true.  :-)

On Mon, Feb 9, 2009 at 7:05 PM, Mike Soultanian msoul...@csulb.edu 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:

 cfset qUsers = object.getallusers()

 cfoutput query=qUsers
   ...
 /cfoutput


 Would it be possible to do this instead:

 cfoutput query=object.getallusers()
   ...
 /cfoutput


 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


Re: cfc/query/cfoutput question

2009-02-09 Thread Dave Watts

 In my reading, I came upon an example similar to this:

 cfset qUsers = object.getallusers()

 cfoutput query=qUsers
   ...
 /cfoutput


 Would it be possible to do this instead:

 cfoutput query=object.getallusers()
   ...
 /cfoutput

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: Calling functions with cfoutput

2009-01-15 Thread 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:

cffunction name=myFunction...
.
  cfreturn String that has been modified... or something /
/cffunction

cfform...
.
cfoutput#myFunction()#/cfoutput
/cfform

HTH

Dominic

2009/1/14 Gerald Guido gerald.gu...@gmail.com:
 Is it getting rendered out side the cfform?


 On Wed, Jan 14, 2009 at 12:16 PM, Damayanti Gupta
dgu...@archemix.comwrote:

 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.

 cfform...
 This is a form
 cfset doPrint()
 /cfform

 cffunction name=doPrint...
 cfoutputThis is data to be printed/cfoutput /cffunction

 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

2009-01-15 Thread Dominic Watson
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 mgau...@globalspec.com:
 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:

 cffunction name=myFunction...
 .
  cfreturn String that has been modified... or something /
 /cffunction

 cfform...
 .
 cfoutput#myFunction()#/cfoutput
 /cfform

 HTH

 Dominic

 2009/1/14 Gerald Guido gerald.gu...@gmail.com:
 Is it getting rendered out side the cfform?


 On Wed, Jan 14, 2009 at 12:16 PM, Damayanti Gupta
 dgu...@archemix.comwrote:

 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.

 cfform...
 This is a form
 cfset doPrint()
 /cfform

 cffunction name=doPrint...
 cfoutputThis is data to be printed/cfoutput /cffunction

 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

2009-01-15 Thread 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: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

2009-01-15 Thread Dominic Watson
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 dwa...@figleaf.com:
 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

2009-01-15 Thread Josh Nathanson
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


Calling functions with cfoutput

2009-01-14 Thread Damayanti Gupta
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.

cfform...
This is a form
cfset doPrint()
/cfform

cffunction name=doPrint...
cfoutputThis is data to be printed/cfoutput
/cffunction

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: Calling functions with cfoutput

2009-01-14 Thread Jason Fisher
Try other way around: cfoutput in form:


cfform...
 This is a form
 cfoutput#doPrint()#/cfoutput
/cfform
 
cffunction name=doPrint...
 This is data to be printed
/cffunction


~|
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


Re: Calling functions with cfoutput

2009-01-14 Thread Charlie Griefer
You're not outputting it.  You're setting it.
cfform ...
 this is a form.
 cfoutput#doPrint()#/cfoutput
/cfform

On Wed, Jan 14, 2009 at 9:16 AM, Damayanti Gupta dgu...@archemix.comwrote:

 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.

 cfform...
 This is a form
 cfset doPrint()
 /cfform

 cffunction name=doPrint...
 cfoutputThis is data to be printed/cfoutput
 /cffunction

 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

2009-01-14 Thread Gerald Guido
Is it getting rendered out side the cfform?


On Wed, Jan 14, 2009 at 12:16 PM, Damayanti Gupta dgu...@archemix.comwrote:

 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.

 cfform...
 This is a form
 cfset doPrint()
 /cfform

 cffunction name=doPrint...
 cfoutputThis is data to be printed/cfoutput
 /cffunction

 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

2009-01-14 Thread Dominic Watson
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:

cffunction name=myFunction...

  cfreturn String that has been modified... or something /
/cffunction

cfform...

cfoutput#myFunction()#/cfoutput
/cfform

HTH

Dominic

2009/1/14 Gerald Guido gerald.gu...@gmail.com:
 Is it getting rendered out side the cfform?


 On Wed, Jan 14, 2009 at 12:16 PM, Damayanti Gupta dgu...@archemix.comwrote:

 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.

 cfform...
 This is a form
 cfset doPrint()
 /cfform

 cffunction name=doPrint...
 cfoutputThis is data to be printed/cfoutput
 /cffunction

 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


What's wrong with my cfoutput group?

2008-12-01 Thread Will Tomlinson
I don't recall ever having a problem with the cfoutput group attribute. But I 
can't figure out why it isn't woring right here. 

My table looks like this:

ID   Date  ZIP code
-
1   12/01/200827403
2   12/01/200890210
3   12/01/200845789
4   12/01/200827403
5   12/02/20085
6   12/02/200821454

A simple query:

cfquery name=getshipcalclog datasource=#APPLICATION.settings.dsn#
SELECT estshiplogid, estshiplogdate, estshippostalcode
FROM tblestshiplog
ORDER BY estshiplogdate DESC
/cfquery

Now, I just want to output the records grouped by the date. So there should be 
a date heading, and all the zip codes with records on  that date. 

cfoutput query=getshipcalclog group=estshiplogdate
 h3#estshiplogdate#/h3
  cfoutput
  p#estshippostalcode#/p
  /cfoutput
/cfoutput

But it outputs every occurence of 12/01/2008 and its zip. When it should 
display 12/01/2008 as a heading, then fours zips below it. Then start another 
heading 12/02/2008, and two zips below that.

What am I doin wrong here?

Thanks!
Will



~|
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:316091
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: What's wrong with my cfoutput group?

2008-12-01 Thread Will Tomlinson
Crap, it goes back to my stupid date/time datatype for the field. All the times 
are different, and CF IS group the data, but they're all different so it output 
each row. I used Michael's example from my other thread to do this. Seems to 
work:

SELECT estshiplogid,CAST(FLOOR(CAST(estshiplogdate AS float)) AS datetime) AS 
theDate, estshippostalcode
FROM tblestshiplog
ORDER BY estshiplogdate DESC

Then I just group using theDate.

Thanks,
Will 

~|
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:316092
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


cfoutput

2008-06-10 Thread Chad Gray
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.


cfoutput query=getShots
cfif getShots.recordcount EQ 0
#variables.i#, NOT FOUNDbr /
cfelse
#variables.i#,#getShots.Filename#,#getShots.JID#,#getShots.status#br /
/cfif
/cfoutput




~|
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

2008-06-10 Thread Charlie Griefer
I believe this is (and has been) true.

put the conditional outside.

cfif getshots.recordcount eq 0
 cfoutput#variables.i#, not found/cfoutput
cfelse
 cfoutput query=getShots
  #variables.i#, #getShots.Filename#, #getShots.JID#,
#getShots.status#br /
 /cfoutput
/cfif

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.


 cfoutput query=getShots
 cfif getShots.recordcount EQ 0
#variables.i#, NOT FOUNDbr /
 cfelse
#variables.i#,#getShots.Filename#,#getShots.JID#,#getShots.status#br 
 /
 /cfif
 /cfoutput




 

~|
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


Re: cfoutput in a cfouput

2008-05-28 Thread Mark Atkinson
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:

 cfoutput query=foo group=id
 #foo.id#br
 cfoutput#foo.b#br/cfoutput

 /cfoutput


 

~|
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

2008-05-28 Thread Chad Gray
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:

cfoutput query=foo group=id
#foo.id#br
cfoutput#foo.b#br/cfoutput

/cfoutput


~|
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: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: cfoutput in a cfouput

2008-05-28 Thread Andy Matthews
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:

cfoutput query=foo group=id
#foo.id#br
cfoutput#foo.b#br/cfoutput

/cfoutput




~|
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: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

2008-05-28 Thread Charlie Griefer
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:

 cfoutput query=foo group=id
 #foo.id#br
 cfoutput#foo.b#br/cfoutput

 /cfoutput

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 cfoutput tags *unless the outermost tag used the
group attribute*.

as an aside...
as of cfmx (i believe), it became possible to do
cfoutputcfoutput#now()#/cfoutput/cfoutput.  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

2008-05-28 Thread Rick Faircloth
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 cfoutput tags *unless the outermost tag used the
 group attribute*.
 
 as an aside...
 as of cfmx (i believe), it became possible to do
 cfoutputcfoutput#now()#/cfoutput/cfoutput.  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

2008-05-28 Thread Charlie Griefer
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 cfoutput tags *unless the outermost tag used the
 group attribute*.

 as an aside...
 as of cfmx (i believe), it became possible to do
 cfoutputcfoutput#now()#/cfoutput/cfoutput.  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

2008-05-28 Thread Phillip Vector
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

2008-05-28 Thread Rick Faircloth
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

2008-05-28 Thread Dave Watts
 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:
 
 cfoutput query=foo group=id
 #foo.id#br
 cfoutput#foo.b#br/cfoutput
 
 /cfoutput

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

2008-05-28 Thread Gerald Guido
 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

2008-05-28 Thread Phillip Vector
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


easy one! : comma separated list from cfoutput

2008-05-13 Thread morchella
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..

cfloop query=getProd
   cfset columns = columns#specs_partnum#,
/cfloop

!--- remove the last comma ---
cfset columns = left(columns,evaluate(len(columns) -1))

cfoutput#columns#/cfoutput

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:305164
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

2008-05-13 Thread Joe Rinehart
cfoutput#valueList(getProd.specs_partnum)#/cfoutput

-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..

  cfloop query=getProd
cfset columns = columns#specs_partnum#,
  /cfloop

  !--- remove the last comma ---
  cfset columns = left(columns,evaluate(len(columns) -1))

  cfoutput#columns#/cfoutput

  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


Re: easy one! : comma separated list from cfoutput

2008-05-13 Thread Gerald Guido
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..

 cfloop query=getProd
   cfset columns = columns#specs_partnum#,
 /cfloop

 !--- remove the last comma ---
 cfset columns = left(columns,evaluate(len(columns) -1))

 cfoutput#columns#/cfoutput

 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

2008-05-13 Thread Ian Skinner
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..

 cfloop query=getProd
cfset columns = columns#specs_partnum#,
 /cfloop

 !--- remove the last comma ---
 cfset columns = left(columns,evaluate(len(columns) -1))

 cfoutput#columns#/cfoutput

 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

2008-05-13 Thread morchella
awsome...
thank you!

now.. =]
how would i remove doubles?

!--- List of Accessory's that are assigned to this product  ---
cfquery name=getAccessory datasource=listit
SELECT DISTINCT ascList
FROM dbo.list
WHERE (specs_partnum IN (#columns#)) AND (ascList IS NOT NULL)
/cfquery

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

2008-05-13 Thread morchella
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?

 !--- List of Accessory's that are assigned to this product  ---
 cfquery name=getAccessory datasource=listit
 SELECT DISTINCT ascList
 FROM dbo.list
 WHERE (specs_partnum IN (#columns#)) AND (ascList IS NOT NULL)
 /cfquery

 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

2008-05-13 Thread Andy Matthews
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?

!--- List of Accessory's that are assigned to this product  --- cfquery
name=getAccessory datasource=listit SELECT DISTINCT ascList FROM
dbo.list WHERE (specs_partnum IN (#columns#)) AND (ascList IS NOT NULL)
/cfquery

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

2008-05-13 Thread Gerald Guido
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?

 !--- List of Accessory's that are assigned to this product  ---
 cfquery name=getAccessory datasource=listit
 SELECT DISTINCT ascList
 FROM dbo.list
 WHERE (specs_partnum IN (#columns#)) AND (ascList IS NOT NULL)
 /cfquery

 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

2008-05-13 Thread Gerald Guido
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?
 
  !--- List of Accessory's that are assigned to this product  ---
  cfquery name=getAccessory datasource=listit
  SELECT DISTINCT ascList
  FROM dbo.list
  WHERE (specs_partnum IN (#columns#)) AND (ascList IS NOT NULL)
  /cfquery
 
  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

2008-05-13 Thread morchella
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?

 !--- List of Accessory's that are assigned to this product  --- cfquery
 name=getAccessory datasource=listit SELECT DISTINCT ascList FROM
 dbo.list WHERE (specs_partnum IN (#columns#)) AND (ascList IS NOT NULL)
 /cfquery

 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

2008-05-13 Thread Dawson, Michael
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

2008-05-13 Thread Robert Harrison
Order by ascList... that should get DISTINCT to work.


cfquery name=getAccessory datasource=listit 
SELECT DISTINCT ascList 
FROM dbo.list 
WHERE (specs_partnum IN (#columns#)) AND (ascList IS NOT NULL)
ORDER BY ascList
/cfquery

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

2008-05-13 Thread Paul Ihrig
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.


 cfquery name=getAccessory datasource=listit
 SELECT DISTINCT ascList
 FROM dbo.list
 WHERE (specs_partnum IN (#columns#)) AND (ascList IS NOT NULL)
 ORDER BY ascList
 /cfquery

 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

2008-05-13 Thread Paul Ihrig
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

2008-05-13 Thread Gerald Guido
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

2008-05-13 Thread Greg Morphis
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

2008-05-13 Thread Ian Skinner
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

2008-05-13 Thread Ian Skinner
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


  1   2   3   4   5   6   7   8   9   10   >