This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: odbc queries with very long strings fail with no exceptions
Type: Stage:
Components: Windows Versions: Python 2.3
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: leve, loewis
Priority: normal Keywords:

Created on 2004-08-09 16:17 by leve, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (2)
msg22035 - (view) Author: leve (leve) Date: 2004-08-09 16:17
#W2K MSSQL 2000

#CREATE TABLE [dbo].[Table1] (
#    [Id] [int] NULL ,
#    [Data] [int] NULL 
#)
 
import dbi, odbc
import time

myconn = odbc.odbc('DSN=ctbase2; UID=sa; PWD=')
mycursor = myconn.cursor()

updatelst = []
start = time.time()

for i in range(10000):
    updatelst.append("update table1 set id = %d, data = 
%d " % (i, i))
stri = " ".join(updatelst)
rc = mycursor.execute(stri)
myconn.commit()   
#time.sleep(100)
mycursor.close()
myconn.close()

# When running this script, a very long string is passed 
to execute.
# Only a few first update commands are executed. 
# (I checked it by reading the data back). 
# Somehow this is timing dependant. 
# If sleep is commented out - 480 commands are 
executed.
# If sleep is for 10 sec. - 1600 - 1800 commands are 
executed.
# If sleep is for 100 sec. - 3800 commands are executed.
# In all cases no exception is thrown and rc = 1
msg22036 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2004-08-10 07:34
Logged In: YES 
user_id=21627

Python does not provide an odbc module. Please report the
bug to the author of the odbc module you are using.
History
Date User Action Args
2022-04-11 14:56:06adminsetgithub: 40731
2004-08-09 16:17:43levecreate