Michael:<br>Last time I looked at the code of django-mssql it was using a fork of adodbapi, not the code I maintain, which is included with pywin32. Nevertheless, I don't think there are any changes in the return parameter handling between the two forks.<br>
<br>I just ran across a related page on the AS/400 Python site (of all places) which led me to thinking that I don't really understand how return parameters are supposed to work. I have just blindly kept the code that Ekelund wrote. The test in adodbapi is probably too simple to pick up any edge cases, and the AS/400 version is interesting enough to make me say "Huh?" <br>
<br>I think I'll run a version of your question into the python database group, and see what they say. It's definitely weird and should either be made more obvious or documented, or both. Let's keep this discussion running.<br>
--<br>Vernon<br><br><div class="gmail_quote">On Wed, Jun 20, 2012 at 8:50 AM, Michael Manfre <span dir="ltr"><<a href="mailto:mmanfre@gmail.com" target="_blank">mmanfre@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I'm the maintainer of django-mssql and I've run in to an odd behavior when trying to retrieve a stored procedure's output parameters. The parameters (including return value) appear to only get fetched when the last recordset for the stored procedure is loaded. This last recordset appears as if the underlying layer is doing a select, and adding this extra recordset, for the parameters.<br>
<br>The observed behavior is equivalent to this bit of SQL.<br><br><blockquote style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex" class="gmail_quote">DECLARE @retval int, @someOut int<br>
exec @retval = uspReturnsAResultSetOrTwo @someOut OUTPUT<br>SELECT @retval, @someOut<br></blockquote><div><br>I haven't been able to find any documentation stating that this is the intended behavior and this doesn't match my experience of using stored procedures with <a href="http://ADO.NET" target="_blank">ADO.NET</a>. Is this expected behavior? Is there some combination of cursor types or attributes to get the output parameter values without fetching/skipping all the recordsets?<br>
<br>Regards,<br>Michael Manfre<br></div>
<br>_______________________________________________<br>
python-win32 mailing list<br>
<a href="mailto:python-win32@python.org">python-win32@python.org</a><br>
<a href="http://mail.python.org/mailman/listinfo/python-win32" target="_blank">http://mail.python.org/mailman/listinfo/python-win32</a><br>
<br></blockquote></div><br>