ms SQL Server에서 pyodbc를 사용하여 데이터를 가져 오려고합니다. 나는 오류가 아래에 무엇입니까 :SQL 문 중 일부가 너무 깊게 중첩되어 있습니다. pyodbc
ProgrammingError: ('42000', '[42000] [Microsoft][ODBC SQL Server Driver][SQL Server]Some part of your SQL statement is nested too deeply. Rewrite the query or break it up into smaller queries. (191) (SQLExecDirectW)')
코드는 다음과 같습니다 :
conn = pyodbc.connect('DRIVER={SQL Server};SERVER=127.0.0.1;DATABASE=Morphemes;')
cursor = conn.cursor()
Func = list()
sql_VerbDecl = "SELECT (stem_.kök + conj_.suffix) as tokenn FROM TBL_Stem as stem_ INNER JOIN TBL_VerbDecl as conj_ on conj_.node = stem_.node;"
cursor.execute(sql_VerbDecl)
rows = cursor.fetchall()
문제는 유니 코드 문제였다. stem_.kök를 stem_.kok으로 변경하면 문제가 해결됩니다.