[Zope] Error handling in zope/ ext method calling a sproc to insert data into sql db?

Alisa K alisa2k@yahoo.com
Fri, 17 Jan 2003 16:00:10 -0800 (PST)


I'm glad to get a response on this-  I still have a
question...

--- Dieter Maurer <dieter@handshake.de> wrote:
> Alisa K wrote at 2003-1-15 12:13 -0800:
>  > .... data entered in SQL database through stored
> procedure ...
>  > Currently there is no error handling and all
>  > submissions seem to "go through," even when the
> sproc
>  > insert fails.

> Then "sproc" does something wrong. It should raise
> an exception when it fails.

The sql stored procedure ("sproc") I am using to
insert data apparently sends a return code (a
numerical code) no matter if it successfully inserts
data into the database or fails due to a conflict of
business rules.  I think this return code (ex:  return
ireturncode = 115 ) is seen/returned when calling the
sproc from sql Query Analyzer.  However, when I call
it from zope (zsql method) or from a python external
method I don't seem to trap this return code.  I see
nothing-

> Your "sproc" must somehow tell whether or not it
> failed.

Is this return code enough of an indication that the
sql stored procedure failed??  Am I simply not
trapping it properly from zope?

I hope to test your suggestion of raising an exception
from inside the sproc instead of sending a numerical
return code.

Thanks,
Alisa





__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com