Questions tagged [qoq]

ColdFusion Query of Queries (QoQ) is used to re-query the result of one or more original queries.

ColdFusion Query of Queries (QoQ) let you query the results of an existing database query. A QoQ uses the <cfquery> and is very similar to querying against a database. Example:

<cfquery name="this.qryReportDefGroup" dbtype="query">
    SELECT  SourceTypeID, cyclelocked
    FROM    request.stData.qryReportDefGroup
</cfquery>

The FROM statement in this case references a variable that is a part of a structure. The SQL inside of a QoQ is specific to ColdFusion. The results of a QoQ can be used in yet another QoQ.

You can also query a non-database query object, for example, the results of a cfftp directory listing. src: http://www.quackit.com/coldfusion/tutorial/coldfusion_query_of_queries.cfm

83 questions
7
votes
3 answers

Query of queries and CAST as date

I am using cfspreadsheet to read the values out of an excel sheet and then I do a query of queries to sort the date field because all fields returned by cfspreadsheet are of the "VarChar" type. Here is the code:
user1201723
  • 115
  • 2
  • 8
6
votes
3 answers

Use count() function in ColdFusion query of query

I wanted to use count() function in ColdFusion Query object. Here is my code and test: select count(*) as total from x Test1: #y.total#
Vikas
  • 24,082
  • 37
  • 117
  • 159
6
votes
1 answer

Nuances between CF_SQL_DECIMAL and CF_SQL_NUMERIC

What are the nuances between CF_SQL_DECIMAL and CF_SQL_NUMERIC? It sounds like they both accept an argument called scale (per http://csis.pace.edu/~ctappert/cs615-02/support/Help/CFML_Language_Reference/lang_0277.htm). If I were to provide an…
bean5
  • 306
  • 2
  • 9
5
votes
4 answers

How can I use query-of-query UNION on n-recordsets when var scoping is needed?

I would like to be able to do a query of a query to UNION an unknown number of recordset. However when doing a query-of-query dots or brackets are not allowed in record set names. For example this fails:
Dan Roberts
  • 4,664
  • 3
  • 34
  • 43
5
votes
1 answer

CF Query of Query multiple order by statements add last ordered column to select

I found some very strange behaviour of ColdFusion's query component. When you use this component to build a query of query (QoQ) of another ColdFusion Query and use order by on several colums, the last column in the order by list is added to the…
Sander
  • 390
  • 1
  • 4
  • 13
5
votes
3 answers

Railo Query of Query returning incorrect results

I'm running the following two statements: First is A) which does what it needs to do and works: SELECT itemColumn ,valueColumn ,label FROM rstCombinedChartData UNION ALL SELECT itemColumn ,CAST(valueColumn AS INTEGER) AS valueColumn …
GrantU
  • 6,325
  • 16
  • 59
  • 89
5
votes
5 answers

CF - QoQ vs Query

I've got a notion that calling a query of queries is faster than a query from database, because the slowdown is in the communication between cf and the db. Is this true. Does that mean that a QoQ within a loop is acceptable, whereas a query within a…
Daniel
  • 34,125
  • 17
  • 102
  • 150
4
votes
1 answer

The query of query ( QoQ ) with order by return duplicate column after update12 Coldfusion 2018

I've updated my coldfusion 2018 server with most recent update12 by Adobe. As soon as I've updated the server I've wrote some QoQ for my application with ORDER BY in my QoQ. Whenever I use order by in QoQ then the result data have some duplicate…
Kannan.P
  • 1,263
  • 7
  • 14
4
votes
5 answers

Can we Use "Case" in a ColdFusion Query-of-Query

I am applying case in ColdFusion query of query but it's throwing an error. Query: select ( case when ISNUMERIC(u.userdefined)=1 then right('00000000'+u.userdefined,8) …
Techleadz Team
  • 198
  • 2
  • 15
4
votes
1 answer

Does Lucee support any single character wildcards in QoQ?

ColdFusion query of queries syntax honors underscore as a single-character wildcard, and escaping of literal underscores with square brackets: LIKE '_abc' -- any 1 char then abc LIKE '[_]abc' -- actual underscore char then abc Lucee (5.1 tested)…
enigment
  • 3,316
  • 7
  • 30
  • 35
4
votes
1 answer

Query of Queries variable scoping

Is it possible to scope variables when using query of queries? This works return queryExecute(" SELECT Title, Slug, Menu, MenuOrder FROM qryResult WHERE Menu = 'Y' ORDER BY MenuOrder ", [], …
James A Mohler
  • 11,060
  • 15
  • 46
  • 72
4
votes
1 answer

How can I perform a SQL SELECT with a LIKE condition for a string containing an open bracket character?

I have a simple search query: SELECT * FROM MyQoQ WHERE DESCRIPTION LIKE '%#URL.searchString#%' This query works excellently for most values. However, if someone…
Eric Belair
  • 10,574
  • 13
  • 75
  • 116
4
votes
1 answer

Query Of Queries runtime error.Cannot apply the binary numeric operator [*|/] on a non numeric type

I have a script that queries the database for order information and then a query of that query in order to get order totals. The code looks like this. SELECT …
Chris Pilie
  • 451
  • 2
  • 7
  • 21
4
votes
2 answers

order a column in a query object by length with QoQ in ColdFusion?

Is it possible to sort a query object by the length of a varchar column using Query of Queries in ColdFusion?
Henry
  • 32,689
  • 19
  • 120
  • 221
3
votes
1 answer

Unexpected error using the sum function in a QoQ

While attempting to run the following code SELECT SUM(AMOUNT) AS TOTAL FROM ChartData This is the error message that's generated: Query Of Queries runtime error. The…
user12031119
  • 1,228
  • 4
  • 14
1
2 3 4 5 6