Right,  The following QofQ works on my data:
<cfquery dbtype="query" name="getSorted">
SELECT *
FROM getMenusQofQ
</cfquery>

This throws the error:

<cfquery dbtype="query" name="getSorted">
SELECT *
FROM getMenusQofQ
ORDER BY displayorder
</cfquery>

Anyone want to have a guess why the ORDER BY is causing problems?

Cheers

Dave

On Thu, 27 Nov 2003 12:30:53 +0000
 "Dave Phipps" <[EMAIL PROTECTED]> wrote:
Thanks for the undoc'd function. I have tried the sort() and it throws the same error. I can't do the sort before the query add row as it is the final query I want to sort.

Basically I am using a recursive custom tag. I grab a load of data from the db and cache it. Then I use a QofQ to grab the data for the given request. This grabs some menus from the menu table. I also have a custom menu table and so I grab the custom menus matching the criteria and then merge the two queries (the QofQ and the custom query) using the QuerySetCell et al functions.

Both the original QofQ and the custom query have a column called "displayorder" and once the two queries are merged I want to sort on this column. The error is thrown and I get no further? What is this cast thing all about? Is there a way to specify the datatypes in the QueryNew function?

Cheers

Dave

On Thu, 27 Nov 2003 12:16:16 -0000
 "Justin" <[EMAIL PROTECTED]> wrote:

A couple of things.


What column type are you sorting on ?

You can use the undocumented feature myquery.sort(column) see
http://www.cfdev.com/mx/undocumentation/query.cfm


If you feel the issue is due to the QueryAddRow etc, why not add them after
the sort.


Justin

-----Original Message-----
From: Dave Phipps [mailto:[EMAIL PROTECTED]
Sent: 27 November 2003 11:52
To: [EMAIL PROTECTED]
Subject: [ cf-dev ] QofQ on a QofQ cast error


Hi,


I have a query which I would like to sort. The main query
is a QofQ with some extra rows added using the
QueryAddRow()/QuerySetCell functions. I have this
combined query outputting everything I want except that
the order in which the records display is wrong.


I tried to do a QofQ on this recordset and I get the
following error:

Error casting an object of type to an incompatible type.
This usually indicates a programming error in Java,
although it could also mean you have tried to use a
foreign object in a different way than it was designed.

What does this error mean.  Can I not do a QofQ on a
recordset consisting of a QofQ and additional rows?

Anyone come across this before?

Cheers

Dave

--
** Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/


To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
For human help, e-mail: [EMAIL PROTECTED]




--
** Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/


To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
For human help, e-mail: [EMAIL PROTECTED]




--
** Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/


To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
For human help, e-mail: [EMAIL PROTECTED]




--
** Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/

To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
For human help, e-mail: [EMAIL PROTECTED]



Reply via email to