간단한 쿼리를 수행 할 때 다음 오류가 발생합니다. 나는 무엇이 바뀌 었는지 알 수 없다.unixODBC 오류 IM001
이class Song(Entity):
using_options(tablename='tbSongs', autoload=True)
using_table_options(schema='apra')
데이터베이스 연결을 확인하고 내가 dir(Song)
을하고 모든 올바른 열을 볼 수 있기 때문에 클래스가 확인 구성 : 여기
>>> songs = Song.query.all()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python2.7/site-packages/sqlalchemy/orm/query.py", line 1729, in all
return list(self)
File "/usr/lib/python2.7/site-packages/sqlalchemy/orm/query.py", line 1839, in __iter__
return self._execute_and_instances(context)
File "/usr/lib/python2.7/site-packages/sqlalchemy/orm/query.py", line 1854, in _execute_and_instances
result = conn.execute(querycontext.statement, self._params)
File "/usr/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1399, in execute
params)
File "/usr/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1532, in _execute_clauseelement
compiled_sql, distilled_params
File "/usr/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1640, in _execute_context
context)
File "/usr/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1633, in _execute_context
context)
File "/usr/lib/python2.7/site-packages/sqlalchemy/engine/default.py", line 325, in do_execute
cursor.execute(statement, parameters)
sqlalchemy.exc.DBAPIError: (Error) ('IM001', '[IM001] [unixODBC][Driver Manager]Driver does not support this function (0) (SQLColAttribute)') 'SELECT [tbSongs_1].[ID_Song] AS [apra_tbSongs_ID_Song], [tbSongs_1].[Album] AS [apra_tbSongs_Album], [tbSongs_1].[Title] AS [apra_tbSongs_Title], [tbSongs_1].[Composer] AS [apra_tbSongs_Composer], [tbSongs_1].[Performer] AS [apra_tbSongs_Performer], [tbSongs_1].[TrackNumber] AS [apra_tbSongs_TrackNumber], [tbSongs_1].[Duration] AS [apra_tbSongs_Duration], [tbSongs_1].[RecordLabel] AS [apra_tbSongs_RecordLabel], [tbSongs_1].[Notes] AS [apra_tbSongs_Notes], [tbSongs_1].[Class] AS [apra_tbSongs_Class], [tbSongs_1].[SongID] AS [apra_tbSongs_SongID], [tbSongs_1].[Deleted] AS [apra_tbSongs_Deleted] \nFROM apra.[tbSongs] AS [tbSongs_1]'()
>>>
설정 세부 사항 :
- 32 비트 아치 리눅스
- 파이썬 2.7.2
- SQLAlchemy의 0.7.2 여기 해당 클래스에 대한 쿼리 및 결과 출력
- 엘릭서 0.7.1
- FreeTD S 0.82-5
- 인 unixODBC 2.3.0-1
/etc/odbcinst.ini :
[ODBC Drivers]
tds = Installed
[tds]
Driver = /usr/lib/libtdsodbc.so
Setup = /usr/lib/libtdsodbc.so
/etc/odbc.ini :
[ODBC]
Trace = 0
[DBNAME]
Driver = TDS
Trace = No
Server = xx.xx.xx.xx\dbname
Database = dbname
Port = 1433
쿼리와 sqlalchemy 및 드라이버의 버전을 제공하면 도움이됩니다. – rocksportrocker
@rocksportrocker 정보를 추가했습니다 – MFB
아마도 sqlalchemy 메일 링리스트에서 요청해야합니다. http://www.sqlalchemy.org/support.html을 참조하십시오. SQL 문은 나에게 잘 보입니다. – rocksportrocker