Hi,
Trying to insert a record into my database with this:
NOTES is the field that will probably contain an apostrophe like the words: Here's
Cold Fusion gets past the Replace, but still won't do my insert, because the error says:
Error Diagnostic Information
ODBC Error Code = 22001 (String data right truncation)
[Microsoft][ODBC SQL Server Driver][SQL Server]String or binary data would be truncated.
SQL = "insert into packages ( name,orderid,notes ,tempid ,clientid ,createddatetime ) values ( 'Anthony-9002 Package', '9002', '
Here''''s the letter sent from Q:
What am I doing wrong?
Thanks,
soho34
Trying to insert a record into my database with this:
NOTES is the field that will probably contain an apostrophe like the words: Here's
Code:
<cfif IsDefined("notes")>
<cfset notes = Replace(Fullname,"'","''")>
</cfif>
<cftransaction>
<cfquery datasource="#request.dsn#">
insert into packages
(
name,orderid,notes
<cfif IsDefined("form.tempid")>
,tempid
</cfif>
<cfif IsDefined("form.tempid")>
,clientid
</cfif>
,createddatetime
)
values (
'#name#',
'#order#',
'#notes#'
<cfif IsDefined("form.tempid")>
,'#tempid#'
</cfif>
<cfif IsDefined("form.tempid")>
,'#clientid#'
</cfif>
,#createodbcdatetime(request.nowzone)#
)
</cfquery>
Cold Fusion gets past the Replace, but still won't do my insert, because the error says:
Error Diagnostic Information
ODBC Error Code = 22001 (String data right truncation)
[Microsoft][ODBC SQL Server Driver][SQL Server]String or binary data would be truncated.
SQL = "insert into packages ( name,orderid,notes ,tempid ,clientid ,createddatetime ) values ( 'Anthony-9002 Package', '9002', '
Here''''s the letter sent from Q:
What am I doing wrong?
Thanks,
soho34