CFQUERY Question
I'm running into an odd behavior with CFQUERY (at least I think it is odd) I have the following code (example) cfquery name=blahName datasource=blah SELECT blah FROM blah WHERE blah = 1 /cfquery CFIF blahName.recordCount GT 0 12345 /CFIF if the query blahName returns no results, I thought i would still be able to access blahName.recordCount Am I wrong on this, or is there something else I am overlooking? Thanks -Dave ~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:332498 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
RE: CFQUERY Question
Your cfif statement asks for the recordCount to be returned on if the recordCount is greater than 0. Try cfif blahName.recordcount GTE 0 and you should get the recordCount either way. Rick -Original Message- From: Dave Sueltenfuss [mailto:dsueltenf...@gmail.com] Sent: Wednesday, March 31, 2010 1:59 PM To: cf-talk Subject: CFQUERY Question I'm running into an odd behavior with CFQUERY (at least I think it is odd) I have the following code (example) cfquery name=blahName datasource=blah SELECT blah FROM blah WHERE blah = 1 /cfquery CFIF blahName.recordCount GT 0 12345 /CFIF if the query blahName returns no results, I thought i would still be able to access blahName.recordCount Am I wrong on this, or is there something else I am overlooking? Thanks -Dave ~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:332499 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: CFQUERY Question
You are correct, the record count for an empty query object does exist (and should be 0). What exactly is not working? Are you getting an error message? On Wed, Mar 31, 2010 at 1:59 PM, Dave Sueltenfuss dsueltenf...@gmail.comwrote: I'm running into an odd behavior with CFQUERY (at least I think it is odd) I have the following code (example) cfquery name=blahName datasource=blah SELECT blah FROM blah WHERE blah = 1 /cfquery CFIF blahName.recordCount GT 0 12345 /CFIF if the query blahName returns no results, I thought i would still be able to access blahName.recordCount Am I wrong on this, or is there something else I am overlooking? Thanks -Dave ~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:332500 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
RE: CFQUERY Question
You are correct that it should work, but they maybe something else in the code which is preventing the query from being executed. On the top of your page add: cfparam name= blahName.recordcount default=0 And that will deal with the case where the query is not executed. Robert B. Harrison Director of Interactive Services Austin Williams 125 Kennedy Drive, Suite 100 Hauppauge NY 11788 P : 631.231.6600 Ext. 119 F : 631.434.7022 http://www.austin-williams.com Great advertising can't be either/or. It must be . Plug in to our blog: AW Unplugged http://www.austin-williams.com/unplugged -Original Message- From: Dave Sueltenfuss [mailto:dsueltenf...@gmail.com] Sent: Wednesday, March 31, 2010 1:59 PM To: cf-talk Subject: CFQUERY Question I'm running into an odd behavior with CFQUERY (at least I think it is odd) I have the following code (example) cfquery name=blahName datasource=blah SELECT blah FROM blah WHERE blah = 1 /cfquery CFIF blahName.recordCount GT 0 12345 /CFIF if the query blahName returns no results, I thought i would still be able to access blahName.recordCount Am I wrong on this, or is there something else I am overlooking? Thanks -Dave ~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:332501 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: CFQUERY Question
Ok, found the cause of the issue, by taking the query into SQL Server In SQL, the following is being returned *Warning: Null value is eliminated by an aggregate or other SET operation. (0 row(s) affected)* So it appears this is what is throwing off the query results in CF I am working on resolving this issue now. -Dave On Wed, Mar 31, 2010 at 2:18 PM, Robert Harrison rob...@austin-williams.com wrote: You are correct that it should work, but they maybe something else in the code which is preventing the query from being executed. On the top of your page add: cfparam name= blahName.recordcount default=0 And that will deal with the case where the query is not executed. Robert B. Harrison Director of Interactive Services Austin Williams 125 Kennedy Drive, Suite 100 Hauppauge NY 11788 P : 631.231.6600 Ext. 119 F : 631.434.7022 http://www.austin-williams.com Great advertising can't be either/or. It must be . Plug in to our blog: AW Unplugged http://www.austin-williams.com/unplugged -Original Message- From: Dave Sueltenfuss [mailto:dsueltenf...@gmail.com] Sent: Wednesday, March 31, 2010 1:59 PM To: cf-talk Subject: CFQUERY Question I'm running into an odd behavior with CFQUERY (at least I think it is odd) I have the following code (example) cfquery name=blahName datasource=blah SELECT blah FROM blah WHERE blah = 1 /cfquery CFIF blahName.recordCount GT 0 12345 /CFIF if the query blahName returns no results, I thought i would still be able to access blahName.recordCount Am I wrong on this, or is there something else I am overlooking? Thanks -Dave ~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:332502 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: CFQUERY Question
If the query is executing correctly but bringing back no records, this should work with blahname.recordcount equal zero . If the query is not executing correctly, blahname.recordcount will not equal zero. On Wed, Mar 31, 2010 at 10:59 AM, Dave Sueltenfuss dsueltenf...@gmail.com wrote: I'm running into an odd behavior with CFQUERY (at least I think it is odd) I have the following code (example) cfquery name=blahName datasource=blah SELECT blah FROM blah WHERE blah = 1 /cfquery CFIF blahName.recordCount GT 0 12345 /CFIF if the query blahName returns no results, I thought i would still be able to access blahName.recordCount Am I wrong on this, or is there something else I am overlooking? Thanks -Dave ~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:332503 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: CFQUERY Question
On Wednesday 07 Jan 2009, Andrew Tegenkamp wrote: can I fix it? You can, but shouldn't. Constructing raw SQL strings is dangerous, security wise. I expect your real use case is more complex, but rewriting it to : cfquery name=insert datasource=#DSN# INSERT INTO users(userName) VALUES(cfqueryparam value=andrew/) /cfquery is trivial. -- Tom Chiverton Helping to synergistically negotiate fourth-generation next-generation metrics This email is sent for and on behalf of Halliwells LLP. Halliwells LLP is a limited liability partnership registered in England and Wales under registered number OC307980 whose registered office address is at Halliwells LLP, 3 Hardman Square, Spinningfields, Manchester, M3 3EB. A list of members is available for inspection at the registered office together with a list of those non members who are referred to as partners. We use the word ?partner? to refer to a member of the LLP, or an employee or consultant with equivalent standing and qualifications. Regulated by the Solicitors Regulation Authority. CONFIDENTIALITY This email is intended only for the use of the addressee named above and may be confidential or legally privileged. If you are not the addressee you must not read it and must not use any information contained in nor copy it nor inform any person other than Halliwells LLP or the addressee of its existence or contents. If you have received this email in error please delete it and notify Halliwells LLP IT Department on 0870 365 2500. For more information about Halliwells LLP visit www.halliwells.com. ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:317604 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
CFQUERY Question
I have a SQL statement that is easier to build and save as a variable but it throws an error when I do this: cfset strSQL2 = INSERT INTO users(userName) VALUES('andrew') cfquery name=insert datasource=#DSN# #strSQL2# /cfquery The error says it is trying to insert the values with two '': SQL: INSERT INTO users(userName) VALUES(''andrew'') If I put the SQL code into the CFQUERY tag it is fine. Why is this and can I fix it? ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:317533 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: CFQUERY Question
Andrew Tegenkamp wrote: Why is this Because CF automatically escapes all single quotes in variables used inside of a CFQUERY... block. and can I fix it? Use the perserveSingleQuotes() function whose purpose is to over ride this default behavior. Just be aware that if you are not careful, it is really easy to open yourself up to all kinds of potential for SQL injection attacks with this kind of functionality. ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:317534 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
CFQuery Question
Does anyone know how to delete duplicate records from a table and leave only one record in the table using CFQUERY. ~| Logware (www.logware.us): a new and convenient web-based time tracking application. Start tracking and documenting hours spent on a project or with a client with Logware today. Try it for free with a 15 day trial account. http://www.houseoffusion.com/banners/view.cfm?bannerid=67 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:192100 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54
Re: CFQuery Question
Select Distinct * INTO #temp From mytable truncate TABLE my table Insert into myTable Select * From #temp or thats the psuedo code for it...not sure the exact syntax is right Adam H On Fri, 28 Jan 2005 08:14:14 -0800 (PST), Discover Antartica [EMAIL PROTECTED] wrote: Does anyone know how to delete duplicate records from a table and leave only one record in the table using CFQUERY. ~| Find out how CFTicket can increase your company's customer support efficiency by 100% http://www.houseoffusion.com/banners/view.cfm?bannerid=49 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:192101 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54
cfoutput and cfquery question ...
Hello, I was wondering if there was a easy way to run a quick query and have it display all of the results with out know in column names? Example -- CFQUERY NAME=q_Info DATASOURCE=dbeta1 SELECT * FROM DOCS /CFQUERY cfoutput query=q_Info startrow=1 maxrows=50 #q_Info.queryoutput#br --- This is what I need help with :-) /cfoutput Thanks, - Charles [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]
Re: cfoutput and cfquery question ...
Loop thru query.ColumnNames On Aug 28, 2004, at 12:06 PM, Charles Heizer wrote: Hello, I was wondering if there was a easy way to run a quick query and have it display all of the results with out know in column names? Example -- CFQUERY NAME=q_Info DATASOURCE=dbeta1 SELECT * FROM DOCS /CFQUERY cfoutput query=q_Info startrow=1 maxrows=50 #q_Info.queryoutput#br --- This is what I need help with :-) /cfoutput Thanks, - Charles [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]
RE: cfoutput and cfquery question ...
you could always use cfdump var=#q_info# or you could loop through the q_info.columnlist variable. -Original Message- From: Charles Heizer [mailto:[EMAIL PROTECTED] Sent: Saturday, August 28, 2004 2:07 PM To: CF-Talk Subject: cfoutput and cfquery question ... Hello, I was wondering if there was a easy way to run a quick query and have it display all of the results with out know in column names? Example -- CFQUERY NAME=q_Info DATASOURCE=dbeta1 SELECT * FROM DOCS /CFQUERY cfoutput query=q_Info startrow=1 maxrows=50 #q_Info.queryoutput#br --- This is what I need help with :-) /cfoutput Thanks, - Charles [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]
Re: cfoutput and cfquery question ...
Here you go ... cfquery name='blah' ../ cfoutput query='blah' cfloop list='#blah.columnlist#' index='col' #col# = #evaluate(col)# /cfloop /cfoutput - Joe [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]
Re: cfoutput and cfquery question ...
This was just what I was looking for ... Thanks a bunch! - Charles Here you go ... cfquery name='blah' ../ cfoutput query='blah' cfloop list='#blah.columnlist#' index='col' #col# = #evaluate(col)# /cfloop /cfoutput - Joe [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]
CFquery question on simultaneous lookup
hi all, I have a situation where I have to read the data from the table while the other script is inserting data at the same time. Means I have a cgi script which inserts data and cfm page is calling that inserted data till it finds end word in one of the field. How I can do that using cfflush. I have to search the data and display it at the same time look for the new records added to the table till I get END form one of the field. I tried cfquery and loop but problem is cfquery will only return 1 record how can I tell it to start again till I get END and do not look for already searched results. Has anybody done like this, if so any help is appreciated. Ketan [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
cfquery question???
SELECT title,template,layout,meta_description,short_description,keywords,conten t,image_a,image_b,image_c, build_date,state FROM #request.departmentTable# WHERE id = #url.id# how could this query above possibly bomb when in cfquery tag, yet not in query analyzer when i know that url.id = 175 and that the column type is int? thanks tony tony weeg [EMAIL PROTECTED] www.revolutionwebdesign.com rEvOlUtIoN wEb DeSiGn 410.334.6331 ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribeforumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Signup for the Fusion Authority news alert and keep up with the latest news in ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: cfquery question???
Are you sure request.departmentTable is a valid table? === Raymond Camden, ColdFusion Jedi Master for Mindseye, Inc (www.mindseye.com) Member of Team Macromedia (http://www.macromedia.com/go/teammacromedia) Email: [EMAIL PROTECTED] Blog : www.camdenfamily.com/morpheus/blog Yahoo IM : morpheus My ally is the Force, and a powerful ally it is. - Yoda -Original Message- From: Tony Weeg [mailto:[EMAIL PROTECTED] Sent: Monday, July 28, 2003 6:46 PM To: CF-Talk Subject: cfquery question??? SELECT title,template,layout,meta_description,short_description,keywo rds,conten t,image_a,image_b,image_c, build_date,state FROM #request.departmentTable# WHERE id = #url.id# how could this query above possibly bomb when in cfquery tag, yet not in query analyzer when i know that url.id = 175 and that the column type is int? thanks tony tony weeg [EMAIL PROTECTED] www.revolutionwebdesign.com rEvOlUtIoN wEb DeSiGn 410.334.6331 ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribeforumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Your ad could be here. Monies from ads go to support these lists and provide more resources for the community. http://www.fusionauthority.com/ads.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: cfquery question???
Best bet is to activate debugging and see what the actual query being executed is. That'll let you know for sure what each variable is equal to at the time of query execution. Also, are you sure that the table name is correct? -- Mosh Teitelbaum evoch, LLC Tel: (301) 942-5378 Fax: (301) 933-3651 Email: [EMAIL PROTECTED] WWW: http://www.evoch.com/ -Original Message- From: Tony Weeg [mailto:[EMAIL PROTECTED] Sent: Monday, July 28, 2003 8:46 PM To: CF-Talk Subject: cfquery question??? SELECT title,template,layout,meta_description,short_description,keywords,conten t,image_a,image_b,image_c, build_date,state FROM #request.departmentTable# WHERE id = #url.id# how could this query above possibly bomb when in cfquery tag, yet not in query analyzer when i know that url.id = 175 and that the column type is int? thanks tony tony weeg [EMAIL PROTECTED] www.revolutionwebdesign.com rEvOlUtIoN wEb DeSiGn 410.334.6331 ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribeforumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Get the mailserver that powers this list at http://www.coolfusion.com Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: cfquery question???
below is what i can output on the page, first you see 175, that is the value of url.id, 3 is the len of the string url.id and you can view, the site at http://www.revolutionwebdesign.com/clients/armynavy/site/department.cfm tony. also in the debug text, you can see SELECT * FROM armyNavy_departments WHERE id = 175 as the query that it Tried to parse well, when that gets dropped into query analyzer its all good, i get the data im supps to get...i dont understand this one :( ? tw --- 175 3 Error Occurred While Processing Request Error Executing Database Query. [Macromedia][SequeLink JDBC Driver][ODBC Socket][Microsoft][ODBC SQL Server Driver]Numeric value out of range The error occurred in D:\www\clients\armyNavy\site\department.cfm: line 60 58 :SELECT * 59 :FROM #request.departmentTable# 60 :WHERE id = #url.id# 61 : /cfquery 62 : SQLSELECT * FROM armyNavy_departments WHERE id = 175 DATASOURCE armyNavySD3 SQLSTATE 22003 Browser Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.0.3705) Remote Address 127.0.0.1 Referrer Date/Time 28-Jul-03 08:53 PM Stack Trace (click to expand) -Original Message- From: Raymond Camden [mailto:[EMAIL PROTECTED] Sent: Monday, July 28, 2003 8:52 PM To: CF-Talk Subject: RE: cfquery question??? Are you sure request.departmentTable is a valid table? === Raymond Camden, ColdFusion Jedi Master for Mindseye, Inc (www.mindseye.com) Member of Team Macromedia (http://www.macromedia.com/go/teammacromedia) Email: [EMAIL PROTECTED] Blog : www.camdenfamily.com/morpheus/blog Yahoo IM : morpheus My ally is the Force, and a powerful ally it is. - Yoda -Original Message- From: Tony Weeg [mailto:[EMAIL PROTECTED] Sent: Monday, July 28, 2003 6:46 PM To: CF-Talk Subject: cfquery question??? SELECT title,template,layout,meta_description,short_description,keywo rds,conten t,image_a,image_b,image_c, build_date,state FROM #request.departmentTable# WHERE id = #url.id# how could this query above possibly bomb when in cfquery tag, yet not in query analyzer when i know that url.id = 175 and that the column type is int? thanks tony tony weeg [EMAIL PROTECTED] www.revolutionwebdesign.com rEvOlUtIoN wEb DeSiGn 410.334.6331 ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribeforumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq This list and all House of Fusion resources hosted by CFHosting.com. The place for dependable ColdFusion Hosting. http://www.cfhosting.com Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: cfquery question???
does #request.departmenttable# contain special chars? i'd recommend escaping it with [brackets] either way, if you're on SQL Server or Access. `backticks` will do it for MySQL, and I don't know about anything else. --- Barney Boisvert, Senior Development Engineer AudienceCentral [EMAIL PROTECTED] voice : 360.756.8080 x12 fax : 360.647.5351 www.audiencecentral.com -Original Message- From: Tony Weeg [mailto:[EMAIL PROTECTED] Sent: Monday, July 28, 2003 5:46 PM To: CF-Talk Subject: cfquery question??? SELECT title,template,layout,meta_description,short_description,keywords,conten t,image_a,image_b,image_c, build_date,state FROM #request.departmentTable# WHERE id = #url.id# how could this query above possibly bomb when in cfquery tag, yet not in query analyzer when i know that url.id = 175 and that the column type is int? thanks tony tony weeg [EMAIL PROTECTED] www.revolutionwebdesign.com rEvOlUtIoN wEb DeSiGn 410.334.6331 ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribeforumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Get the mailserver that powers this list at http://www.coolfusion.com Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: cfquery question???
below is what i can output on the page, first you see 175, that is the value of url.id, 3 is the len of the string url.id and you can view, the site at http://www.revolutionwebdesign.com/clients/armynavy/site/department.cfm In the error message, it seems to have a problem with the 175. What's the datatype on that id column? Also, have you tried using cfqueryparam to see if MX will cast that value to the appropriate type? Just a couple thoughts. Regards, Dave. ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribeforumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Your ad could be here. Monies from ads go to support these lists and provide more resources for the community. http://www.fusionauthority.com/ads.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: cfquery question???
that parses out to armyNavy_departments all day long. -Original Message- From: Barney Boisvert [mailto:[EMAIL PROTECTED] Sent: Monday, July 28, 2003 8:57 PM To: CF-Talk Subject: RE: cfquery question??? does #request.departmenttable# contain special chars? i'd recommend escaping it with [brackets] either way, if you're on SQL Server or Access. `backticks` will do it for MySQL, and I don't know about anything else. --- Barney Boisvert, Senior Development Engineer AudienceCentral [EMAIL PROTECTED] voice : 360.756.8080 x12 fax : 360.647.5351 www.audiencecentral.com -Original Message- From: Tony Weeg [mailto:[EMAIL PROTECTED] Sent: Monday, July 28, 2003 5:46 PM To: CF-Talk Subject: cfquery question??? SELECT title,template,layout,meta_description,short_description,keywords,conten t,image_a,image_b,image_c, build_date,state FROM #request.departmentTable# WHERE id = #url.id# how could this query above possibly bomb when in cfquery tag, yet not in query analyzer when i know that url.id = 175 and that the column type is int? thanks tony tony weeg [EMAIL PROTECTED] www.revolutionwebdesign.com rEvOlUtIoN wEb DeSiGn 410.334.6331 ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribeforumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Get the mailserver that powers this list at http://www.coolfusion.com Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: cfquery question???
see reply to ray. of course i checked all that, this is on my dev box @ home... :) i can see all that !!! see my reply! tw -Original Message- From: Mosh Teitelbaum [mailto:[EMAIL PROTECTED] Sent: Monday, July 28, 2003 8:54 PM To: CF-Talk Subject: RE: cfquery question??? Best bet is to activate debugging and see what the actual query being executed is. That'll let you know for sure what each variable is equal to at the time of query execution. Also, are you sure that the table name is correct? -- Mosh Teitelbaum evoch, LLC Tel: (301) 942-5378 Fax: (301) 933-3651 Email: [EMAIL PROTECTED] WWW: http://www.evoch.com/ -Original Message- From: Tony Weeg [mailto:[EMAIL PROTECTED] Sent: Monday, July 28, 2003 8:46 PM To: CF-Talk Subject: cfquery question??? SELECT title,template,layout,meta_description,short_description,keywords,conten t,image_a,image_b,image_c, build_date,state FROM #request.departmentTable# WHERE id = #url.id# how could this query above possibly bomb when in cfquery tag, yet not in query analyzer when i know that url.id = 175 and that the column type is int? thanks tony tony weeg [EMAIL PROTECTED] www.revolutionwebdesign.com rEvOlUtIoN wEb DeSiGn 410.334.6331 ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribeforumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Your ad could be here. Monies from ads go to support these lists and provide more resources for the community. http://www.fusionauthority.com/ads.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: cfquery question???
thats how the original code was...this is from site director3 and its not my code, i have to get in and hack it so that the client can finally have their site up, i cant wait to ftp it to experthost.com to see what issues i have, but that doesnt happen until i get it complete, here on my devbox @ home. anyway, here is how the code originally read, and the mssql200 data type is most certainly int(4), im fairly good with this thing we call cf, however, this one has me a bit perplexed??? does anyway else use sitedirector 3, tell me what they have experienced this really is starting to get frustrating thanks! tony -Original Message- From: Dave Carabetta [mailto:[EMAIL PROTECTED] Sent: Monday, July 28, 2003 9:03 PM To: CF-Talk Subject: Re: cfquery question??? below is what i can output on the page, first you see 175, that is the value of url.id, 3 is the len of the string url.id and you can view, the site at http://www.revolutionwebdesign.com/clients/armynavy/site/department.cfm In the error message, it seems to have a problem with the 175. What's the datatype on that id column? Also, have you tried using cfqueryparam to see if MX will cast that value to the appropriate type? Just a couple thoughts. Regards, Dave. ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribeforumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Your ad could be here. Monies from ads go to support these lists and provide more resources for the community. http://www.fusionauthority.com/ads.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: cfquery question???
ok, change the datasource in the admin to microsoft sql server and not odbc datasocket, and WHATTA YA KNOW it works perfectly is that a bug? this is redsky...should i notify the beta boys or should i have not mentioned anything about it here? tony -Original Message- From: Tony Weeg [mailto:[EMAIL PROTECTED] Sent: Monday, July 28, 2003 9:10 PM To: CF-Talk Subject: RE: cfquery question??? thats how the original code was...this is from site director3 and its not my code, i have to get in and hack it so that the client can finally have their site up, i cant wait to ftp it to experthost.com to see what issues i have, but that doesnt happen until i get it complete, here on my devbox @ home. anyway, here is how the code originally read, and the mssql200 data type is most certainly int(4), im fairly good with this thing we call cf, however, this one has me a bit perplexed??? does anyway else use sitedirector 3, tell me what they have experienced this really is starting to get frustrating thanks! tony -Original Message- From: Dave Carabetta [mailto:[EMAIL PROTECTED] Sent: Monday, July 28, 2003 9:03 PM To: CF-Talk Subject: Re: cfquery question??? below is what i can output on the page, first you see 175, that is the value of url.id, 3 is the len of the string url.id and you can view, the site at http://www.revolutionwebdesign.com/clients/armynavy/site/department.cfm In the error message, it seems to have a problem with the 175. What's the datatype on that id column? Also, have you tried using cfqueryparam to see if MX will cast that value to the appropriate type? Just a couple thoughts. Regards, Dave. ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribeforumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Signup for the Fusion Authority news alert and keep up with the latest news in ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
CFQUERY Question to populate a drop down for search
CFQUERY Question to populate a drop down for search I'm looking for a way to query a database table and display the results with out any diplicates. The WHERE city is unique does not work. CFQUERY name=getcity DATASOURCE=datasource SELECT city FROM profiles WHERE city is unique /CFQUERY CFOUTPUT query=getcity OPTION VALUE='#getcity.city#'#getcity.city#/OPTION /CFOUTPUT __ This list and all House of Fusion resources hosted by CFHosting.com. The place for dependable ColdFusion Hosting. FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: CFQUERY Question to populate a drop down for search
You could use: SELECT DISTINCT city FROM profiles Alex -Original Message- From: Brian Simpson [mailto:[EMAIL PROTECTED]] Sent: 29 May 2002 10:32 To: CF-Talk Subject: CFQUERY Question to populate a drop down for search CFQUERY Question to populate a drop down for search I'm looking for a way to query a database table and display the results with out any diplicates. The WHERE city is unique does not work. CFQUERY name=getcity DATASOURCE=datasource SELECT city FROM profiles WHERE city is unique /CFQUERY CFOUTPUT query=getcity OPTION VALUE='#getcity.city#'#getcity.city#/OPTION /CFOUTPUT __ Signup for the Fusion Authority news alert and keep up with the latest news in ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: CFQUERY Question to populate a drop down for search
You could use: SELECT DISTINCT city FROM profiles Not forgetting to ORDER BY the query, otherwise it can appear pseudo-random Philip Arnold Technical Director Certified ColdFusion Developer ASP Multimedia Limited Switchboard: +44 (0)20 8680 8099 Fax: +44 (0)20 8686 7911 www.aspmedia.co.uk www.aspevents.net An ISO9001 registered company. ** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. ** __ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: CFQUERY Question to populate a drop down for search
If you want the results sorted on the DISTINCT column(s) there's no need to include an order by. The SQL engine must sort the results on those fields to determine uniqueness. It's probably a good practice to include an order by anyway, just for clarity. /rob -Original Message- From: Philip Arnold - ASP [mailto:[EMAIL PROTECTED]] Sent: Wednesday, May 29, 2002 5:57 AM To: CF-Talk Subject: RE: CFQUERY Question to populate a drop down for search You could use: SELECT DISTINCT city FROM profiles Not forgetting to ORDER BY the query, otherwise it can appear pseudo-random Philip Arnold Technical Director Certified ColdFusion Developer ASP Multimedia Limited Switchboard: +44 (0)20 8680 8099 Fax: +44 (0)20 8686 7911 www.aspmedia.co.uk www.aspevents.net An ISO9001 registered company. ** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. ** __ Get the mailserver that powers this list at http://www.coolfusion.com FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: cfquery Question
select * from sysobjects where type = 'u' order by name Mark Stewart [EMAIL PROTECTED] on 09/06/2001 02:23:36 PM Please respond to [EMAIL PROTECTED] To: CF-Talk [EMAIL PROTECTED] cc: Subject: RE: cfquery Question There is a SqL Server stored procedure that will describe a database for you. Off the top of my head, I can't remember the name of it but you can find it in books on line. If I can remember the name, I'll pass it along. Mark -Original Message- From: Edward Chanter [mailto:[EMAIL PROTECTED]] Sent: Thursday, September 06, 2001 8:10 AM To: CF-Talk Subject: cfquery Question I'm probably being a dunce here but does anyone know a sql query that will list out all the tables in a particular sql7 database...? Thanks in advance... -= Ed ~~ Get the mailserver that powers this list at http://www.coolfusion.com FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
Re: cfquery Question
sp_tables and sp_databases? Try connecting to the MASTER database ( if you can ) and TRY: SELECT * FROM SYSFILES SELECT * FROM SYSFILES1 SELECT * FROM DATABASES SELECT * FROM SYSPERFINFO Also, sp_databses and sp_tables are in plain text if you go through Enterprise Manager to the Stored Srocedures section. Tim - Original Message - From: Mark Stewart [EMAIL PROTECTED] To: CF-Talk [EMAIL PROTECTED] Sent: Thursday, September 06, 2001 15:23 Subject: RE: cfquery Question There is a SqL Server stored procedure that will describe a database for you. Off the top of my head, I can't remember the name of it but you can find it in books on line. If I can remember the name, I'll pass it along. Mark -Original Message- From: Edward Chanter [mailto:[EMAIL PROTECTED]] Sent: Thursday, September 06, 2001 8:10 AM To: CF-Talk Subject: cfquery Question I'm probably being a dunce here but does anyone know a sql query that will list out all the tables in a particular sql7 database...? Thanks in advance... -= Ed ~~ Get the mailserver that powers this list at http://www.coolfusion.com FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
Re: cfquery Question
What your looking for is: CFQUERY Name=myTables Datasource=yourDataSource SELECT * FROM sysobjects WHERE xtype = 'U' /CFQUERY Type U is user tables and S is system tables. There are others, but I'm not sure what they are. Steven Durette MGR. - Engineering Construction System Support Database Administrator/Web Developer Ameritech/SBC (810)466-7654 [Office] [EMAIL PROTECTED] [work email] [EMAIL PROTECTED] [work email] - Original Message - From: Edward Chanter [EMAIL PROTECTED] To: CF-Talk [EMAIL PROTECTED] Sent: Thursday, September 06, 2001 8:09 AM Subject: cfquery Question I'm probably being a dunce here but does anyone know a sql query that will list out all the tables in a particular sql7 database...? Thanks in advance... -= Ed ~~ Get the mailserver that powers this list at http://www.coolfusion.com FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
cfquery Question
I'm probably being a dunce here but does anyone know a sql query that will list out all the tables in a particular sql7 database...? Thanks in advance... -= Ed ~~ Get the mailserver that powers this list at http://www.coolfusion.com FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: cfquery Question
There is a SqL Server stored procedure that will describe a database for you. Off the top of my head, I can't remember the name of it but you can find it in books on line. If I can remember the name, I'll pass it along. Mark -Original Message- From: Edward Chanter [mailto:[EMAIL PROTECTED]] Sent: Thursday, September 06, 2001 8:10 AM To: CF-Talk Subject: cfquery Question I'm probably being a dunce here but does anyone know a sql query that will list out all the tables in a particular sql7 database...? Thanks in advance... -= Ed ~~ Get the mailserver that powers this list at http://www.coolfusion.com FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: CFQUERY question
Like what? What exactly are you looking for? CREATE, ALTER, AND DROP work... -Original Message- From: Pooh Bear [mailto:[EMAIL PROTECTED]] Sent: Monday, July 30, 2001 2:26 PM To: CF-Talk Subject: CFQUERY question hey can i do Full SQL programming inside cfquery tags? or is it limited to inserts updates, and such? ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
CFQUERY question
hey can i do Full SQL programming inside cfquery tags? or is it limited to inserts updates, and such? ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: CFQUERY question
hey can i do Full SQL programming inside cfquery tags? or is it limited to inserts updates, and such? No, on most platforms you should be able to write whatever SQL batch you want within a CFQUERY. Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ voice: (202) 797-5496 fax: (202) 797-5444 ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
CFQUERY question
I've got a field in a database that is a list of id numbers. When creating a query how do I say pull all records that have an id of "whatever" in that list? I don't want to use CONTAINS since the id could be "1" and any number with "1" in it could return the record like "142,3,8,76". Any thoughts? Joby Bednar Director of Internet Design iNEOgroup.com ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: CFQUERY question
Try the CF functions ListContains or ListFind. We dealt with the very same issue and used one of these two to solve it, but I don't remember which. This works as long as your database field is exactly a CF list format. Brian -Original Message- From: Joby Bednar [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 07, 2001 3:13 PM To: CF-Talk Subject: CFQUERY question I've got a field in a database that is a list of id numbers. When creating a query how do I say pull all records that have an id of "whatever" in that list? I don't want to use CONTAINS since the id could be "1" and any number with "1" in it could return the record like "142,3,8,76". Any thoughts? Joby Bednar Director of Internet Design iNEOgroup.com ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: CFQUERY question
cfquery ... select whateveryouwanttoselect from tablename where idnumber = #whatever# /cfqury -Original Message- From: Joby Bednar [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 07, 2001 3:13 PM To: CF-Talk Subject: CFQUERY question I've got a field in a database that is a list of id numbers. When creating a query how do I say pull all records that have an id of "whatever" in that list? I don't want to use CONTAINS since the id could be "1" and any number with "1" in it could return the record like "142,3,8,76". Any thoughts? Joby Bednar Director of Internet Design iNEOgroup.com ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
CFQUERY Question
This is a multi-part message in MIME format. --=_NextPart_000_0177_01C017F7.6A6D41C0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable I have a list that contains the ID of several items in a database. I = want to run one query that will select them all from the database. =20 The number of items in the list is dynamic so I never know exactly how = many I am pulling??? CFQUERY DATASOURCE=3D"#dns#" SELECT *=20 FROM Homes WHERE ID =3D #listitem1# AND #listitem2# ETC. /CFQUERY Any thoughts?? Kevin Schmidt Internet Services Manager Peterson, WIlliams Bizer Office: 734.995.5000 Mobile: 734.649.4843 --=_NextPart_000_0177_01C017F7.6A6D41C0 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable !DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" HTMLHEAD META content=3D"text/html; charset=3Diso-8859-1" = http-equiv=3DContent-Type META content=3D"MSHTML 5.00.2920.0" name=3DGENERATOR STYLE/STYLE /HEAD BODY bgColor=3D#ff DIVFONT face=3DArial size=3D2I have a list that contains the ID of = several items=20 in a database.nbsp; I want to run one query that will select them = allnbsp;from=20 the database.nbsp; /FONT/DIV DIVnbsp;/DIV DIVFONT face=3DArial size=3D2The number of items in the list is = dynamic so I=20 never know exactly how many I am pulling???/FONT/DIV DIVnbsp;/DIV DIVnbsp;/DIV DIVFONT face=3DArial size=3D2lt;CFQUERY = DATASOURCE=3D"#dns#"gt;/FONT/DIV DIVFONT face=3DArial size=3D2SELECT * /FONT/DIV DIVFONT face=3DArial size=3D2FROM Homes/FONT/DIV DIVFONT face=3DArial size=3D2WHERE ID =3D #listitem1# AND = #listitem2#=20 ETC./FONT/DIV DIVFONT face=3DArial size=3D2lt;/CFQUERYgt;/FONT/DIV DIVFONT face=3DArial size=3D2/FONTnbsp;/DIV DIVFONT face=3DArial size=3D2Any thoughts??/FONT/DIV DIVFONT face=3DArial size=3D2/FONTnbsp;/DIV DIVFONT face=3DArial size=3D2Kevin SchmidtBRInternet Services=20 ManagerBRPeterson, WIlliams amp; BizerBROffice: = 734.995.5000BRMobile:=20 734.649.4843BR/DIV/FONT/BODY/HTML --=_NextPart_000_0177_01C017F7.6A6D41C0-- -- Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body.