|
From: Jeffrey Z. <Jef...@q-...> - 2009-08-19 08:43:40
|
I would imagine that those who read this list have some experience with
Sybase Transact-SQL programming. I have a *very* simple question that I
posted earlier, but could not be answered.
When you execute a Sybase stored procedure on Sybase ASE, the call
returns a "return status" value. This is an integer that you can test
to see if the procedure executed successfully. Stored procedures can
return any value you like, so the return status is used as an error code
for a stored procedure. This is standard Sybase stuff.
I desperately need to obtain this result status value after I call a
stored procedure with the Python-Sybase module using:
cursor.callproc('procname', ...)
The result status is mentioned on the page:
http://python-sybase.sourceforge.net/news.html
where it states (for v 0.37pre1):
"The return value of Cursor.callproc() is now longer returned in the
result sets.
It is available in the .return_status Cursor member once all
results have been consumed."
However, when I execute cursor.callproc() the cursor object *never* has
a "return_status" member (before or after I read the result set).
Perhaps I can access the return status in another way?
I am using the latest python-sybase module (v0.39) on Ubuntu 9.04 Linux.
I compiled this module using the free "ASE Express Edition for Linux".
It it absolutely necessary to obtain this result status value;
otherwise, there is no way to know if the stored procedure returned an
error or not.
If there is no way to access this value using the Python-Sybase module,
I would appreciate hearing this. If it is a known bug, I would also
like to hear this.
I don't want to sound overly negative, but does anyone actually use
this module for calling stored procedures? If so, how do you obtain the
result status? It is such a simple question and I cannot find the
answer. One could choose to signal errors in another way that does not
require that the "return status" be known, but I am working with a
Sybase database application that has already been written. And the
standard way to return error codes from any Sybase stored procedure is
via its return status.
I realize that this is the second time I have posted this question.
Please bear with me. I hope that this time someone can help.
Kind regards,
Jeffrey
|