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
0
votes
2 answers

What's wrong with my simple insert?

I'm using coldfusion to insert the contents of a struct (key-value pairs) into a database table. This is my code: INSERT INTO web..Stuff…
froadie
  • 79,995
  • 75
  • 166
  • 235
0
votes
2 answers

CFQuery where clause comparison to query results

I have a query that returns 7 records: select equipment_id from service_ticket where equipment_id > 0 I then take those results and use run another query again them:
Brian Fleishman
  • 1,237
  • 3
  • 21
  • 43
0
votes
1 answer

Add and subtract float values from database

So I have this query to get the results from my database tables with the columns in and out. select in, out from test Now what I need to do is to take a static number, eg; 100, and ADD…
Gosi
  • 2,004
  • 3
  • 24
  • 36
0
votes
1 answer

How to access CFQUERY SUM value

I am trying to get a single numeric value from a that is performing a SUMPRODUCT calc. I know that the the following code works to produce the desired value (verified through ). I just need to know how to get that value as…
BirdDog
  • 3
  • 4
0
votes
1 answer

Insert query error: Column count doesn't match value count at row 1

I have a cfquery that I'm looping over the values to insert multiple rows into the database. I have to do it this way, instead of generating multiple INSERT queries within a loop, because I need a list of the generatedKeys after the INSERT. However…
Charles L.
  • 1,844
  • 2
  • 34
  • 56
0
votes
1 answer

Ext JS Dependent combo box

I am new to extJS, and trying to implement the following functionality: I have two select drop down menus, transformed using extJS. How can I make sure that if a value in one combo box is selected, the other value should be set back to some default…
DG3
  • 5,070
  • 17
  • 49
  • 61
0
votes
3 answers

CFQuery Giving Odd Internal Server 500 Error

SELECT * FROM BusinessDirectory ORDER BY businessname
0
votes
2 answers

Having trouble grouping CFQuery results

I have a CFQuery to pull data from a table which I would like to output to the screen in a format that groups the data according to one of the columns, 'Company Name'. I can't seem to wrap my head around the logic for this. Currently I'm just…
Brian Fleishman
  • 1,237
  • 3
  • 21
  • 43
0
votes
1 answer

Coldfusion: form.fieldname and session.fieldname

I'm a new comer to ColdFusion and am trying to convert CF web app to ASP.NET web app. We've Index.cfm file and a template Manage.cfm file. If a user clicks on a link in Index.cfm it opens a URL with something like…
nam
  • 21,967
  • 37
  • 158
  • 332
0
votes
2 answers

How to build an array from list and cfquery?

I'm trying to build an array that will give me all values from my list and then based on the records from the cfquery I wan to get values for years. To make this more clear I will show you below how my array should look like: time slot year2015 …
espresso_coffee
  • 5,980
  • 11
  • 83
  • 193
0
votes
1 answer

Dynamically adding column

Sometimes I need to add a column to an empty table if (listfind(arguments.config[3], "payout")) { QueryAddColumn(local.qryResult, "payout", "cf_sql_float"); } I get an error that looks like It seems to want a java.util.List Isn't…
James A Mohler
  • 11,060
  • 15
  • 46
  • 72
0
votes
1 answer

Run a cfquery inside of a query output

I am getting weird unexpected results when I try to run a cfquery inside of the output of a previous query. Example: #id# #name#
Denoteone
  • 4,043
  • 21
  • 96
  • 150
0
votes
1 answer

ColdFusion: Using the same query throughout the page

This seems like it should be easy, but man, I'm such a novice at some of this stuff. I feel like I've seen it done, so please bear with me if this is a dumb issue. I have multiple cfifs set up on the page to filter out specific user groups when a…
Big Mike
  • 119
  • 10
0
votes
2 answers

not retrieving DATA

I am unable to retrieve any data from my cfquery. Same query when i run in sql developer i get the result. Any reason why ? Hi all, thanks for the responses. Sorry, it was my fault. It was a data issue. I was retrieving uncommited data from CF.
Somu
  • 131
  • 7
0
votes
1 answer

Execution halts at CFQuery

For some strange reason this simple INSERT statement in my CFQUERY tag just halts the page load. I have plenty of SELECT statements around my site, but the results on screen output the "Before SQL" dump and then end. It must be something simple…