SAP Knowledge Base Article - Preview

3250077 - 'LookupError: unknown encoding' error during connecting to SAP IQ database using python

Symptom

All steps mentioned in KBA 2475541 - "How to install and verify "sqlanydb" for IQ connection with python" are implemented but following error occurs during connection test using python

--test_sqlany.py
import sqlanydb
conn = sqlanydb.connect(uid='dba', pwd='sqlsql', eng='LN161SP04PL03', commlinks='tcpip{host=111.111.111.111;port=1111}' )
curs = conn.cursor()
curs.execute("select 'Hello, world!'")
print( "SQL Anywhere says: %s" % curs.fetchone() )
curs.close()
conn.close()


C:\...>python test_sqlany.py
Traceback (most recent call last):
File "C:\...\Python\Python310\Lib\site-packages\test_sqlany.py", line 2, in <module>
conn = sqlanydb.connect(uid='dba', pwd='sqlsql', eng='LN161SP04PL03', commlinks='tcpip{host=111.111.111.111;port=1111}' )
File "C:\...\Python\Python310\Lib\site-packages\sqlanydb.py", line 524, in connect
return Connection(args, kwargs)
File "C:\...\Python\Python310\Lib\site-packages\sqlanydb.py", line 580, in __init__
if codecs.lookup(char_set):
LookupError: unknown encoding: IBM949
Exception ignored in: <function Connection.__del__ at 0x0000024466440430>
Traceback (most recent call last):
File "C:\...\Python\Python310\Lib\site-packages\sqlanydb.py", line 596, in __del__
self.close()
File "C:\...\Python\Python310\Lib\site-packages\sqlanydb.py", line 651, in close
self.api.sqlany_disconnect(c)
OSError: exception: access violation writing 0x0000000000000024


Read more...

Environment

  • Windows 10 64bit
  • python 3.10.6(64bit)
  • IQNC 16.1 SP04.13 Windows x86_64

Product

SAP IQ 16.1

Keywords

KBA , BC-SYB-IQ , Sybase IQ , BW-SYS-DB-IQ , BW on HANA with Sybase IQ Near-line Storage , Problem

About this page

This is a preview of a SAP Knowledge Base Article. Click more to access the full version on SAP for Me (Login required).

Search for additional results

Visit SAP Support Portal's SAP Notes and KBA Search.