I'm building a query object for a search page:

<!--- original query here --->
<cfloop query="results" startrow="1" endrow="#n#">

!--- Count the number of times the search keyword
      appears in our narrative --->
   <cfset req.keyCOUNT = 
ListValueCountNoCase(results.narrative,#req.srch#,' ')>

<!--- Add all rows to the query object --->
   <cfset queryAddRow(q_atty)>
   <cfset querySetCell(q_atty, "atty_id", results.atty_id, 
results.currentROW)>
   <cfset querySetCell(q_atty, "first_name", results.first_name, 
results.currentROW)>
   <cfset querySetCell(q_atty, "last_name", results.last_name, 
results.currentROW)>
   <cfset querySetCell(q_atty, "keycount", req.keyCOUNT, 
results.currentROW)>

</cfloop>

<!--- query for display showing the number of keyword hits
       so we can sort by the number of times the term appears --->
<cfquery dbtype="query" name="sortedATTY">
SELECT
   atty_id,
   first_name,
   middle_name,
   last_name,
   suffix,
   atty_type,
   bus_number,
   office_id,
   keycount
FROM q_atty
ORDER BY keycount desc, Last_Name asc, First_Name asc
</cfquery>


The "atty_id" above is either a integer from an older version of the 
database or it's a UUID - both in the same varchar field. When running 
test searches, all seems well until I enter a term that returns a LOT of 
results. Then I get an error:

"The value "3C26C422-BCD2-35D3-DDB3F69250F4848F" cannot be converted to 
a number"

OK, that's a specific record. If I do a different search the returns 
less results which INCLUDE the specific record above, I get no error...

In fact, it seems that all searches that return a small amount of 
results with either a UUID or number ID return OK. Any search returning 
a large number of results, chokes on the first UUID it hits.

Doing a dump of my initial query "results" looks fine before it's read 
into the query object.

There's nowhere in my code that says the atty_id is a number. Don't 
understand why it's trying to convert it to start with. Any why only in 
large result sets, not small ones?

Try it: http://www.nmrs.com/test.cfm

Enter "mcguire" and then note the ID number on the attorney returned.
Back up and enter "trial", which should return about a bazillion 
results. There's Mcguire's ID causing the error.
Try one more - enter "FDCPA". There's McGuire again in the results, 
causing no error.

If you check the "dump" box, you'll get a CFDUMP of the initial results 
that are being read into the query object for analysis.

What the heck is going on? Ideas?



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;203748912;27390454;j

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:307950
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to