djhenderson / pyodbc

Automatically exported from code.google.com/p/pyodbc
MIT No Attribution
0 stars 0 forks source link

cursor.primaryKeys doesn't work connected to Sybase ASE 15 #134

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. c = pyodbc.connect("DSN=ASE15;...;autocommit=true")
2. c.primaryKeys()

What is the expected output? What do you see instead?
I expect to get back a return set, per 
http://code.google.com/p/pyodbc/wiki/Cursor.  Instead I get this:

pyodbc.Error: ('HY000', "[] [FreeTDS][SQL Server]Catalog procedure 'sp_pkeys' 
can not be run in a transaction. (18040) (SQLPrimaryKeys)")

What version of the product are you using? On what operating system?
>>> pyodbc.version
'2.1.7-beta0'

Linux, Solaris 10 x86.

Please provide any additional information below.

This is connected to a sybase ASE 15 server.

Original issue reported on code.google.com by pedri...@gmail.com on 16 Nov 2010 at 7:45

GoogleCodeExporter commented 9 years ago
OK, so I found the autocommit property, and wrapping my call between setting it 
to true and back to false seems to work.  It's trange that the autocommit=true 
flag in the connection string isn't working.  Any thoughts on that?

Original comment by pedri...@gmail.com on 16 Nov 2010 at 8:00

GoogleCodeExporter commented 9 years ago
That's very weird, but it seems to be database-specific issue, so I'm going to 
leave the code as is.

Thanks for reporting the workaround.  I've added it to the FAQ page and will 
see if there are any other places it needs to be.

Original comment by mkleehammer on 19 Nov 2010 at 9:36

GoogleCodeExporter commented 9 years ago
Issue 137 has been merged into this issue.

Original comment by mkleehammer on 20 Nov 2010 at 7:02