[python-sybase] Sybase Module 0.36 Output Parameter Handling

Bradley Feldman bradley at bradleyloritheo.com
Wed, 16 Mar 2005 13:21:27 -0800


I have a question about the handling of Output Parms which is a new =
feature
of 0.36.  I understand how to pass the output parm syntax to the =
database
within the callproc as given in the release notes, but how to I see the
value passed back?  This seems simple, but there is no example of =
evaluating
the resulting parameter and I can't seem to figure it out.

For example:

C.callproc ('testproc', {'@parm1': 'value1', '@outputparm':
Sybase.OUTPUT(1)})

If I print the callproc object after it executes I get back something =
like:
{'@parm1':'value1','@outputparm': <DataBufType object at 0x2a394999>}

So how to I examine the contents of the DataBufType object, using python =
db
api syntax?

Finally, what does the "1" in Sybase.OUTPUT(1) mean?   A buffer size of =
1
byte?  A value of 1 contained in one byte?  Can I simply pass a variable
reference instead, such as Sybase.OUTPUT(thisVar)?

Thanks so much for your help, in advance.

*Bradley