Doh!

Yes showing code is good and here's the offender...

This was inside the loop and myvar was getting incremented by 1 each loop -
as there were three rows and therefore three loops the last instruction was
to add 3 rows :-)

<cfset Temp = QueryAddRow(qNews,#myvar#)>

Thanks guys for your help!!!!!!!!!!


++++++++++
Kevin Parker

-----Original Message-----
From: Bobby Hartsfield [mailto:bo...@acoderslife.com] 
Sent: Thursday, 24 March 2011 09:16
To: cf-talk
Subject: RE: The vagaries of QueryNew


It seems like an invalid use of queryAddColumn might have caused this for me
once. I have rarely ever used that function but it seems familiar... As if,
instead of adding the new column and updating the existing rows, it added
the column but added double the rows and updated only the new rows.

I'd have to think it is that or a queryAddRow() mishap.

As others have already pointed out though, seeing the code would be best.


.:.:.:.:.:.:.:.:.:.:.:.:.:.
Bobby Hartsfield
http://acoderslife.com
http://cf4em.com
-----Original Message-----
From: Kevin Parker [mailto:tras...@internode.on.net] 
Sent: Wednesday, March 23, 2011 7:18 AM
To: cf-talk
Subject: The vagaries of QueryNew


I have a query where I need to add some extra stuff not in the database so
decide to create another query object with QueryNew.

I loop over a query of the table to set cell values and add extra values to
each row etc.

I output the record count for the original query and it shows 3 rows (which
is correct - there are three rows in the table) but when if do a cfdump of
the new query object its shows 6 rows, 3 with the original data and an extra
3 with all cells showing [empty string]

I have no idea where it's getting this from.

Any clues please? TIA!!!!!


++++++++++
Kevin Parker








~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
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:343242
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

Reply via email to