Using Queries Of Queries With Numeric Dates; Understanding Query Of Queries Performance - MACROMEDIA COLDFUSION MX 61-DEVELOPING COLDFUSION MX Develop Manual

Developing coldfusion mx applications
Table of Contents

Advertisement

PRIOR
REAL
RIGHT
SECOND
SET
SQL
SUM
TIME
TRAILING
TRUE
UPPER
VALUES
WHENEVER
YEAR

Using Queries of Queries with numeric dates

If you create a query object with
format (for example, 12/24/02), the dates are preserved as a string inside the query object until a
Query of Queries is applied to the query object. When ColdFusion applies a Query of Queries to
the query object, it converts the string representations into date objects. If you want to convert
the data to its original format, use the
The following code demonstrates this:
<cfset q1=queryNew("col1, col2")>
<cfset queryAddRow(q1,2)>
<cfset q1['col1'][1] = 1>
<cfset q1['col2'][1] = "12/24/2002">
<cfset q1['col1'][2] = 2>
<cfset q1['col2'][2] = "3/26/04">
Query object date before q of q<br>
<cfoutput>#q1['col2'][1]#</cfoutput><br><br>
<cfquery name="qoq" dbtype="query">
select * from q1
</cfquery>
Query object date after q of q<br>
<cfoutput>#q1['col2'][1]#</cfoutput><br><br>
Now reformat it:
<cfoutput>#dateFormat(q1['col2'][1], "mm/dd/yy")#</cfoutput>

Understanding Query of Queries performance

Query of Queries performs very well on single-table query objects that were accessed directly
from a database. This is because ColdFusion MX stores meta information for a query object
accessed from a database. It does not perform as well on large query objects derived from a
function, because ColdFusion MX must derive the metadata at runtime.
QueryNew()
PRIVILEGES
PROCEDURE
REFERENCES
RELATIVE
ROLLBACK
ROWS
SECTION
SELECT
SIZE
SMALLINT
SQLCODE
SQLERROR
SYSTEM_USER
TABLE
TIMESTAMP
TIMEZONE_HOUR TIMEZONE_MINUTE TO
TRANSACTION
TRANSLATE
UNION
UNIQUE
USAGE
USER
VARCHAR
VARYING
WHERE
WITH
ZONE
QueryNew()
DateFormat
PUBLIC
RESTRICT
SCHEMA
SESSION
SOME
SQLSTATE
TEMPORARY
TRANSLATION
UNKNOWN
USING
VIEW
WORK
and populate a column with dates in numeric
function and apply the "mm/dd/yy" mask.
Query of Queries user guide
READ
REVOKE
SCROLL
SESSION_USER
SPACE
SUBSTRING
THEN
TRIM
UPDATE
VALUE
WHEN
WRITE
473

Advertisement

Table of Contents
loading

This manual is also suitable for:

Coldfusion mx

Table of Contents