Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Migrating from CFv.4.5 to MX7

New Here ,
Mar 24, 2008 Mar 24, 2008
I am experiencing the following error after migrating code from v.4.5 to MX7.

***This code:
<cfif isDefined("URL.Add")>
<cfinsert DATASOURCE="eval"
TABLENAME="tblGeneralEval"
FORMFIELDS="SCHD_ID,date,class,instructor,rotrain_id,stuname,GQ1,GQ2,GQ3,GQ4,GQ5,GQ6,GQ7,GQ8,GQ9">

<!--- <cfif #form.instructor# EQ (#qryInstr.instructor#)>
<!--- duplicate instructor not added to the table --->
<CFELSE> --->
<cfinsert datasource="Eval"
tablename="tblInstr"
formfields="date,instructor">

<!--- </cfif> --->
<cfoutput>
<cflocation url="thankyou.cfm">
</cfoutput>
</CFIF>

***Produces this error:
Error Executing Database Query.
Syntax error in INSERT INTO statement.

The error occurred in E:\Web\Training\Evaluation\student\eval_general.cfm: line 4

2 : <cfinsert DATASOURCE="eval"
3 : TABLENAME="tblGeneralEval"
4 : FORMFIELDS="SCHD_ID,date,class,instructor,rotrain_id,stuname,GQ1,GQ2,GQ3,GQ4,GQ5,GQ6,GQ7,GQ8,GQ9">
5 :
6 : <!--- <cfif #form.instructor# EQ (#qryInstr.instructor#)>



--------------------------------------------------------------------------------

SQL insert into tblGeneralEval (SCHD_ID,date,instructorstuname,GQ1,GQ4,GQ5,GQ6,GQ7,GQ8) values ( (param 1) , (param 2) , (param 3) , (param 4) , (param 5) , (param 6) , (param 7) , (param 8) , (param 9) )
DATASOURCE eval
VENDORERRORCODE 3092
SQLSTATE  

Resources:
Text Text
TOPICS
Database access
367
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Valorous Hero ,
Mar 24, 2008 Mar 24, 2008
LATEST
Some of your column names may be reserved keywords, like "Date". Try changing the column name. If that is not an option, try using a sql insert statement instead of cfinsert. That should allow you to properly escape the reserved keyword.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources