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

Uploading the file names of my images to my database table

I'm having an issue with uploading or looping through the the file names of my images to my database table. I am able to select various images and upload the selected image on my local machine to a specific folder that I designate. After the image…
user1824615
  • 49
  • 1
  • 5
0
votes
2 answers

coldfusion queries

Anytime I'm using a query I need to log into the database (as I don't have ODBC setup to do it) SELECT * FROM dbo.UsersView WHERE UserID =…
Daniel
  • 34,125
  • 17
  • 102
  • 150
0
votes
0 answers

How to check if query and function are executed successfully?

I have function that takes few arguments then query delete will be executed. Right after that I call another function that will update table with time stamp and user id. The code that I use looks like this: remote function deleteComment(required…
espresso_coffee
  • 5,980
  • 11
  • 83
  • 193
0
votes
1 answer

Can I return columns in text form from a function with sql query in coldfusion

I want to write a function in CF, that has a query that returns multiple columns. I researched and read and could only find examples of functions with sql queries only returning the table view of the struct. How would I write a function in CF…
WeJava
  • 31
  • 6
0
votes
1 answer

MYSQL/Coldfusion CFQUERY: How do I avoid data-overwrite with SELECT t1.*, t2.*?

I'm looking for a way of doing this without listing out all of the fieldnames and using AS on each one. Maybe this is more of a mysql question. To be clear, I offer an example: table1:…
Groovetrain
  • 3,315
  • 19
  • 23
0
votes
1 answer

What is the syntax for concatenating in cfquery with access db

So, I've looked all over the web for this simple answer...and I can't find it. I am trying to search an access DB via coldfusion query. SELECT last, first, dept, location, purchasedate, (last…
Bri
  • 729
  • 2
  • 17
  • 38
0
votes
1 answer

Create cfquery object from HTML table

I know this sounds backwards... yes, I want to know how to create a cfquery object from an already created HTML table. Here's my use case: 1) I've created a cfquery object and have some data 2) I've looped over the cfquery and created the HTML…
Krusaderjake
  • 479
  • 1
  • 7
  • 19
0
votes
1 answer

How to add row values and get unique rows after they are added

I am using Coldfusion, to do a site search for my company. I have a stored procedure being called within a cfc, that returns all results for a keyword, no limits. Then I do a subquery that either restricts what data I have access to based on…
crosenblum
  • 1,869
  • 5
  • 34
  • 57
0
votes
0 answers

SQL query WHERE column IN (#list#) not returning any results

I have the next simple query : SELECT code, description FROM table WHERE code in ( #list# ) The list is created from an XML feed with listAppend():
0
votes
2 answers

cftransaction will only run first cfquery, skips over second

I'm trying to write to two different tables, both in the same database. In one CFTRANSACTION with two CFQUERY, the first CFQUERY will INSERT properly but the second (also INSERT) is just skipped over. No errors are thrown, I can see the data in the…
MLynch
  • 425
  • 1
  • 4
  • 12
0
votes
2 answers

Why can't I use a dynamic column name in this query?

I am trying to build a cfquery using a dynamic column name: SELECT MAX(LEN( #ListGetAt(ColumnList, index)# )) FROM query However, this gives me the following error: Encountered "MAX (…
froadie
  • 79,995
  • 75
  • 166
  • 235
0
votes
2 answers

Using CFQUERY and CFSELECT to pull multiple values based on selection

I have a CFQUERY pulling three columns. The following CFSELECT allows the user to make a selection from various results based on the 'display' parameter, and sets the value to the 'value' parameter. I would like to pass the third unused value of…
FrankDev
  • 15
  • 2
  • 5
0
votes
1 answer

ColdFusion to PHP: Can I make queries as easily?

I'm working for a large company that has a ton of ColdFusion web applications. They're requiring all these apps to transition to new platforms/languages. One of these applications is quite large and complex. Its target is PHP due to resource…
Chris
  • 254
  • 1
  • 11
0
votes
2 answers

Receive email alert when Coldfusion CFQUERY time limit exceeded

This morning our Amazon EC2 Windows server became nearly unresponsive, throwing 500 errors intermittently. In the CF log I see a bunch of these errors: The request has exceeded the allowable time limit Tag: CFQUERY After rebooting the server,…
Ben Chan
  • 240
  • 3
  • 10
0
votes
0 answers

CFQUERY update inner join two tables from separate servers

I have this update statement - update dbOne.tableA a inner join dbTwo.tableB b on a.docid=b.docid set a.download_dt = now(), a.document_status = "DOWNLOADED", a.rec_mod_dt = now() …
Robyn Paxton
  • 800
  • 1
  • 6
  • 21