Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Fri, 23 Jun 2006 @ 15:08:02 GMT


     
  <Prev Next>   <<First <Prev
Next>
Last>>
 


Subj:   Re: ODBC Error message: Beyond SQL_ACTIVE_STATEMENTS
 
From:   Dempsey, Mike

"Beyond SQL_ACTIVE_STATEMENTS limit" means that your application has tried to create more hStmts than are allowed.

It probably means that you are creating a new hStmt each time you submit a new query, but you are not releasing these hStmts after the queries complete.

I think the Teradata driver supports up to 16 hStmts but you can check by calling:

     SQLGetInfo(hDBC, SQL_ACTIVE_STATEMENTS, iNumAllowed, 2, piLen)

To release an hStmt use:

     SQLFreeStmt(hStmt, SQL_DROP)      <<< If using ODBC 2.x
     SQLFreeHandle(SQL_HSTMT, hStmt)   <<< If using ODBC 3.x

Alternatively you can simply free the hStmt using:

     SQLFreeStmt(hStmt, SQL_CLOSE)

and re-use it, instead of creating a new one for each query.


Mike Dempsey
Teradata Client Tools



     
  <Prev Next>   <<First <Prev
Next>
Last>>
 
 
 
 
 
 
 
 
 
  
  Top Home Privacy Feedback  
 
 
Copyright for the TeradataForum (TDATA-L), Manta BlueSky    
Copyright 2016 - All Rights Reserved    
Last Modified: 15 Jun 2023