On 07/19/2016 04:50 AM, Angelo Bulone wrote:
first of all, sorry if I'm not writing in the right place or I'm not
providing enough info about the issue.

Using SQL Alchemy, with pyodbc. I'm trying to reflect a table. When I
try to do that, i get this message

    DBAPIError: (pyodbc.Error) ('IM001', '[IM001] [unixODBC][Driver
    Manager]Driver does not support this function (0) (SQLNumParams)')
    [SQL: u'SELECT [COLUMNS_1].[TABLE_SCHEMA], [COLUMNS_1].[TABLE_NAME],
    [COLUMNS_1].[COLUMN_NAME], [COLUMNS_1].[IS_NULLABLE],
    [COLUMNS_1].[DATA_TYPE], [COLUMNS_1].[ORDINAL_POSITION],
    [COLUMNS_1].[CHARACTER_MAXIMUM_LENGTH],
    [COLUMNS_1].[NUMERIC_PRECISION], [COLUMNS_1].[NUMERIC_SCALE],
    [COLUMNS_1].[COLUMN_DEFAULT], [COLUMNS_1].[COLLATION_NAME] \nFROM
    [INFORMATION_SCHEMA].[COLUMNS] AS [COLUMNS_1] \nWHERE
    [COLUMNS_1].[TABLE_NAME] = CAST(? AS NVARCHAR(max)) AND
    [COLUMNS_1].[TABLE_SCHEMA] = CAST(? AS NVARCHAR(max)) ORDER BY
    [COLUMNS_1].[ORDINAL_POSITION]'] [parameters: ('Order', 'dbo')]

Here is the code..

|>>>fromsqlalchemy.orm.session importSession>>>fromsqlalchemy.schema
importMetaData>>>importsqlalchemy asSQLA >>>eng
=SQLA.create_engine(connection_string)>>>session
=Session(eng.connect())>>>classDB:...pass...>>>db =DB()>>>db.session
=session >>>db.engine =eng >>>db.metadata
=MetaData(bind=db.engine,schema='dbo')>>>db.session.execute("select *
from
information_schema.columns")<sqlalchemy.engine.result.ResultProxyobjectat 
0x7f76eb770890>>>>t
=SQLA.Table('Order',db.metadata,autoload=True,extend_existing=True,autoload_with=db.engine)>>>Traceback(most
recent call last):...File"<stdin>",line 1,in<module>...Seethe error above|

The code is running on a RHEL 7.x with unixODBC, Microsoft SQL Server
Native clinet 11 for Linux. Python 2.7.11

this is likely a side effect of the Linux SQL Server client which is very new and for which pyodbc was not originally developed. I'd recommend trying the FreeTDS ODBC driver, and assuming that works, the problem has to do with pyodbc and/or the Microsoft driver.





Here are the pip requirements

  * - click (6.6) db-connection-maker (1.2.0)
  * - Flask (0.11.1)
  * - itsdangerous (0.24)
  * - Jinja2 (2.8)
  * - MarkupSafe (0.23)
  * - pip (8.0.2)
  * - pyaml (15.8.2)
  * - pyodbc (3.0.10)
  * - PyYAML (3.11)
  * - setuptools (19.6.2)
  * - simplejson (3.8.2)
  * - SQLAlchemy (1.0.14)
  * - Werkzeug (0.11.10)

Note that the same code works without issues on windows.

--
You received this message because you are subscribed to the Google
Groups "sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to sqlalchemy+unsubscr...@googlegroups.com
<mailto:sqlalchemy+unsubscr...@googlegroups.com>.
To post to this group, send email to sqlalchemy@googlegroups.com
<mailto:sqlalchemy@googlegroups.com>.
Visit this group at https://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sqlalchemy+unsubscr...@googlegroups.com.
To post to this group, send email to sqlalchemy@googlegroups.com.
Visit this group at https://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.

Reply via email to