qoq

How to test for null/empty string in Coldfusion query of query?

橙三吉。 提交于 2020-01-04 04:31:30
问题 I've been looking online for a solution, but none's come up. I have a column in a coldfusion query, "date_hired". If I do a cfdump of the query, it shows as a date if its a date or as [empty string] if not. There are 8 records in the query; and some have dates for date_hired and some don't. If I try to do a q of q on this resultset: SELECT date_hired FROM myQuery WHERE date_hired = '' I get an error message saying: Comparison exception while executing =. Unsupported Type Comparison Exception:

CF - QoQ vs Query

放肆的年华 提交于 2019-12-19 19:56:09
问题 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 loop is not. 回答1: Full DBMS are highly optimised for processing [appropriately-written] queries, and on a modern network the overhead is not going to be huge. QoQ are performed using an embedded database, which may or not be well optimised,

Inconsistent Q of Q Behaviour

一世执手 提交于 2019-12-13 04:38:37
问题 Using ColdFusion Server Enterprise 9,0,1,274733. Has anyone seen this before? The following code executes without error. <cfquery name="x" datasource="dw"> select event_code, event_name from event </cfquery> <cfquery name="y" dbtype="query"> select event_code || event_name fred , event_code from x </cfquery> Two things to notice are that I declared an alias without using the keyword "as", and I used || to concatenate strings. However, if I qualify the first event code, like this: <cfquery

Not getting desired output after executing a QoQ

大城市里の小女人 提交于 2019-12-13 04:24:21
问题 I'm running the following SQL queries and am not getting a desired output: <cfquery datasource = "XX.XX.X.XX" name="master"> SELECT count(Timedetail) as Occurances, date_format(Timedetail,'%m-%d-%Y') FROM MyDatabase WHERE EVENTS = "FIRST" GROUP BY Timedetail ; </cfquery> <cfquery dbtype="query" name="detail"> SELECT * FROM master WHERE Timedetail >= <cfqueryparam value="#form.startdate#" cfsqltype="cf_sql_date"> AND Timedetail < <cfqueryparam value="#dateAdd('d', 1,form.enddate)#" cfsqltype=

Query of Queries failing in Coldfusion 10

僤鯓⒐⒋嵵緔 提交于 2019-12-11 08:21:36
问题 I'm getting and error when I tried to do a query of query. Table named allData was not found in memory. The name is misspelled or the table is not defined. I have an excel document and I'm outputting to a coldfusion var called allData, then I'm doing a query on that var. but I'm getting an error: What am I doing wrong? The first dump shows the table appropriately. function name="validateExcel" access="public" output="yes" returnType="void" hint="search for dogs"> <cfspreadsheet action="read"

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

为君一笑 提交于 2019-12-10 16:56:37
问题 I have a simple search query: <cfquery name="_qSearch" dbtype="Query"> SELECT * FROM MyQoQ WHERE DESCRIPTION LIKE '%#URL.searchString#%' </cfquery> This query works excellently for most values. However, if someone searches for a value like "xxx[en" , it bombs with the error message The pattern of the LIKE conditional is malformed. . Is there any way around this, since the bracket has a special use in CFQUERY? 回答1: QoQ shares a feature of TSQL (MS SQL Server) whereby it's not just % and _ that

Nuances between CF_SQL_DECIMAL and CF_SQL_NUMERIC

此生再无相见时 提交于 2019-12-10 14:01:17
问题 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 integer to either one in a query, would there be a difference? If not, which is better to use? Is one faster? Do they have differing methods for rounding? I am using these in both query of queries (QoQ) as well as in MS-SQL queries. 回答1: If you are

CF - QoQ vs Query

我的梦境 提交于 2019-12-01 17:47:50
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 loop is not. Full DBMS are highly optimised for processing [appropriately-written] queries, and on a modern network the overhead is not going to be huge. QoQ are performed using an embedded database, which may or not be well optimised, depending on the type of query being performed. So, if the database is on a different machine, across a slow