If you specify a SQL query that contains Unicode data, keep in mind the following:
Note: If you are using the Text ODBC data source (not the Unicode Text Adapter), or any data source that does not support Unicode, adding a leading "N" may cause the query to fail because they are not designed to support Unicode data.
If, for example, you have the following value in a user variable:
MyVar = "现金"
Note: Double-quotes around the value are required.
You can use the variable in a SQL query, as follows:
select * from BANK_ACCOUNT where AccountType = :MyVar
Insight searches the value of MyVar, find that it contains at least one Unicode character, and produce the following query:
select * from BANK_ACCOUNT where AccountType = N'现金''
Note that Insight wraps the string in single quotation marks (which are required syntax in a SQL query), then adds the leading N before the first single quote. Be sure that you do not put the "N" inside the user variable value.
For detailed information about using Unicode data in SQL queries, see the Microsoft SQL Server article: Using Unicode Data (SQL Server)
Note: For adapters that do not support SQL syntax queries, you may be able to create a Insight Custom Query.
See also