First, as someone else suggested - search your entire code-base for (with 
quotes)     "qryGetVisitRecords"    that should bring you back something like:
<cfquery name="qryGetVisitRecords">.....or even a <cfstoredproc>....

It's possible that someone had a dynamic name, but unlikely...so that'd be your 
first approach.

Then, as far as what CF does with query of queries (your specific example) - it 
takes two CFQUERIES (note, these are now downloaded recordsets from the db 
server - they are coldfusion variables now) and it joins them together through 
the where clause that was in your query.  So it tries to match up the queries 
on your sitecompany_id fields from the two different datasets returned by your 
db (in previously called cfquery/cfstoredproc tags).

What would be very helpful to you would be to do a cfdump on both of the 
"tables" that were referenced in the FROM clause.  I put tables in quotes 
because they're really just CFQueries.

<cfdump var="#qryGetVisitRecords#" label="qryGetVisitRecords" />
<cfdump var="#qryGetAssignedMonths#" label="qryGetAssignedMonths" />
<cfabort>

Then, looking at your where clause in the query, you'd want to browse through 
the dumped records from the above statement and have a look at your 
sitecompany_id fields in both and that will show you what will have matched up 
between the two.  It's been a while since I've done any query of queries (I try 
to avoid them when possible - typically we can handle these things in the 
initial query), but it seems like there were things that would kill record 
joins such as case sensitivity, spaces at the end of fields on one side and not 
the other, etc.  CF is MUCH more picky than SQL Server when it comes to joining 
it's "tables" to each other.

Hope that helps.

Allen

________________________________
From: [email protected] [mailto:[email protected]] On Behalf Of mike barnes
Sent: Tuesday, December 07, 2010 7:38 AM
To: [email protected]
Subject: Re: [ACFUG Discuss] Noob help

The answer to everyones question is yes, the dbtype is "query". So, how do does 
one debug this query of queries, since it appears to not be getting all of the 
records. Basically, what I would like to do is see what the underlying sql 
statement is; so, that I can map back to the database (or is this possible). 
Also, not sure what debugging tools I have available to me.

What makes this query of queries confusing is the fact that the from statement 
does not represent a table or view, so, what does CF use to substitute this 
part of the query, is it all of the tables from the "main" query?

Thanks
Mike Barnes

On Mon, Dec 6, 2010 at 5:44 PM, John Youngman 
<[email protected]<mailto:[email protected]>> wrote:
Good tip,

and dont forget to look in any cfm templates that are used in <cfinclude> tags 
that may lie above the query in question.

Good luck!! :D

__________________________
John Youngman
[email protected]<mailto:[email protected]>
http://www.linkedin.com/in/johngyoungman





On Dec 6, 2010, at 5:38 PM, Teddy R. Payne wrote:

*chuckle*

As you can see, several people are on the same train of thought here.

Another way in the future to try and figure out context of code is to
do some global searches for keywords like "qryGetVisitRecords".  This
could provide some code insight as to where the original query exists
and how often it is being referenced.  When you cannot find code, then
you need to expand your searches to the interfaces to the application.
This could be in many forms to include databases, webservices, ...etc
where either data access or other code logic could reside.


Happy Hunting!

Teddy R. Payne, ACCFD
Google Talk - [email protected]<mailto:[email protected]>


-------------------------------------------------------------
To unsubscribe from this list, manage your profile @
http://www.acfug.org?fa=login.edituserform

For more info, see http://www.acfug.org/mailinglists
Archive @ http://www.mail-archive.com/discussion%40acfug.org/
List hosted by http://www.fusionlink.com
-------------------------------------------------------------









-------------------------------------------------------------

To unsubscribe from this list, manage your profile @ 

http://www.acfug.org?fa=login.edituserform



For more info, see http://www.acfug.org/mailinglists

Archive @ http://www.mail-archive.com/discussion%40acfug.org/

List hosted by http://www.fusionlink.com

-------------------------------------------------------------


Reply via email to