Open guibayer opened 2 years ago
Hello,
I'm trying to read a table using SqlAlchemy on the Table() function but i got this error:
DBAPIError: (IfxPyDbi.Error) IfxPyDbi::Error: Exception('[Informix][Informix ODBC Driver][Informix]A syntax error has occurred. SQLCODE=-201') [SQL: SELECT "SYSCAT"."COLUMNS"."COLNAME", "SYSCAT"."COLUMNS"."TYPENAME", "SYSCAT"."COLUMNS"."DEFAULT", "SYSCAT"."COLUMNS"."NULLS", "SYSCAT"."COLUMNS"."LENGTH", "SYSCAT"."COLUMNS"."SCALE", "SYSCAT"."COLUMNS"."IDENTITY", "SYSCAT"."COLUMNS"."GENERATED" FROM "SYSCAT"."COLUMNS" WHERE "SYSCAT"."COLUMNS"."TABSCHEMA" = ? AND "SYSCAT"."COLUMNS"."TABNAME" = ? ORDER BY "SYSCAT"."COLUMNS"."COLNO"] [parameters: (b'DUMMY', b'DIEMP')] (Background on this error at: http://sqlalche.me/e/14/dbapi)
MyCode:
import sqlalchemy as db
db.dialects.registry.register("informix", "IfxAlchemy.IfxPy", "IfxDialect_IfxPy") db.dialects.registry.register("informix.IfxPy", "IfxAlchemy.IfxPy", "IfxDialect_IfxPy") db.dialects.registry.register("informix.pyodbc", "IfxAlchemy.pyodbc", "IfxDialect_pyodbc")
ConStr = 'informix://myconnstring'
engine = db.create_engine(ConStr) connection = engine.connect()
metadata = db.MetaData()
diaemp = db.Table('diemp', metadata, autoload=True, autoload_with=engine)
Someone faced the same problem or got this function Table() working?
Hi, I'm facing the same issue. Have you found a solution, @guibayer?
Hello,
I'm trying to read a table using SqlAlchemy on the Table() function but i got this error:
DBAPIError: (IfxPyDbi.Error) IfxPyDbi::Error: Exception('[Informix][Informix ODBC Driver][Informix]A syntax error has occurred. SQLCODE=-201') [SQL: SELECT "SYSCAT"."COLUMNS"."COLNAME", "SYSCAT"."COLUMNS"."TYPENAME", "SYSCAT"."COLUMNS"."DEFAULT", "SYSCAT"."COLUMNS"."NULLS", "SYSCAT"."COLUMNS"."LENGTH", "SYSCAT"."COLUMNS"."SCALE", "SYSCAT"."COLUMNS"."IDENTITY", "SYSCAT"."COLUMNS"."GENERATED" FROM "SYSCAT"."COLUMNS" WHERE "SYSCAT"."COLUMNS"."TABSCHEMA" = ? AND "SYSCAT"."COLUMNS"."TABNAME" = ? ORDER BY "SYSCAT"."COLUMNS"."COLNO"] [parameters: (b'DUMMY', b'DIEMP')] (Background on this error at: http://sqlalche.me/e/14/dbapi)
MyCode:
import sqlalchemy as db
import IfxPyDbi as dbapi2
db.dialects.registry.register("informix", "IfxAlchemy.IfxPy", "IfxDialect_IfxPy") db.dialects.registry.register("informix.IfxPy", "IfxAlchemy.IfxPy", "IfxDialect_IfxPy") db.dialects.registry.register("informix.pyodbc", "IfxAlchemy.pyodbc", "IfxDialect_pyodbc")
ConStr = 'informix://myconnstring'
engine = db.create_engine(ConStr) connection = engine.connect()
metadata = db.MetaData()
diaemp = db.Table('diemp', metadata, autoload=True, autoload_with=engine)
Someone faced the same problem or got this function Table() working?