Questions tagged [cfquery]

`` is the primary method of executing database queries and query-of-queries (QoQ) in ColdFusion/CFML.

<cfquery> is the primary method of executing database queries and query-of-queries (QoQ) in ColdFusion/CFML. The <cfquery> tag's more common attributes include:

  • name - The name by which the query will be referred in code.
  • datasource - The data source against which the query is to be executed. Conflicts with dbtype.
  • dbtype - Used with a value of query for query-of-queries (QoQ) and with a value of hql for ORM. Conflicts with datasource.
  • cachedwithin - The time span for which the query results should be cached. Note: ColdFusion caches queries according to the name and text of the query; if either changes, the query will not be cached.
  • maxrows - The maximum number of rows to be returned from the query. Use -1 to return all rows. Note: This does not affect caching (see cachedwithin above); if maxrows is changed on a cached query, the query will still return the number of rows returned when it was first cached.
  • timeout - The number of seconds ColdFusion should wait before timing out the query. If <cfsetting requesttimeout="*xxx*" /> is used, will override that value if the timeout specified for the query is used.

Also see:

(Please see the tag's documentation for additional attributes and their explanation.)

246 questions
2
votes
1 answer

Removing Transactions from cfquery s

I had some original code which looked like UPDATE ... UPDATE ... DELETE ... I am looking to change the code…
James A Mohler
  • 11,060
  • 15
  • 46
  • 72
2
votes
1 answer

ColdFusion queryExecute parameters object?

I started using cfscript in my projects recently. While working with cfscript I used queryExecute() function to run queries. In few situations there was more than one query in the same function. These queries shared some of the same parameters. I…
espresso_coffee
  • 5,980
  • 11
  • 83
  • 193
2
votes
1 answer

How to prevent Query of Queries returning case sensitive results from CFC in Coldfusion

I have an issue where I'm joining two record sets from two different datasources using Ben Nadel's QueryAppend.cfc. The data I get back is correct but the ordering of the data is not expected. The combined result set is being sorted like so with all…
cflingo
  • 47
  • 7
2
votes
3 answers

Coldfusion Looping

I need to use cfloop to insert records. There's a form a customer fills out. They add an item from a dropdown list, and then enter in a quantity in a text box. Normally, the quantity is only between 1 and 5. I need to run a loop to insert the…
2
votes
1 answer

Coldfusion Query broken column structure

A coldfusion query's column can be referenced like a 2D array from what I know of my past experience. Sometimes though I get this issue. create query from spreadsheet put column names into an array only get first element when trying to access the…
Matt Wilde
  • 271
  • 2
  • 18
2
votes
2 answers

Coldfusion CFQUERY time limit exceeded

I have a saved XML file which is 7.1mb and contains over 1000 properties and all the info for those properties. My cfscript parses and then inserts the properties into the property table along with features and image URLs to their respective…
johnnyc0506
  • 133
  • 1
  • 3
  • 12
2
votes
2 answers

Get count of specifc rows returned in cfquery

I know you can get the count of how many items are returned in your query but... Question: Is it possible to get a recordcount of rows with a specific value for example...
Denoteone
  • 4,043
  • 21
  • 96
  • 150
2
votes
2 answers

ColdFusion how to set form input values from the results of a cfquery?

Question: (part 1) I am looking for the most efficient way to set my form input values based on the results of my cfquery. My form fields all match the column names in the database. I know using cfinsert I can update the database with form input…
Denoteone
  • 4,043
  • 21
  • 96
  • 150
2
votes
3 answers

Combining query rows in a loop

I have the following ColdFusion 9 code: EXEC searchFAQ '#tagArray[i]#' The EXEC executes…
Icemanind
  • 47,519
  • 50
  • 171
  • 296
2
votes
3 answers

Using cfqueryparam with custom tag? Nesting native tags with custom tags

I basically want to allow something like: SELECT `someColumn1`, `someColumn2` FROM `#someDB#`.`#someT#` WHERE …
Alex
  • 7,743
  • 1
  • 18
  • 38
2
votes
5 answers

How to read columns with spaces from coldfusion queries?

I am reading data from a spreadsheet. One of the column in the spreadsheet contains spaces. For Example, Columns names are [first name,last name,roll]. I am getting a qryObj after reading the spreadsheet. Now when i am trying to read first name from…
Deepak Kumar Padhy
  • 4,128
  • 6
  • 43
  • 79
2
votes
3 answers

Why SQL case isn't working

I get an error;Invalid column name 'phase'. I've tried every permutation I can think of.
user990016
  • 3,208
  • 4
  • 20
  • 29
2
votes
2 answers

Using dynamic variables in query

I have a page that has an variable number of input fields (this number of fields is saved in the database). Upon submit, the information in these fields is to be saved into a database. The names of the fields are looped through and the current loop…
Lauren Robinson
  • 443
  • 2
  • 9
  • 26
2
votes
2 answers

cfquery oracle stored procedure

I had to change the SQL stored procedure to ORacle stored procddure.I am able to successfully execute my modified stored procedure in oracle. But unable to obtain the query result in CF for the Oracle stored-Procedure.I have used . Any…
vas
  • 2,078
  • 9
  • 39
  • 60
2
votes
3 answers

How do I handle null values from ColdFusion queries?

If one of the columns in the returned coldfusion query result set has a NULL, how do we check if the value of this column being NULL? Should we just say OR ?
krishna
  • 21
  • 1
  • 1
  • 3