Hi guys,
I am getting a strange error, below is a function that adds a cutomers
details to a table....
<cffunction name="add" output="false" access="public"
returntype="numeric">
<cfargument name="dob" type="date" required="false">
<cfargument name="fname" type="string" required="true">
<cfargument name="lname" type="string" required="true">
<cfargument name="company" type="string" required="true">
<cfargument name="address" type="string" required="true">
<cfargument name="suburb" type="string" required="true">
<cfargument name="city" type="string" required="true">
<cfargument name="postcode" type="string" required="true">
<cfargument name="state" type="string" required="true">
<cfargument name="countries_id" type="numeric" required="true">
<cfargument name="phone" type="string" required="true">
<cfargument name="email" type="string" required="true">
<cfargument name="updates" type="boolean" required="true">
<!--- insert customer --->
<cfquery name="insertInfo" datasource="#Request.App.dsn#"
password="#Request.App.DBpassword#" username="#Request.App.DBusername#">
INSERT INTO address_book
(<cfif isDefined("arguments.dob")>customer_dob,
</cfif>customer_fname, customer_lname, customer_company,
customer_address, customer_suburb, customer_city, customer_postcode,
customer_state, countries_id, customer_phone, customer_email,
customer_updates)
VALUES (
<cfif isDefined("arguments.dob")>
<cfqueryparam cfsqltype="cf_sql_timestamp"
value="#arguments.dob#">,
</cfif>
<cfqueryparam cfsqltype="cf_sql_varchar"
value="#arguments.fname#">,
<cfqueryparam cfsqltype="cf_sql_varchar"
value="#arguments.lname#">,
<cfqueryparam cfsqltype="cf_sql_varchar"
value="#arguments.company#">,
<cfqueryparam cfsqltype="cf_sql_varchar"
value="#arguments.address#">,
<cfqueryparam cfsqltype="cf_sql_varchar"
value="#arguments.suburb#">,
<cfqueryparam cfsqltype="cf_sql_varchar"
value="#arguments.city#">,
<cfqueryparam cfsqltype="cf_sql_varchar"
value="#arguments.postcode#">,
<cfqueryparam cfsqltype="cf_sql_varchar"
value="#arguments.state#">,
<cfqueryparam cfsqltype="cf_sql_integer"
value="#arguments.countries_id#">,
<cfqueryparam cfsqltype="cf_sql_varchar"
value="#arguments.phone#">,
<cfqueryparam cfsqltype="cf_sql_varchar"
value="#arguments.email#">,
<cfqueryparam cfsqltype="cf_sql_bit"
value="#arguments.updates#">
) SELECT @@IDENTITY AS 'customer_id'
</cfquery>
<cfreturn insertInfo.customer_id/>
</cffunction>
The error I am getting is...
[Macromedia][SQLServer JDBC Driver][SQLServer]String or binary data
would be truncated. It is highlighting
<cfqueryparam cfsqltype="cf_sql_bit" value="#arguments.updates#"> ??
Now if the cfargument passes the variable ok, then why would the db
throw an error?
The column customer_updates is set to datatype = bit.
Any help would be appreciated.
mike
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Logware (www.logware.us): a new and convenient web-based time tracking
application. Start tracking and documenting hours spent on a project or with a
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:224129
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54