Skip to Main Content

Database Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Oracle to MySql character set problem

761848Nov 20 2011 — edited Feb 23 2012
Dear Gurus,

My database is Oracle 11g R2 (11.2.0.1.0) on Sun Solaris 10. To get data from mysql database for reporting purpose, I used DG4ODBC and followed strictly the OMSC note "Detailed Overview of Connecting Oracle to MySQL Using DG4ODBC Database Link [ID 1320645.1]. Here are main configuration steps:
- Check DG4ODBC 32/64-bit
- Install and configure ODBC Driver Manager unixodbc-2.2.14
- Install and configure MyODBC 5.1.8
- Configure tnsnames.ora and listener.ora
- Create db links

Oracle character set is AL32UTF8
MySQL charactoer set is uft8

--------------------------------------------------------
$ODBC_HOME/etc/odbc.ini
--------------------------------------------------------
[ODBC Data Sources]
myodbc5 = MyODBC 5.1 Driver DSN

[myodbc5]
Driver = /opt/mysql/myodbc5/lib/libmyodbc5.so
Description = Connector/ODBC 5.1 Driver DSN
SERVER = <mysql server ip>
PORT = 3306
USER = <mysql_user>
PASSWORD = ****
DATABASE = <mysql db name>
OPTION = 0
TRACE = OFF
---------------------------------------------------------

---------------------------------------------------------
$ORACLE_HOME/hs/admin/initmyodbc5.ora
---------------------------------------------------------
# HS init parameters
#
HS_FDS_CONNECT_INFO=myodbc5 # Data source name in odbc.ini
HS_FDS_TRACE_LEVEL=OFF
HS_FDS_SHAREABLE_NAME=/opt/unixodbc-2.2.14/lib/libodbc.so
HS_FDS_SUPPORT_STATISTICS=FALSE
HS_LANGUAGE=AMERICAN_AMERICA.WE8ISO8859P1
#
# ODBC env variables
set ODBCINI=$ODBC_HOME/etc/odbc.ini
----------------------------------------------------------

My issue is I can query data from mysql database tables but the output is incorrect in character type columns (VARCHAR columns). It just shows the first character in such columns. I tried to read through some OMSC notes but none is useful. If you experienced on such issues, please share your idea / help me resolve it.

Thanks much in advance,

Hieu
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 22 2012
Added on Nov 20 2011
5 comments
5,937 views