[ python-Bugs-1006056 ] odbc queries with very long strings fail with no exceptions

SourceForge.net noreply at sourceforge.net
Mon Aug 9 18:17:43 CEST 2004


Bugs item #1006056, was opened at 2004-08-09 16:17
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1006056&group_id=5470

Category: Windows
Group: Python 2.3
Status: Open
Resolution: None
Priority: 5
Submitted By: leve (leve)
Assigned to: Nobody/Anonymous (nobody)
Summary: odbc queries with very long strings fail with no exceptions

Initial Comment:
#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

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1006056&group_id=5470


More information about the Python-bugs-list mailing list