[KCFusion] debugging
Anybody have a clue what is wrong with this,I keep geting told that there is a semicolon missing. CFQUERY NAME="2" DATASOURCE="perspectives"INSERT INTO questiontest(question)VALUES('#Form.question#')UNIONINSERT INTO questiontest(Cat_num)Select Cat_NumFrom CategoriesWhere Categories.Category = '#Form.Category#'; /cfquery A.
RE: [KCFusion] debugging
Take the UNION out of your query. Union is a function for combing the results of two or more queries. It has no practical purpose for inserting data into a database. Your query should run fine without the UNION -Original Message-From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Adaryl WakefieldSent: Tuesday, July 31, 2001 9:56 AMTo: [EMAIL PROTECTED]Subject: [KCFusion] debugging Anybody have a clue what is wrong with this,I keep geting told that there is a semicolon missing. CFQUERY NAME="2" DATASOURCE="perspectives"INSERT INTO questiontest(question)VALUES('#Form.question#')UNIONINSERT INTO questiontest(Cat_num)Select Cat_NumFrom CategoriesWhere Categories.Category = '#Form.Category#'; /cfquery A.
Re: [KCFusion] debugging
No good. I should have explained better. I need to throw information collected from a form into fourrelated tables. I cannot find anykind of example to do this.The problem I am running into is I have four statements wrapped in cftransaction tags but each insertstatement is creating its own row instead of onecell ofexported data and onecell of collected form data all inone row. Inpseudo code Insert into tableAtwo columns one column is form data the second column is collected from a previous table (the foreign key for table A) - Original Message - From: Don Buck To: [EMAIL PROTECTED] Sent: Tuesday, July 31, 2001 10:06 AM Subject: RE: [KCFusion] debugging Take the UNION out of your query. Union is a function for combing the results of two or more queries. It has no practical purpose for inserting data into a database. Your query should run fine without the UNION -Original Message-From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Adaryl WakefieldSent: Tuesday, July 31, 2001 9:56 AMTo: [EMAIL PROTECTED]Subject: [KCFusion] debugging Anybody have a clue what is wrong with this,I keep geting told that there is a semicolon missing. CFQUERY NAME="2" DATASOURCE="perspectives"INSERT INTO questiontest(question)VALUES('#Form.question#')UNIONINSERT INTO questiontest(Cat_num)Select Cat_NumFrom CategoriesWhere Categories.Category = '#Form.Category#'; /cfquery A.
RE: [KCFusion] debugging
Try doing a select on the column you need and using the result when you insert into the 2nd table. Ryan -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Adaryl Wakefield Sent: Tuesday, July 31, 2001 4:38 PM To: [EMAIL PROTECTED] Subject: Re: [KCFusion] debugging No good. I should have explained better. I need to throw information collected from a form into four related tables. I cannot find any kind of example to do this. The problem I am running into is I have four statements wrapped in cftransaction tags but each insert statement is creating its own row instead of one cell of exported data and one cell of collected form data all in one row. In pseudo code Insert into table A two columns one column is form data the second column is collected from a previous table (the foreign key for table A) __ The KCFusion.org list and website is hosted by Humankind Systems, Inc. List Archives http://www.mail-archive.com/cf-list@kcfusion.org Questions, Comments or Glowing Praise.. mailto:[EMAIL PROTECTED] To Subscribe mailto:[EMAIL PROTECTED] To Unsubscribe mailto:[EMAIL PROTECTED]
Re: [KCFusion] debugging
Thats the easy part. How you get form data for the second column to go with it? A. - Original Message - From: Ryan Hartwich [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, July 31, 2001 4:43 PM Subject: RE: [KCFusion] debugging Try doing a select on the column you need and using the result when you insert into the 2nd table. Ryan -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Adaryl Wakefield Sent: Tuesday, July 31, 2001 4:38 PM To: [EMAIL PROTECTED] Subject: Re: [KCFusion] debugging No good. I should have explained better. I need to throw information collected from a form into four related tables. I cannot find any kind of example to do this. The problem I am running into is I have four statements wrapped in cftransaction tags but each insert statement is creating its own row instead of one cell of exported data and one cell of collected form data all in one row. In pseudo code Insert into table A two columns one column is form data the second column is collected from a previous table (the foreign key for table A) __ The KCFusion.org list and website is hosted by Humankind Systems, Inc. List Archives http://www.mail-archive.com/cf-list@kcfusion.org Questions, Comments or Glowing Praise.. mailto:[EMAIL PROTECTED] To Subscribe mailto:[EMAIL PROTECTED] To Unsubscribe mailto:[EMAIL PROTECTED] __ The KCFusion.org list and website is hosted by Humankind Systems, Inc. List Archives http://www.mail-archive.com/cf-list@kcfusion.org Questions, Comments or Glowing Praise.. mailto:[EMAIL PROTECTED] To Subscribe mailto:[EMAIL PROTECTED] To Unsubscribe mailto:[EMAIL PROTECTED]
[KCFusion] DOMO ARIGOTO!
It struck me like lightning what Ryan was trying to say 15 seconds before Ryan emailed me, but I did not know the use of cftry and cfcatch so you both helped. It works now. That has been bothering me for 3 days. You guys are an awsome resource! Thanks for the input. A. - Original Message - From: Matthew W Jones [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, July 31, 2001 4:47 PM Subject: RE: [KCFusion] debugging cfset commitit = true cftry cftransaction action=begin cfquery name=getCatNums datasource=perspectives Select Cat_Num From Categories Where Categories.Category = '#trim(Form.Category)#'; /cfquery cfoutput query=getCatNums CFQUERY NAME=two DATASOURCE=perspectives INSERT INTO questiontest(question,Cat_num) VALUES ('#Form.question#',#val(cat_num)#) /cfquery /cfoutput cfcatch type=database cftransaction action=rollback/ cfset commitIt = False /cfcatch cfif commitIt cftransaction action=commit/ cfelse cfset commitIt = True /cfif /cftransaction /cftry -Original Message- From: Adaryl Wakefield [mailto:[EMAIL PROTECTED]] Sent: Tuesday, July 31, 2001 4:53 PM To: [EMAIL PROTECTED] Subject: Re: [KCFusion] debugging Thats the easy part. How you get form data for the second column to go with it? A. - Original Message - From: Ryan Hartwich [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, July 31, 2001 4:43 PM Subject: RE: [KCFusion] debugging Try doing a select on the column you need and using the result when you insert into the 2nd table. Ryan -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Adaryl Wakefield Sent: Tuesday, July 31, 2001 4:38 PM To: [EMAIL PROTECTED] Subject: Re: [KCFusion] debugging No good. I should have explained better. I need to throw information collected from a form into four related tables. I cannot find any kind of example to do this. The problem I am running into is I have four statements wrapped in cftransaction tags but each insert statement is creating its own row instead of one cell of exported data and one cell of collected form data all in one row. In pseudo code Insert into table A two columns one column is form data the second column is collected from a previous table (the foreign key for table A) __ The KCFusion.org list and website is hosted by Humankind Systems, Inc. List Archives http://www.mail-archive.com/cf-list@kcfusion.org Questions, Comments or Glowing Praise.. mailto:[EMAIL PROTECTED] To Subscribe mailto:[EMAIL PROTECTED] To Unsubscribe mailto:[EMAIL PROTECTED] __ The KCFusion.org list and website is hosted by Humankind Systems, Inc. List Archives http://www.mail-archive.com/cf-list@kcfusion.org Questions, Comments or Glowing Praise.. mailto:[EMAIL PROTECTED] To Subscribe mailto:[EMAIL PROTECTED] To Unsubscribe mailto:[EMAIL PROTECTED] __ The KCFusion.org list and website is hosted by Humankind Systems, Inc. List Archives http://www.mail-archive.com/cf-list@kcfusion.org Questions, Comments or Glowing Praise.. mailto:[EMAIL PROTECTED] To Subscribe mailto:[EMAIL PROTECTED] To Unsubscribe mailto:[EMAIL PROTECTED] __ The KCFusion.org list and website is hosted by Humankind Systems, Inc. List Archives http://www.mail-archive.com/cf-list@kcfusion.org Questions, Comments or Glowing Praise.. mailto:[EMAIL PROTECTED] To Subscribe mailto:[EMAIL PROTECTED] To Unsubscribe mailto:[EMAIL PROTECTED]
RE: [KCFusion] DOMO ARIGOTO!
Don't forget, you can also do a select on the key/primary table and then do a RecordCount on the query. If you have 0 rows returned then the value doesn't exist and you don't want to insert. If it does exist you can then use the value Glad to be of assistance, Ryan __ The KCFusion.org list and website is hosted by Humankind Systems, Inc. List Archives http://www.mail-archive.com/cf-list@kcfusion.org Questions, Comments or Glowing Praise.. mailto:[EMAIL PROTECTED] To Subscribe mailto:[EMAIL PROTECTED] To Unsubscribe mailto:[EMAIL PROTECTED]