my guess would be that it's trying to pass "true" or "false" as a
string and not a 0 or 1.  You might try to something like

<cfset var updates = iif(arguments.updates,1,0)>

Then use #updates# in your query.


On 11/14/05, Mike | NZSolutions Ltd <[EMAIL PROTECTED]> wrote:
> (I made this question a bit shorter !!)
>
> 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="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
>                 (...
> customer_updates)
>                 VALUES (
>                 ...,
>                 <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:224137
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=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to