What do other database adaptors do about stored procedure return values? The control is returned to the calling routine. Making the transaction-handling statements a part of the client code serves a two-fold purpose; the server code is more portable, and the distributed transactions can be independent of the server code. Opens an existing table. Dear SAP Community Member, In order sjbase fully benefit from what the SAP Community has to offer, please register at:. Handling Input and Output Parameters Input and output parameters are passed to an AEP using tables. NET Framework Data Parqmeter for ODBC treat parameters in a stored procedure as placeholders and apply parameter values in order.
Skip Montanaro I've stumbled on a problem with the python-sybase module. Currently, the python-sybase module provides I believe the ability to set output parameters those specified as such in the argument dictionaryand you can iterate over all the result sets the stored procedure produces. Looking at the Python database API PEPI saw no mention of the return status:.
The sequence of parameters must contain one entry for each argument that the procedure expects. The result of the call is returned as modified copy of the input sequence. The procedure may also provide a result set as output. This must then be made available through the standard. I see no mention of how to handle the return value. The "modified copy of the input sequence" is just that. In the case of the paramefer module, any parameter values optipnal the input dictionary of type DataBufType are rewritten with values from the first row of the first result set.
I haven't had a chance to try it out yet. My concern is more that the Python database API doesn't mention stored procedure return values at all. What do other database adaptors do about stored procedure return values? Does PEP need revision? All Groups Python python-list. NUMBER As a general solution, one might wrap a stored procedure that returns a value into a stored procedure that has an output parameter and call it with callproc. Some implementations might include a return value in.
On Wed, Mar 12, at PM, Skip Montanaro wrote: What do otional database adaptors do about stored procedure return values? On Mar 13,at AM, Ian Kelly wrote: As a general solution, one might wrap a stored procedure that returns a value into a stored procedure that has an output parameter and call it with callproc. Some implementations might include a return value in the parameter list anyway. John Gordon That will get the return value into an SQL variable, but the OP wanted to know how to fetch it from python code.
Skip Montanaro Thanks for the responses. We eventually figured out there appears to be a bug in the latest version of the python-sybase module at least in 0. Testing a fix now. Thanks for the responses. Chris Angelico In forex account opening india drought, that should produce a one-row-one-column SELECT result, which can then be retrieved as such. I say "in theory" because not all back-end databases support the "from dual" notation - which, by the way, I find extremely odd; what's 'dual' about it?
On Fri, Mar 14, at AM, John Gordon wrote: select foo outut value from dual. Random DUAL is an Oracle thing. It used to have two rows, in order to be used to duplicate results by doing a cartesian join sybase optional output parameter dictionary it. At some point, that was removed, but the name stuck. Most other servers allow SELECT without FROM.
On Thu, Mar oitput,atChris Angelico wrote: On Fri, Mar 14, at AM, John Gordon wrote: select foo as value from dual. Chris Angelico Yeah, I usually use PostgreSQL which does. I don't remember what DB2 has. MySQL I think requires either DUAL or an actual real table. On Zybase, Mar 14, at AM, wrote: DUAL is an Oracle thing.
ListFeatureClasses return only one file. Py3 - converting bytes to ascii. Python sample code for PLSQL REF CURSORS. MySQLDB - return strange type of variable. Skip Montanaro Mar 12, at pm. Ian Kelly at Mar 12, at pm. Petite Abeille at Mar 12, at pm. John Gordon at Mar 13, at pm. Skip Montanaro at Mar 13, at pm. Chris Angelico sybase optional output parameter dictionary Mar 13, at pm. Random at Mar 13, at pm.
Chris Angelico at Mar 13, at pm thread post python-list Mar 12, '14 at p Mar 13, '14 at p expanded variable avatars.
Making method parameters optional by specifying parameter defaults in arabic
Using a Stored Procedure with Output Parameters. [ parameter ][,[ parameter @managerID INT OUTPUT AS BEGIN SELECT @managerID = ManagerID FROM. 3 Triggers and Stored Procedures. Microsoft SQL Server or Sybase Adaptive Server stores triggers and stored procedures [ OUTPUT ] [,@formal_ parameter. In the case of the python- sybase module, any parameter values in the input procedure that has an output parameter and y to refer to the optional.