Re: CFUPDATE-ing without a form
On Wed, 02 Feb 2005 21:21:21 -0500, Rick Root [EMAIL PROTECTED] wrote: And then god help you if you have to debug it! Amen to that! cfinsert and cfupdate are only easier when you are writing your code for the first time, and it executes properly the first time and forever. I can remember migrating off Access way back in the bad old days and those two tags threw all sorts of hissy fits with errmsgs that were essentially worthless. The only way to fix it was to write (*gasp*) sql. -- --mattRobertson-- Janitor, MSB Web Systems mysecretbase.com ~| 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:192968 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: CFUPDATE-ing without a form
cfupdate relies on the form scope. You don't have any form fields. The formfields attribute specifies which form fields to use - from the form scope. You could theoretically do this: cfset form = url cfupdate ... But I'd recommend just using a regular update statement. - Rick ~| Discover CFTicket - The leading ColdFusion Help Desk and Trouble Ticket application http://www.houseoffusion.com/banners/view.cfm?bannerid=48 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:192742 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: CFUPDATE-ing without a form
You're going to live a much easier life if you abandon cfinsert and cfupdate. Sooner or later it will catch up to you. However, the fix to your problem is pretty simple. cfset form.task_id=url.task_id cfset form.status_id=url.status_id cfupdate... Less efficient than Rick's example, and ugly all around. You can cfset whatever you like into the form scope and use it in a cfupdate without a form post etc. Someone awhile back pointed out that cfupdate effectively uses cfqueryparam in its evil work, complete with examples, so I guess if thats true (it may not be for all I know) the above isn't quite as terrifying as it looks. -- --mattRobertson-- Janitor, MSB Web Systems mysecretbase.com ~| 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:192833 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: CFUPDATE-ing without a form
Matt Robertson wrote: Someone awhile back pointed out that cfupdate effectively uses cfqueryparam in its evil work, complete with examples, so I guess if thats true (it may not be for all I know) the above isn't quite as terrifying as it looks. It definately does, but cfinsert and cfupdate both have a lot of overhead... it has to query the database and determine the datatypes of each field and build the insert/update query dynamically. And then god help you if you have to debug it! - Rick -- No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 7.0.300 / Virus Database: 265.8.4 - Release Date: 2/1/2005 ~| 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:192843 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
CFUPDATE-ing without a form
Dear list, I have a URL variable like so: a href=viewtasks.cfm? insert=closetasktask_id=#task_id#status_id=2change status to 2/a Going to a CFUPDATE like so: CFSWITCH expression=#insert# CFCASE value=closetask CFUPDATE datasource=taskomatic tablename=tasks formfields=task_id, status_id /CFCASE /CFSWITCH I was hoping it'd change the relevant status_id to 2, but no, it doesn't seem to do anything. Not even give me an error message. Can anybody help? Is it because the FORMFIELDS aren't actually coming from a form? Thanks in advance, CK. ~| 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:192717 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: CFUPDATE-ing without a form
Yep. Use a regular query update and you'll be fine. Emmet -Original Message- From: Chris Kavanagh [mailto:[EMAIL PROTECTED] Sent: Tuesday, February 01, 2005 10:09 PM To: CF-Talk Subject: CFUPDATE-ing without a form Dear list, I have a URL variable like so: a href=viewtasks.cfm? insert=closetasktask_id=#task_id#status_id=2change status to 2/a Going to a CFUPDATE like so: CFSWITCH expression=#insert# CFCASE value=closetask CFUPDATE datasource=taskomatic tablename=tasks formfields=task_id, status_id /CFCASE /CFSWITCH I was hoping it'd change the relevant status_id to 2, but no, it doesn't seem to do anything. Not even give me an error message. Can anybody help? Is it because the FORMFIELDS aren't actually coming from a form? Thanks in advance, CK. ~| 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:192725 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
CFUPDATE-ing without a form?
Dear list, Is there any way to CFUPDATE without using a form?I'd like to pass the data as variables in the URL. TIA, CK. [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]
RE: CFUPDATE-ing without a form?
Copy the data from the url scope to the form scope first: cfset structAppend(form, url) _ From: Chris Kavanagh [mailto:[EMAIL PROTECTED] Sent: Thursday, 19 August 2004 9:54 a.m. To: CF-Talk Subject: CFUPDATE-ing without a form? Dear list, Is there any way to CFUPDATE without using a form?I'd like to pass the data as variables in the URL. TIA, CK. _ [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]
RE: CFUPDATE-ing without a form?
CFUPDATE expects the variables that it will be using to be in the form scope. Just hand set the variables to that scope: CFSET form.name=michael CFUPDATE will treat name as if it came in on a form and make use of it. _ From: Chris Kavanagh [mailto:[EMAIL PROTECTED] Sent: Wednesday, August 18, 2004 5:54 PM To: CF-Talk Subject: CFUPDATE-ing without a form? Dear list, Is there any way to CFUPDATE without using a form?I'd like to pass the data as variables in the URL. TIA, CK. _ [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]
SOLVED: CFUPDATE-ing without a form?
Wow.Many, many thanks to Michael and Matthew and their very quick responses! Best, CK. [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]