djhenderson / pyodbc

Automatically exported from code.google.com/p/pyodbc
MIT No Attribution
0 stars 0 forks source link

Provide a non DB-api compliant callproc #154

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
In some cases it would be immensely useful to call stored procedures which set 
output parameters. I don't think it would hurt that much to introduce some 
ability to indicate the parameter direction. I've tried implementing something 
like this for adodbapi and it seems to work.

# inside adodbapi:
class Inp(str):
    direction = adc.adParamInput

class Out(str):
    direction = adc.adParamOutput

class InOut(str):
    direction = adc.adParamInputOutput

# to be used like this
from adodbapi import Inp, Out

cursor.callproc('GetOrderStatus', {
    Inp('IdOrder'): 1327844,
    Out('OrderState'): 0,
})

Original issue reported on code.google.com by sad.n...@gmail.com on 4 Feb 2011 at 2:30

GoogleCodeExporter commented 9 years ago

Original comment by mkleehammer on 28 Feb 2011 at 12:43