'SAP ASE Extension Python Module: @stmt_query_timeout?

I am trying to move from a Windows-based pyodbc (Using the SAP Adaptive Server Enterprise 16.0 driver) to Red Hat Linux 7.9-based sybpydb solution.

Current pyodbc solution:

connection = pyodbc.connect(
   "Driver={Adaptive Server Enterprise};NetworkAddress=<servername,serverport>;
    Database=<database>;UID={<username>};PWD={<password>};@pool_size=10;
    stmtquery_timeout=1200;@login_timeout=30;@connection_timeout=30")
df = pandas.read_sql_query("exec <storedproc_name>")
connection.close()

I am trying to replicate this under linux using the sybclient-16.0.3-2 package.

import sybpydb

connection = sybpydb.connect(user=username, password=password, servername=servername,
                             dsn="HostName=<hostname>;Database=<database>;LoginTimeout=30;Timeout=30")

curr = connection.cursor()
result = cursor.execute("exec <storedproc_name>")

Passing @smtmquery_timeout=1200 causes the connection to fail. But without this, the call to the stored proc will timeout. I can't see anything in the documentation about this.

Thanks in advance



Solution 1:[1]

Please refer to the document: https://help.sap.com/docs/SAP_ASE_SDK/a1576559612d4e39886fc0ad4e093074/b0fd2586bbf910148c6ac638f6594153.html

There is no attribute: smtmquery_timeout

If you are using "sybpydb", you can use the openclient sdk directly instead of the ODBC style configuration for the connection.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 SeanH