I am trying to connect to IBM iSeries using pyodbc, a Python interface for ODBC, on Linux Red Hat (Intel 64bit arch).
The following is what I have done:
Installed gcc-c++ (needed to compile pyodbc), unixODBC, unixODBC-devel
Installed iSeriesAccess-6.1.0-1.0.x86_64.rpm:
sudo rpm -ivh http://ftpmirror.your.org/pub/misc/ftp.software.ibm.com/as400/iSeriesAccess-6.1.0-1.0.x86_64.rpm --nodeps
- Attached the driver to unixODBC
odbcinst -i -d -f /opt/ibm/iSeriesAccess/unixodbcregistration64
- Since I had some issues with libraries, I symbolic linked them:
sudo ln -s /opt/ibm/iSeriesAccess/lib64/libcwb* /usr/lib/
- I configured the ODBC Data Source to access the AS400’s database: /etc/odbc.ini:
[AS400]
Description = Database iSeries
Driver = iSeries Access ODBC Driver
System = XXX.XXX.XXX.XXX
Port = 8471
UserID = XXXXXX
Password = XXXXXX
Naming = 1
Database = XXXXXXXXX
ConnectionType = 0
CommitMode = 2
BlockFetch = 1
BlockSizeKB = 512
- I tested the connection:
> isql -v AS400
+---------------------------------------+
| Connected! |
| |
| sql-statement |
| help [tablename] |
| quit |
| |
+---------------------------------------+
SQL>
I was able to connect, but when running any SQL query I get Segmentation fault (core dumped)
.
By checking /var/log/messages I see this:
isql[5767]: segfault at 7f6fdb30020e ip 00007f6ed372ff71 sp 00007ffcce17d5f0 error 4 in libcwbcore.so[7f6ed369e000+11c000]
I would like to re-install a different driver (e.g iSeriesAccess-7.1.0-1.0x86_64.rpm), but I am not able to find it.