I tried changing the queryAddColumn function as described. but still got
the exact same error. Then I tried moving out the array creation to its own
cfset.
Again the error is the same except now it is the setting of the array that
is highlighted at the arror point:
1000: order by tblblogcategories.categoryname
1001: </cfquery>
1002: 1003: <cfset columnArray = arrayNew(1)>
1004: <cfset getC = queryAddColumn(getC, "entrycount", "integer",
columnArray)> <!--- , --->
^ Snippet from underlying CFML source
The specific error message is:
TypeApplicationFunction(s)getCategories (C:/Program Files/Apache Software
Foundation/Tomcat 7.0/webapps/oldncra/groundwire/org/camden/blog/blog.cfc,
Line=955, Column=2)
DetailData not supported
And is it is helpful, the whole function looks like this (with my mods to
line 1003 and 1004:
<cffunction name="getCategories" access="remote" returnType="query"
output="false" hint="Returns a query containing all of the categories as
well as their count for a specified blog.">
<cfargument name="usecache" type="boolean" required="false" default=
"true">
<cfset var getC = "">
<cfset var getTotal = "">
<!---
Update on May 10, 2006
So I wanted to update the code to handle cats with 0 entries. This
proved difficult.
My friend Tai sent code that he said would work on both mssql and
mysql,
but it only worked on mssql for me.
So for now I'm going to use the "nice" method for mssql, and the
"hack" method
for the others. The hack method will be slower, but it should not
be terrible.
--->
<!--- get cats is expensive when not mssql, and really, it doesn't
change too often, so I'm adding a cache --->
<cfif structKeyExists(variables, "categoryCache") and arguments.
usecache>
<cfreturn variables.categoryCache>
</cfif>
<cfif instance.blogDBType is "mssql">
<cfquery name="getC" datasource="#instance.dsn#" username=
"#instance.username#" password="#instance.password#">
select tblblogcategories.categoryid,
tblblogcategories.categoryname, tblblogcategories.categoryalias,
count(tblblogentriescategories.entryidfk) as entryCount
from (tblblogcategories
left outer join
tblblogentriescategories ON tblblogcategories.categoryid =
tblblogentriescategories.categoryidfk)
left join tblblogentries on
tblblogentriescategories.entryidfk = tblblogentries.id
where tblblogcategories.blog = <cfqueryparam value=
"#instance.name#" cfsqltype="CF_SQL_VARCHAR" maxlength="50">
<!--- Don't allow future posts unless logged in. --->
<cfif not isUserInRole("admin")>
and isNull(tblblogentries.posted, '1/1/1900') <
<cfqueryparam cfsqltype="cf_sql_timestamp" value="#blogNow()#">
and isNull(tblblogentries.released, 1) = 1
</cfif>
group by tblblogcategories.categoryid,
tblblogcategories.categoryname, tblblogcategories.categoryalias
order by tblblogcategories.categoryname
</cfquery>
<cfelse>
<cfquery name="getC" datasource="#instance.dsn#" username=
"#instance.username#" password="#instance.password#">
select tblblogcategories.categoryid,
tblblogcategories.categoryname, tblblogcategories.categoryalias
from tblblogcategories
where tblblogcategories.blog = <cfqueryparam value=
"#instance.name#" cfsqltype="CF_SQL_VARCHAR" maxlength="50">
order by tblblogcategories.categoryname
</cfquery>
<cfset columnArray = arrayNew(1)>
<cfset getC = queryAddColumn(getC, "entrycount", "integer",
columnArray)>
<cfloop query="getC">
<cfquery name="getTotal" datasource="#instance.dsn#"
username="#instance.username#" password="#instance.password#">
select count(tblblogentriescategories.entryidfk) as total
from tblblogentriescategories, tblblogentries
where tblblogentriescategories.categoryidfk =
<cfqueryparam value="#categoryid#" cfsqltype="CF_SQL_VARCHAR" maxlength="35"
>
and tblblogentriescategories.entryidfk =
tblblogentries.id
and tblblogentries.released = 1
</cfquery>
<cfif getTotal.recordCount>
<cfset querySetCell(getC, "entrycount", getTotal.total,
currentRow)>
<cfelse>
<cfset querySetCell(getC, "entrycount", 0, currentRow)>
</cfif>
</cfloop>
</cfif>
<cfset variables.categoryCache = getC>
<cfreturn variables.categoryCache>
</cffunction>
Thannks for any help.
Magnus
Saturday, 9 May 2015 09:05:51 UTC-7, Alan Williamson wrote:
>
> Yup, that is right ... the other way to get around it, is to use named
> parameters.
>
> ------ Original Message ------
> From: "Magnus" <[email protected] <javascript:>>
> To: [email protected] <javascript:>
> Cc: [email protected] <javascript:>
> Sent: 09-May-15 11:41:09
> Subject: Re: [OpenBD] OpenBD vs.BlogCFC
>
>
> Thanks, Alan
>
> THis is the line from teh BlogCFC code:
> <cfset queryAddColumn(getC, "entrycount", arrayNew(1))>
>
> The ACF9 docs says this:
> QueryAddColumn(query, column-name [, datatype], array-name)
>
> The OpenBD docs say this:
> NUMERIC = QueryAddcolumn( query, column, datatype, valuearray )
>
> If I understand it correctly. the issue seems to be having the array as
> the third argument. In ACF the datatype argument is optional but in OpenBD
> it seems not. Therefore, OpenBD is not expecting an array in the third
> position.
>
> Putting an appropriate datatype argument in place should correct the
> error.. Does that seem correct?
>
> Magnus
>
> --
> --
> online documentation: http://openbd.org/manual/
> http://groups.google.com/group/openbd?hl=en
>
> ---
> You received this message because you are subscribed to the Google Groups
> "Open BlueDragon" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected] <javascript:>.
> For more options, visit https://groups.google.com/d/optout.
>
>
--
--
online documentation: http://openbd.org/manual/
http://groups.google.com/group/openbd?hl=en
---
You received this message because you are subscribed to the Google Groups "Open
BlueDragon" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.