나는 데비안 컴퓨터에서 FreeTDS를 통해 python을 사용하여 python에서 쿼리에 뭔가 빠졌다고 생각합니다. 처음 255 자 이상을 관리 할 수 없습니다.FreeTDS로 MS SqlServer를 쿼리 할 때 Python이 255자를자를 때
내가 여기 설명으로 SQL 데이터를 캐스팅해야 할 경우 : ODBC query on MS SQL Server returning first 255 characters only in PHP PDO (FreeTDS)에 : 나는 빈 얻을/제로 길이 문자열 SELECT CAST(myText as TEXT) FROM mytable
, 나 또한 더 이상 성공으로 테스트 한
: 변화 크기 설정과 설명으로 아래에, 나는 단지 255자를 얻을 수있다. (내 Win 상자에서 pyodbc는 279자를 얻을 수있다.)
여기SET TEXTSIZE 2147483647;
SELECT [id], myText , LEN(myText)
FROM mytable
가 내 /etc/freetds/freetds/conf
: 여기
[global]
# TDS protocol version
; tds version = 4.2
#!!!added by me
client charset = UTF-8
text size = 4294967295
#!!!/added by me
# Whether to write a TDSDUMP file for diagnostic purposes
# (setting this to /tmp is insecure on a multi-user system)
; dump file = /tmp/freetds.log
; debug flags = 0xffff
# Command and connection timeouts
; timeout = 10
; connect timeout = 10
# If you get out-of-memory errors, it may mean that your client
# is trying to allocate a huge buffer for a TEXT field.
# Try setting 'text size' to a more reasonable limit
#!!!changed by me
#text size = 64512
다른 사람의 conf 파일은 다음과 같습니다
> cat /etc/odbc.ini #/etc/odbc.ini is empty! is it ok?
> cat /etc/odbcinst.ini
[FreeTDS]
Description=TDS driver (Sybase/MS SQL)
Driver=/usr/lib/odbc/libtdsodbc.so
Setup=/usr/lib/odbc/libtdsS.so
CPTimeout=
CPReuse=
내 SQL 서버가 192.168.1.2
이고 사용하여 연결 :
cnstr = 'DRIVER={FreeTDS};SERVER=192.168.1.2;DATABASE=MyDBName;UID=MyUID;PWD=MYPASSWD'
cursor = cnxn.cursor()
cursor.execute(SQL)
# etc.
어떤 도움을 U 감사의 뜻이 무엇인지
안부