This one's driving me bonkers. I found a "solution" but why on earth this is
happening is beyond me.
<cfquery name="query_paperforspecs" datasource="#Request.DB#">
(SELECT pr.revisionid
FROM projects p, projectrevisions pr
WHERE
pr.revisioncreationtypecode in ('E','D') and
pr.revisionstatuscode in ('V','A') and
p.projectid = pr.projectid and
p.siteid = pr.siteid and
p.projectid = #pid# and
p.siteid = #request.siteid#
GROUP BY pr.revisionid
HAVING max(mod(pr.revisionsettings,2)) = 1)
UNION
(SELECT DISTINCT pr.revisionid
FROM projectorder po, projectrevisions pr
WHERE
mod(pr.revisionsettings,2) = 1 and
po.projectid = pr.projectid and
po.siteid = pr.siteid and
po.orderstatuscode = 'A' and
po.projectid = #pid# and
po.siteid = #request.siteid#)
</cfquery>
After running this query in CF7, it doesn't even recognize that I ran a
query. Attempts to reference "query_paperforspecs" or any of its properties
results in "Variable QUERY_PAPERFORSPECS is undefined" and "Element
RECORDCOUNT is undefined in QUERY_PAPERFORSPECS.", respectively.
To solve this problem, all I needed to do is remove the parenthesis
surrounding the two SELECT statements and it ran fine. Either one works find
when I run it directly in the query analyzer. Why would CF care about
parenthesis surrounding a SELECT statement?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Logware (www.logware.us): a new and convenient web-based time tracking
application. Start tracking and documenting hours spent on a project or with a
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:197502
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54