Feedback
Did this article resolve your question/issue?

   

Article

Select statement does not return any result with RedShift ODBC driver if where clause contains UTF-8 characters

Information

 
TitleSelect statement does not return any result with RedShift ODBC driver if where clause contains UTF-8 characters
URL NameSelect-statement-does-not-return-any-result-with-RedShift-ODBC-driver-if-where-clause-contains-UTF-8-characters
Article Number000182567
EnvironmentProduct: Connect for ODBC RedShift driver
Version: 7.1
OS: Windows
Database: RedShift
Application: all supported applications
Question/Problem Description
Select statement does not return any result with RedShift ODBC driver if where clause contains UTF-8 characters.
Steps to Reproduce
Clarifying Information
1. Create the following table:

create table test(col1 varchar(20))
insert into test values('的')


2. Execute the following select statement on Windows:

select * from test where col1='的'

No result is returned when the following code is called:

rc = SQLSetConnectAttr(hdbc, SQL_ATTR_APP_WCHAR_TYPE, (void*)SQL_DD_CP_UTF8, SQL_IS_INTEGER);
Error Message
Defect Number
Enhancement Number
Cause
There is no need to call SQLSetConnectAttr(SQL_ATTR_APP_WCHAR_TYPE) if the Windows application uses wchar_t for unicode columns, as windows wchar type is UTF16 by default. The driver takes care of converting the database unicode type to the application unicode type and vice versa (i.e UTF8 to UTF16 and vice versa).
Resolution
Do not call SQLSetConnectAttr(SQL_ATTR_APP_WCHAR_TYPE).
Workaround
Notes
Last Modified Date12/2/2015 7:30 AM
Files
Disclaimer The origins of the information on this site may be internal or external to Progress Software Corporation (“Progress”). Progress Software Corporation makes all reasonable efforts to verify this information. However, the information provided is for your information only. Progress Software Corporation makes no explicit or implied claims to the validity of this information.

Any sample code provided on this site is not supported under any Progress support program or service. The sample code is provided on an "AS IS" basis. Progress makes no warranties, express or implied, and disclaims all implied warranties including, without limitation, the implied warranties of merchantability or of fitness for a particular purpose. The entire risk arising out of the use or performance of the sample code is borne by the user. In no event shall Progress, its employees, or anyone else involved in the creation, production, or delivery of the code be liable for any damages whatsoever (including, without limitation, damages for loss of business profits, business interruption, loss of business information, or other pecuniary loss) arising out of the use of or inability to use the sample code, even if Progress has been advised of the possibility of such damages.