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

Invalid Data ID Error

Contributor ,
Mar 15, 2007 Mar 15, 2007

Copy link to clipboard

Copied

Hello~

I am recieving the following error on the action page of an online form. I've never seen it before, and really don't know where to start!
TOPICS
Database access

Views

1.9K

Translate

Translate

Report

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

correct answers 1 Correct answer

Mentor , Mar 15, 2007 Mar 15, 2007
The value of #Trim(form.ID)# is not numeric, in fact it is literally ID (Look at the listing of your query output and it shows VALUES ( ID, 'KC', 'VanHout', .....) You will notice that the first VALUE is ID, not an actual numeric ID value (I am assuming that your ID column is numeric).

At least now we know why your CFINSERT failed because you are setting a bogus value for form.id.

Phil

Votes

Translate

Translate
Mentor ,
Mar 15, 2007 Mar 15, 2007

Copy link to clipboard

Copied

It looks like the data type of the value for the primary key field of the database table that you attempting to insert into with cfinsert does not match what the database expects, or some such problem. I NEVER use cfinsert or cfupdate because they are notorious for mysterious errors and they tend to mask problems that would normally be easier to figure out if you were using "normal" INSERT or UPDATE queries in cfquery tags, etc., etc. I would use an explicit INSERT statement, but that's just me.

Phil

Votes

Translate

Translate

Report

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
Contributor ,
Mar 15, 2007 Mar 15, 2007

Copy link to clipboard

Copied

I totally agree about the cfinsert statement, but this is an old form built by someone else, and I was trying to find a quick fix 🙂 But, I did go ahead and change to a SQL insert statement, and now I am getting the following error:

Error Executing Database Query.
[Macromedia][SequeLink JDBC Driver][ODBC Socket][Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 1.

The error occurred in E:\Inetpub\wwwroot\internships\request\internrequest_process.cfm: line 110
Called from
E:\Inetpub\wwwroot\internships\request\internrequest_process.cfm: line 9
Called from E:\Inetpub\wwwroot\internships\request\internrequest_process.cfm: line 1
Called from E:\Inetpub\wwwroot\internships\request\internrequest_process.cfm: line 110
Called from E:\Inetpub\wwwroot\internships\request\internrequest_process.cfm: line 9
Called from E:\Inetpub\wwwroot\internships\request\internrequest_process.cfm: line 1

108 : '#Trim(form.Signature)#',
109 : '#Trim(form.approve)#',
110 : '#Trim(form.notes)#'
111 : )
112 : </cfquery>

SQL INSERT INTO request ( ID, FirstName, LastName, banner, email, Street, City, Zip, DayAC, DXchng, DayPhone, DayExt, cellAC, cellXchng, cellPhone, EveAC, EveXchng, EvePhone, EveExt, credits, sem, year, grad, prog, program2, hours, pract, credit_prev, PLIP, outside_co, repeat, working, type, mentor, mentor_org, mentor_phone, mentor_fax, concurrent, current_hours, needs, employer, employ_org, employ_phone2, volunteer_org, volunteer_phone, certify, Signature, approve, notes ) VALUES ( ID, 'KC', 'VanHout', '871111654', 'kcvanhout@law.du.edu', 'asdf', 'asdf', 'asdf', 'asdf', 'asd', 'asdf', 'asdf', 'asdf', 'asd', 'asdf', 'asdf', 'ads', 'asdf', 'asdf', '2', 'Spring', '2006', 'May 2005', 'Day', 'full time', 'asd', 'y', 'y', 'y', 'y', 'y', 'y', 'Business-Corporate L5002', 'asdf', 'asdf', 'asdf', 'asdf', 'asdf', 'as', 'asdf', 'asdf', 'asdf', 'asdf', 'asdf', 'asdf', 'yes', 'asdf', '', 'asdf' )

Here is my insert statement:

Votes

Translate

Translate

Report

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
Mentor ,
Mar 15, 2007 Mar 15, 2007

Copy link to clipboard

Copied

The value of #Trim(form.ID)# is not numeric, in fact it is literally ID (Look at the listing of your query output and it shows VALUES ( ID, 'KC', 'VanHout', .....) You will notice that the first VALUE is ID, not an actual numeric ID value (I am assuming that your ID column is numeric).

At least now we know why your CFINSERT failed because you are setting a bogus value for form.id.

Phil

Votes

Translate

Translate

Report

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
Contributor ,
Mar 16, 2007 Mar 16, 2007

Copy link to clipboard

Copied

LATEST
Thanks, that was it!!!

Votes

Translate

Translate

Report

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
Documentation