ODBC SQL_ACTIVE_STATEMENTS limit error using Python / pyodbc

Connectivity
Enthusiast

ODBC SQL_ACTIVE_STATEMENTS limit error using Python / pyodbc

Hello,

I'm accessing Teradata through a python based web application, using pyodbc.  I get the error [Teradata][ODBC Teradata Driver] Beyond SQL_ACTIVE_STATEMENTS limit'

which has come up before : http://www.teradataforum.com/teradata/20060623_150802.htm

In this post, Mike Dempsey says "I think the Teradata driver supports up to 16 hStmts...".  Does a hStmt equate to a datbase session, and therefore I have to limit the amount of sessions from a single server ?   

Has anyone seen this with pyodbc before ?   I am not sure if it is an issue that can  be addressed in the odbc parameters, in the pyodbc package, or the calling application itself.  

Thanks

Tags (1)
2 REPLIES
Teradata Employee

Re: ODBC SQL_ACTIVE_STATEMENTS limit error using Python / pyodbc

No, a hStmt does not equate to a database session. The Teradata Database supports 16 Open Result Sets per session.

I am not familiar with pyOdbc. But there must a Release or Close method for each SQL Statement that you execute on a Session. Your application must Close/Release each Open Result Set.

Enthusiast

Re: ODBC SQL_ACTIVE_STATEMENTS limit error using Python / pyodbc

Thankyou for the info, that's helped me track down the issue.    I'm using web2py on Teradata  - (www.web2py.com) worth a look in my opinion - that can connect to many database types.   It appears that other databases, particularly MS SQL, has implicit deallocation of cursors, whereas Teradata appears to need an explicit "closing" of a cursor.   I'll request a fix.