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
4 answers

How to populate a dynamically created dropdown box in a using javascript and coldfusion

I have a dropdown box in a row that was dynamically created. I'm populating that box on within the screen. Is there a way that I can use cfquery to get the info from the sql server and populate the dropdown box. I would like to do it within the…
tnlewis
  • 323
  • 1
  • 3
  • 15
0
votes
1 answer

Coldfusion (Solr) search behavior

I have this "indexer" template: SELECT id, name, brand FROM products
Fabio B.
  • 9,138
  • 25
  • 105
  • 177
0
votes
1 answer

Passing JavaScript variables to a ColdFusion query

I have an update query to which I am passing a JavaScript array called "newdata", obviously, that didn't work so I don't know how to pass my JavaScript variables to ColdFusion in order to run an update query. How I can see surfing some webs?…
Enot
  • 790
  • 2
  • 15
  • 34
0
votes
1 answer

Does Caching in ColdFusion returns the updated data and Cache again?

No code required.. Just asking. (Please bear with me, English is not my primary language) Here is the scenario. I cache a query for 2 hours, and the data is updated in the database before 2 hours are completed. So my question is will the new data…
Nayeem Junaid
  • 53
  • 1
  • 3
  • 10
0
votes
1 answer

Dynamic tablename in DAO.cfc?

I'm writing a subsystem that tables might be renamed from project to project. Instead of asking the user of my subsystem to search & replace before using it, does this work? SELECT col1, col2, col3 …
Henry
  • 32,689
  • 19
  • 120
  • 221
0
votes
2 answers

Using onRequest as a pre processor

Is it possible to pre-process cfquery commands such that cfqueryparam is wrapped around the parameters? Example: SELECT FirstName FROM Person WHERE PersonID = #arguments.PersonID# Q: Could onRequest pre-process…
Phillip Senn
  • 46,771
  • 90
  • 257
  • 373
0
votes
1 answer

Coldfusion Databases storing acting wonky

So Coldfusion is acting wonky today. I can't seem to update DB. For example if I try to query this : SELECT * FROM UsersExpDataTR2 WHERE session_id = 2 AND p1_id = 2 AND round =…
Anthony Tantillo
  • 300
  • 1
  • 3
  • 12
0
votes
2 answers

How to create a function in CFML within some SQL queries?

I would like to create a function in CFML taking 3 parameters (a number and two dates). The function will then perform a few cfquery queries on these data like SELECT, UPDATE and INSERT...Any idea on how to code this function ? I'm a cfml newbie so…
Stephane
  • 4,978
  • 9
  • 51
  • 86
0
votes
2 answers

How to call an INSERT query by name?

I've to clone a class ID #FORM.classid# several times but instead of writing the INSERT sql query each time I need it, is there any solution to just write it one time and call the query with its addClass name ? I wish I know how to code functions…
Stephane
  • 4,978
  • 9
  • 51
  • 86
0
votes
5 answers

Why does adding "AND 1=1" fix SQL query in Coldfusion?

There have been several times when I've created a cfquery and for no good reason, it doesn't work. For example, I recently had a query like this: SELECT * FROM projects …
Nick Petrie
  • 5,364
  • 11
  • 41
  • 50
0
votes
4 answers

Coldfusion: Move data from one datasource to another

I need to move a series of tables from one datasource to another. Our hosting company doesn't give shared passwords amongst the databases so I can't write a SQL script to handle it. The best option is just writing a little coldfusion scripty that…
Rumpleteaser
  • 4,142
  • 6
  • 39
  • 52
0
votes
4 answers

Having trouble with a SQL Join in ColdFusion

I'm trying to do something very simple in CF/SQL but just can't seem to figure out what I am doing wrong. I have these tables: movies genres actors moviesGenres moviesActors ------ ------ ------ ------------ …
Gary
  • 453
  • 4
  • 15
-1
votes
1 answer

Sorting values by property from cfoutput

This question for cold fusion programmers, and will be probably asked by me wrongly, because it is open question and actually can't be answered, coz u and me will be in a lack of inf about it :) But still all i need is just a hint or guess about it,…
abrabr
  • 217
  • 5
  • 14
-1
votes
2 answers

Coldfusion cfquery in Jquery

Why Won't this work? $("#selection").change(function () { description = $("#selection").val(); console.log(description); SELECT d.description FROM descriptionmap d,…
Jon Sandness
  • 139
  • 1
  • 1
  • 13
-1
votes
1 answer

insert into query not working in coldfusion?

Please check my query below INSERT INTO user (user_id, group_id) VALUES (#form.usr_id#,#form.access_flg#) But I am getting Error executing database query I am able to fetch the data…
Soujanya
  • 277
  • 4
  • 17
1 2 3
16
17