pypyodbc icon indicating copy to clipboard operation
pypyodbc copied to clipboard

Function sequence error with pypyodbc and MSSQL driver

Open zmlpjuran opened this issue 9 years ago • 1 comments

Hi, It happen randomly that when I call in robotframework-databaselibrary: | DatabaseLibrary.Execute Sql String | delete t_Skill_Group_Member where AgentSkillTargetID = ${agent_id} | # where ${agent_id} is a number

I get: (u'HY010', u'[HY010] [unixODBC][Driver Manager]Function sequence error')

Traceback: Traceback (most recent call last): File "/usr/lib/python2.7/site-packages/DatabaseLibrary/query.py", line 252, in execute_sql_string self.__execute_sql(cur, sqlString) File "/usr/lib/python2.7/site-packages/DatabaseLibrary/query.py", line 260, in __execute_sql return cur.execute(sqlStatement) File "/usr/lib/python2.7/site-packages/pypyodbc.py", line 1605, in execute self.execdirect(query_string) File "/usr/lib/python2.7/site-packages/pypyodbc.py", line 1632, in execdirect self._NumOfRows() File "/usr/lib/python2.7/site-packages/pypyodbc.py", line 1796, in _NumOfRows check_success(self, ret) File "/usr/lib/python2.7/site-packages/pypyodbc.py", line 986, in check_success ctrl_err(SQL_HANDLE_STMT, ODBC_obj.stmt_h, ret, ODBC_obj.ansi) File "/usr/lib/python2.7/site-packages/pypyodbc.py", line 964, in ctrl_err raise Error(state,err_text)

My setup is following: robotframework-databaselibrary (0.6) pypyodbc (1.3.3) and odbc driver 11 for SQL Server 2011.110.2270.00

I have read some article and it says that fetchall() prior getting num of rows can help. What I don't know is whether it should be fixed in robotframework-databaselibrary or in pypyodbc project.

zmlpjuran avatar May 29 '15 10:05 zmlpjuran

Please specify python version and try to format the traceback (it is hard to read) If you think that is an incompatibility with robotframework try to reach robotframework people too to get help. If you think that is a pypyodbc problem please specify a clearer snippet (without any other framework) to get help more easily.

braian87b avatar Jan 17 '16 23:01 braian87b