From: Harri P. <har...@tr...> - 2002-04-04 09:34:58
|
On 04 Apr 2002 01:03:10 +1000 Dave Cole <dj...@ob...> wrote: > > > > import Sybase > > > Sybase._ctx.debug = 1 > > > db = Sybase.connect('SYBASE', 'sa', '', 'pubs2') > > > > > > def test(table): > > > print "Test table:", table > > > c = db.cursor() > > > c.execute('select * from '+table) > > > c.fetchall() > > > c.close() > > > cmd = "sp_helpindex %s" % table > > > print db.execute(cmd) > > > > > > test('authors') > > > > Ahh... It does fail - it returns a status code from the stored > > procedure of -6. I have no idea what that means... > > > > What I did discover though is that the problem is transaction related. > > If I knew a lot more about isolation levels and how they interact with > > stored procedures I might be able to give a more meaningful answer. > > Try this in ISQL: > > begin tran > go > select * from authors > go > sp_helpindex authors > go > Maybe a dumb question, but why would you be opening a transaction in the Sybase module if not explicitly asked? I'd expect what I'm doing in python be the same as above, without the "begin tran" line. -Harri |