I know this is gunna be something simple...
I have a cfc which contains the following query (using access database)...
<cfquery name="qgetArticles" datasource="#variables.dsn#"
username="#variables.dbusername#" password="#variables.dbpassword#">
SELECT <cfif arguments.recent>TOP 1</cfif>
article.*
FROM article
WHERE 1=1
<cfif isDefined("arguments.article_id")>
AND article_id = <cfqueryparam value="#arguments.article_id#"
cfsqltype="cf_sql_integer">
</cfif>
<cfif isDefined("arguments.issue_id")>
AND issue_id = <cfqueryparam value="#arguments.issue_id#"
cfsqltype="cf_sql_integer">
</cfif>
ORDER BY issue_id DESC, order_key
</cfquery>
The query executes perfectly except that is returns 3 rows instead of one.
In the debugging out it shows...
qgetArticles (Datasource=GME14211S1A, Time=16ms, Records=3) in
C:\CFusionMX\wwwroot\Interface\com\article.cfc @ 10:44:00.000
SELECT TOP 1
article.*
FROM article
WHERE 1=1
ORDER BY issue_id DESC, order_key
What am I doing wrong, as the TOP function is working fine in another query.
Regards
Mike
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Macromedia ColdFusion MX7
Upgrade to MX7 & experience time-saving features, more productivity.
http://www.adobe.com/products/coldfusion?sdid=RVJW
Archive:
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:283427
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4