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
1 answer

cfml, database and a multilingual website

I have a database that has four columns id,languageid,name,text Depending on the users' default language, I create a query that has all the texts for the set language (where languageid=#user.defaultlanguageid#) What's the easiest way of retrieving…
Daniel
  • 34,125
  • 17
  • 102
  • 150
0
votes
1 answer

Grid for coldfusion with popup editor - similar to Telerik RAD Grid for ASP.NET

I am looking for a grid solution that works in Coldfusion that is similar to Telerik RAD Grid for ASP.NET with a popup editor. In addition to this is must be able to connect to SQL or be modified with CFQuery tags. Your help is appreciated, I have…
kkick
  • 35
  • 4
0
votes
2 answers

CFQuery 'WHERE' from results of another query?

I'll explain the 'real life' application of this so it's easier to understand. I'm working on an eCommerce app that has a category structure. It starts at the top level and gradually moves down through subcategories. For example Home >…
Lee
  • 989
  • 2
  • 14
  • 30
0
votes
0 answers

In coldfusion, queryExecute() can i use JSON structure with {} and : for 2nd parameter 'params' type struct of struct.what are pros and cons?

I am struggling b/w two syntaxes of coldfusion. Please, Help..!! QueryExecute(sql, params, options); Normal syntax: sqlEmployees = "SELECT * FROM Employees                  WHERE empid = :empid                    AND country =…
0
votes
0 answers

Coldfusion CFML Howto share DB Results between subpages

I have a big DB Query (cfquery with many columns and rows) where the result has to be shared between two sub-webpages for scrolling all the entries back and forth. Calling the db query after switching between the pages is no options since it will be…
0
votes
1 answer

Coldfusion: need help with outputing query on one row per system instead of multiple rows

HISTORY: A system has passed through 1 - 19 or so statuses before being moved to production. I need to build a report showing the date the system passed through a status and NA if the system did not pass through a status. REQUIREMENTS: The report…
HPWD
  • 2,232
  • 4
  • 31
  • 61
0
votes
1 answer

How to use a variable in a cfquery?

I use #variable.user# to show the active user on a webpage I want to use that user to look up in a table and find their work location so I can create a custom few for each work location. How can I use that variable in a query to find their location…
newguy
  • 11
0
votes
0 answers

Coldfusion output string not defined

When I execute the code below, resources_gathered is a string, but I get the following error ('Rx222y280.....' is the string in the column resources_gathered): visualize_resources.cfm?subject_id=395229:105 Uncaught ReferenceError:…
0
votes
0 answers

How to store values from a Javascript array in SQL Table

If I have a JavaScript array, say angleChanges = [a,b,c] I want to store each of these values according to a user id (let's say it is an int). I am using SQL Server Management Studio and using ColdFusion to transfer variables to the server's SQL…
0
votes
1 answer

a MySQL SUM function

I understand the SQL sum function. This is the code I have: SELECT sum(amount) FROM expense How do I output the result of the query? I just want to…
0
votes
0 answers

How to use the js variable in Cfquery

This is the js Function , I need to use the "DataFileImportID" variable inside the Cfquery. JS Code