[python-sybase] RE: Sybase Module 0.36 Output Parameter Handling
Dave Cole
djc at object-craft.com.au
Fri, 18 Mar 2005 16:42:30 +1100
Dave Cole <djc@object-craft.com.au>Dave Cole
<djc@object-craft.com.au>Dave Cole wrote:
> I just installed ASE 12.5.2 on my machine so I could do some testing. It
> appears there is a problem with the Cursor.callproc() method, but only
> when you use a sequence to pass parameters. Dictionary parameters are
> fine.
>
> The attached sp_test.py program shows my testing.
>
> This program produces the following output (after applying the attached
> callproc.patch to fix sequence argument passing).
>
> {'@num': 12345, '@result': 12345}
> [54321, 54321]
>
> If I remove the comment character from the code that enables the
> debugging I get the output contained in the attached sp_test.log.
>
> So if it is not working with FreeTDS then they are doing something
> slightly differently that is either confusing my code or is incorrect.
I just installed FreeTDS 0.61 (Debian sarge) and the test program fails
to run. The ct_param() functions fail. What I did discover was that
you can fudge it like this:
print db.execute('''
declare @result int
exec sp_test_output 12345, @result output
select @result
''')
It prints the following:
[[], [(12345,)]]
I am now downloading the current cvs snapshot for FreeTDS to see if they
have fixed parameter passing.
- Dave
--
http://www.object-craft.com.au