Are any of your columns numeric? I would think that CatID, UserID, and Price
should be numeric columns, but your query treats them as strings. My guess
would be that a price is getting submitted with non-numeric data. (dollar
sign, commas, letters?)

The line number in the error detail may not necessarily be the line that is
actually causing the error when it comes to a cfquery tag.


-----Original Message-----
From: Rick King [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, February 05, 2008 2:39 PM
To: CF-Talk
Subject: Error on site - "Error converting data type varchar to numeric"


I have a site that allows people to list items for sell. I keep getting
errors emailed to me that state, " Error Executing Database Query.
[Macromedia][SQLServer JDBC Driver][SQLServer]Error converting data type
varchar to numeric. <br>The error occurred on line 30."

Here is my query:

  <cfquery name="Name" datasource="DB">
    SET NOCOUNT ON;
    INSERT INTO Products (CatID, UserID, Designer, Model, Color, DressSize,
Price, Material, Description, Status)
    VALUES ('#Trim(FORM.CatID)#',
    '#Trim(SESSION.Auth.UserID)#', 
    '#Trim(FORM.Designer)#', 
    '#Trim(FORM.Model)#', 
    '#Trim(FORM.Color)#', 
    '#Trim(FORM.DressSize)#', 
    '#Trim(FORM.Price)#', 
    '#Trim(FORM.Material)#', 
    '#Trim(FORM.Description)#',
        'Approved');
    SELECT @@identity AS ProdID FROM Products;
    </cfquery>

Line 30 is the  #Trim(FORM.Description)# line in the query, but the
Description field IS set to varchar. Any ideas on why I'd be getting this
error? I can't seem to reproduce it, but several of my users are
consistently triggering the error.

Thanks
Rick 



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;160198600;22374440;w

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:298259
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to