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

Error Executing Database Query. (Please help)

Community Beginner ,
Nov 09, 2010 Nov 09, 2010

I can't get this query to work properly. I have gone over it so many times.. I can't count, I don't get why it's throwing an error. Here is my code, and followed by the error:

My update query:

<cfquery name="UpdateDetails" datasource="#APPLICATION.dataSource#">
UPDATE books234
SET
books234.title=<cfqueryparam cfsqltype="cf_sql_varchar" value="#form.title#">,
books234.info=<cfqueryparam cfsqltype="cf_sql_varchar" value="#form.info#">,
books234.statement=<cfqueryparam cfsqltype="cf_sql_varchar" value="#form.statement#">,
<cfif fileuploaded is true>
books234.MYFile=<cfqueryparam cfsqltype="cf_sql_varchar" value="#uploadedfile#">,
</cfif>
books234.links=<cfqueryparam cfsqltype="cf_sql_varchar" value="#form.links#">,
books234.ordNum=<cfqueryparam cfsqltype="cf_sql_varchar" value="#form.ordNum#">
WHERE books234.ID = <cfqueryparam value="#form.ID#" cfsqlType="CF_SQL_INTEGER">
</cfquery>
<cflocation url="bookView.cfm?ID=#Form.ID#" addtoken="no">

Here is my error:

Error  Executing Database Query.

[Macromedia][SequeLink JDBC  Driver][ODBC Socket][Microsoft][ODBC Microsoft Access Driver]Invalid precision  value
The  error occurred in C:\websites\209689jh6\slideAction.cfm: line  455
Called from C:\websites\209689jh6\admin\cms\slideAction.cfm:  line 442
Called from C:\websites\209689jh6\admin\cms\slideAction.cfm:  line 390
Called from C:\websites\209689jh6\admin\cms\slideAction.cfm:  line 1
Called from C:\websites\209689jh6\admin\cms\slideAction.cfm:  line 455
Called from C:\websites\209689jh6\admin\cms\slideAction.cfm:  line 442
Called from C:\websites\209689jh6\admin\cms\slideAction.cfm:  line 390
Called from C:\websites\209689jh6\admin\cms\slideAction.cfm:  line 1
453 : books234.links=<cfqueryparam cfsqltype="cf_sql_varchar" value="#form.links#">,
454 : books234.ordNum=<cfqueryparam cfsqltype="cf_sql_varchar" value="#form.ordNum#">
455 : WHERE books234.ID = <cfqueryparam value="#form.ID#" cfsqlType="CF_SQL_INTEGER">
456 : </cfquery>
457 : <cflocation url="bookView.cfm?ID=#Form.ID#" addtoken="no">

Can anyone see what I did wrong here? It's not like it's a sophisticated query. I write these all the time.

Thank you.

871
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
Guest
Nov 10, 2010 Nov 10, 2010
LATEST

Does it work without using cfqueryparam in the WHERE statement?  Are you sure the type CF_SQL_INTEGER is correct?  Is the value of form.ID really an integer?

Cheers

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