Issue1659

classification
Title: callproc() always returns "no results" with Sybase ASE 12.5.4
Type: behaviour Severity: normal
Components: zxjdbc Versions: Jython 2.5
Milestone:
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: a_mehlig, fwierzbicki, zyasoft
Priority: Keywords:

Created on 2010-09-27.00:50:53 by a_mehlig, last changed 2014-10-05.16:57:38 by zyasoft.

Messages
msg6100 (view) Author: Adrian Mehlig (a_mehlig) Date: 2010-09-27.00:50:50
I have been unable to call Sybase stored procedures from zxJDBC. 
Calls to callproc() always return None and I get a DatabaseError of "no results" when I subsequently call fetchone() or fetchall(). This is true both for procs with and without parameters. Raw SQL strings called via execute() seem to work fine, however. Please see below for a sample function to reproduce the error.

This is the Sybase version string:
Adaptive Server Enterprise/12.5.4/EBF 16128 ESD#9/P/Sun_svr4/OS 5.8/ase1254/2143/64-bit/FBO/Thu Feb  5 02:50:34 2009

I briefly checked the zxJDBC test module in the Jython source and it seems that the code has only been tested against Oracle & MS SQL Server.
I guess that it must be difficult to test all possible database platforms, so I would be happy to do a little beta testing against ASE 12.5.4 if it would help... ;)

Kind Regards,

Adrian Mehlig


def get_index_divisor(mds_code, query_date):
    
    url = config.get('Nikkei Database', 'URL') 
    login = config.get('Nikkei Database', 'Login')
    password = config.get('Nikkei Database', 'Password') 
    driver = config.get('Nikkei Database', 'Driver')
    
    try: 
        conn = zxJDBC.connect(url, login, password, driver)
        conn.autocommit = True
        cursor = conn.cursor()
        
        cursor.execute('select @@version')
        print str(cursor.rowcount) + ' rows returned'
        resultset = cursor.fetchall()
        for row in resultset:
            print row      

        cursor.execute('select top 5 * from dbo.Monthly_Price')
        print str(cursor.rowcount) + ' rows returned'
        resultset = cursor.fetchall()
        for row in resultset:
            print row   
            
        rc = cursor.callproc('sp_helpdb')
        print 'rc = ' + str(rc)
        print str(cursor.rowcount) + ' rows returned'
        resultset = cursor.fetchall()
        for row in resultset:
            print row   
        
        params = ['JP_NKY', query_date.strftime('%Y%m%d')]
        print params
        cursor.callproc('SpGetDivisorForMDS', params)
         
#        result = cursor.fetchall()        
        result = cursor.fetchone()
        for row in result:
            print row
                
    except zxJDBC.DatabaseError, e:
        print 'DatabaseError: ', e
        
    finally:
        if cursor:
            cursor.close()
        if conn:
            conn.close()
msg6101 (view) Author: Adrian Mehlig (a_mehlig) Date: 2010-09-27.00:54:02
I forgot to add the Jython version string:
java1.5.0_04 2.5.1 (Release_2_5_1:6813, Sep 26 2009, 13:47:54)
msg6116 (view) Author: Jim Baker (zyasoft) Date: 2010-10-01.17:23:48
Presumably this would also impact MS SQLServer, so we should look at that too.
msg8513 (view) Author: Jim Baker (zyasoft) Date: 2014-05-22.00:04:48
Is this functionality available under jyjdbc?
msg9078 (view) Author: Jim Baker (zyasoft) Date: 2014-10-05.16:57:38
We are going to be replacing zxJDBC with jyjdbc for beta 4, so this may help (get this bug fixed for free). At the very least, it will make it possible to fix, because we are reluctant to touch zxJDBC without strong testing.
History
Date User Action Args
2014-10-05 16:57:38zyasoftsetmessages: + msg9078
2014-05-22 00:04:48zyasoftsetmessages: + msg8513
2013-02-20 19:22:31fwierzbickisetnosy: + fwierzbicki
versions: + Jython 2.5, - 2.5.1
2010-10-01 17:23:48zyasoftsetnosy: + zyasoft
messages: + msg6116
2010-09-27 00:54:02a_mehligsetmessages: + msg6101
2010-09-27 00:50:53a_mehligcreate