Skip to main content
AXcrystallis
Known Participant
November 12, 2006
Question

cfqueryparam and non-English languages

  • November 12, 2006
  • 1 reply
  • 548 views
Hi,

I want to store non-English characters in NCHAR NVARCHAR and NTEXT field types.
In the examples below fields LastName and FirstName are NVARCHAR type and
Comments is NTEXT

In the past when I wanted to store non English (Greek) strings or texts in these field types I was writting
<!-------------->
<cfquery name="Q" datasource="Db">

INSERT INTO Books
( LastName,
FirstName,
Comments )
VALUES
( N '#var_LastName#' ,
N '#var_FirstName#' ,
N '#var_Comments#' )

</cfquery>
<!-------------->
Now I want to use the cfqueryparam, so the syntax is
<!-------------->
<cfquery name="Q" datasource="Db">

INSERT INTO Books
( LastName,
FirstName,
Comments )
VALUES
( <cfqueryparam value="#var_LastName#" cfsqltype="CF_SQL_VARCHAR" MaxLength="40">,
<cfqueryparam value="#var_FirstName#" cfsqltype="CF_SQL_VARCHAR" MaxLength="30">,
<cfqueryparam value="#var_Comments#" cfsqltype="CF_SQL_LONGVARCHAR"> )

</cfquery>
<!-------------->
but ...... the non English characters are not stored correctly.

So my question is
How can I use the cfqueryparam in order to store non English characters in NCHAR NVARCHAR and NTEXT field types ???
The documentation has not any info on that.

Thank you in advance for your help

ANX
Greece
This topic has been closed for replies.

1 reply

November 13, 2006
You didn't say what version of CF you were using.

Also, which database driver are you using (ODBC or JDBC version #)?

Anyway, it looks like you do not have the unicode support turned on. See http://www.sustainablegis.com/blog/cfg11n/index.cfm?mode=entry&entry=F9553D86-20ED-7DEE-2A913AFD8651643F, etc.

If that doesn't help, post sample data that inserts ok without cfparam but not ok with cfparam.