Hi all,

I finally solved it! Took most of the day and half the night. Anyone using
QofQ's would be well advised to read up on the problems you can run into
when CFAS automatically assigns the wrong datatype to a field in a query
object you create. I got one of the workarounds listed here to work for me.

http://livedocs.macromedia.com/coldfusion/6.1/htmldocs/using_r6.htm

n.

-----Original Message-----
From: Nando [mailto:[EMAIL PROTECTED]
Sent: Monday, July 26, 2004 10:19 PM
To: CF-Talk
Subject: Strange QofQ error using MySQL - Unrecognized java type

Hi,

I'm running into one of the strangest errors i've ever come across. If
anyone could help, i'd very much appreciate it.

I'm migrating an application to use MySQL. The sequence of functions
described below work fine using Access. I get a "Query Of Queries runtime
error. Unrecognized java type" when trying it with MySQL. I'm using a cfc to
do this.

Step 1 - generate a query object from the DB and cache it in
variables.allNav. This works fine using either DB.

Step 2 - create a new query object called variables.siteMap.

Step 3 - generate the site map using a recursive function, filling
variables.siteMap.
All this function does is to reorder variables.allNav according to the
hierarchy created by the parentID. This also works fine with either DB.

Step 4 - run a simple QofQ on variables.siteMap - Here's where i get the
error, but only when using MySQL.

The thing that really throws me is that if i run this QofQ on variables.Nav
(the query pulled from the DB), instead of variables.SiteMap (the query
generated from variables.allNav), i DON'T get the error. That doesn't quite
make sense. I would think that the error would manifest itself in the query
off the database.

This works:

SELECT *
FROM variables.allNav
WHERE strLang = '#arguments.lan#'
<cfif NOT editMode>
AND bitPublish = 1
</cfif>

The other strange thing is if i remove the WHERE clause and run it on
variables.siteMap, i get the error.

This doesn't work:

SELECT *
FROM variables.siteMap

Anyone have any suggestion? I'm stumped.

thanks, Nando

Step 2 code

<cfset variables.siteMap = QueryNew
("idPage,strCircuitAction,idParent,strLabel,strSection,sortOrder,MenuLevel,b
itPublish,strLink,strLang")>

Step 3 code

<cffunction name="generateSiteMap" access="public" returntype="void"
output="no">
<cfargument name="ParentID" type="numeric" required="yes">
<cfargument name="level" type="numeric" required="yes">
<cfargument name="lan" type="string" required="yes">
<cfset var thisLevel = "" />

<cfquery name="thisLevel" dbtype="query">
SELECT *
FROM variables.allNav
WHERE menuLevel = #arguments.level#
AND strLang = '#arguments.lan#'
</cfquery>

<cfloop query="thisLevel">
<cfif thisLevel.idParent EQ arguments.ParentID AND thisLevel.strLang EQ
arguments.lan>
<cfset queryAddRow(variables.siteMap)>
<cfset querySetCell(variables.siteMap, "idPage", idPage) />
<cfset querySetCell(variables.siteMap, "strCircuitAction",
strCircuitAction) />
<cfset querySetCell(variables.siteMap, "idParent", idParent) />
<cfset querySetCell(variables.siteMap, "strLabel", strLabel) />
<cfset querySetCell(variables.siteMap, "strSection", strSection) />
<cfset querySetCell(variables.siteMap, "sortOrder", sortOrder) />
<cfset querySetCell(variables.siteMap, "menuLevel", menuLevel) />
<cfset querySetCell(variables.siteMap, "bitPublish", bitPublish) />
<cfset querySetCell(variables.siteMap, "strLink", strLink) />
<cfset querySetCell(variables.siteMap, "strLang", strLang) />
<cfset generateSiteMap(thisLevel.idPage,
arguments.level+1,thisLevel.strLang) >
</cfif>
</cfloop>

</cffunction>

Step 4 code

<cffunction name="getSiteMap" access="public" returntype="any" output="no">
<cfargument name="lan" type="string" required="yes">
<cfargument name="editMode" type="boolean" default="#request.editMode#">
<cfset var thisSiteMap = "" />
<cfquery name="thisSiteMap" dbtype="query">
SELECT *
FROM variables.siteMap
WHERE strLang = '#arguments.lan#'
<cfif NOT editMode>
AND bitPublish = 1
</cfif>
</cfquery>
<cfreturn thisSiteMap>
</cffunction>
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]

Reply via email to