0

I'm trying to call a stored procedure in a database using the Sybase module for Python and I'm having this proc_status returned. I don't know what this proc_status means. Can anyone tell me? Code is attached below

#!/usr/bin/python_64
#coding=utf-8
import sybpydb

#Create a connection object
con = sybpydb.connect(
servername="********",
user="*******",
password="********" )

#Create a cursor object 
cur = con.cursor()

#start_date = '20170505'
#end_date = '20180505'
#dealer_code = '7802'
#dealer_rep_code = 'ZWF1'

try:
    cur.callproc('trans_history.sp', ['20170505','20180505','7802','ZWF1']) 
    continues = True
    while(continues == True):
        row = cur.fetchall()
        continues = cur.nextset()
except sybpydb.Error:
    print("Status=%d" % cur.proc_status)

#Close the connection
cur.close()
con.close()

Here is the output: Status= -6

  • If it's from `subprocess` (which I don't know), it means a child died with `SIGABRT` (_e.g._, from an assertion failure). – Davis Herring Jun 05 '18 at 17:04
  • According to [the docs](http://infocenter.sybase.com/help/index.jsp?topic=/com.sybase.infocenter.dc32300.1600/doc/html/san1390612441960.html), `-6` means “Miscellaneous user error”. Not very helpful, but that’s all anyone can tell you without debugging the stored procedure and how you’re calling it, which is impossible since you haven’t given that to us. – abarnert Jun 05 '18 at 17:05
  • By the way, the Sybase docs seem pretty bad. In multiple places they accidentally document multiple cursor attributes with the explanation for `arraysize` instead of the correct one. You should probably file a documentation bug with them (but you’ll have to actually look at the docs first to see where they’re wrong). – abarnert Jun 05 '18 at 17:08
  • I tried calling the stored procedure under the try: block, does the syntax look off? I am following what the programmer guide states. – programmer_with_questions Jun 05 '18 at 19:05

0 Answers0