Question
cfqueryparam and non-English languages
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
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