Urgent: DCOracle2 + stored procedure parameters
Bayzuldin Timur
bayt at max.net.ua
Fri Aug 30 15:17:37 EDT 2002
> Ruslan Spivak wrote:
> > Hello python-list users,
> >
> > Could anybody explain me the following:
> >
> > I need to pass to stored procedure about 40 parameters - ugly,
> > is it possible to pass a record or similar from python to stored
> > procedure (DCOracle2)
>
> Gerhard Haering wrote:
> I'm not very experienced with DCOracle2, I'm currently using it like this,
> with named parameters:
>
> cursor.callproc("someproc", PN_PROJ_ID=42)
>
> So if you already have a dictionary that maps your parameter names to the
> values you want to pass to the SP, you could use this form:
>
>
> parms = {"PN_PROJ_ID": 42, "PN_FOOBAR": "baz"}
> cursor.callproc("someproc", **parms)
>
> Now I have a question - how are these forms of argument expansion (*args,
> **kwargs) called in Python?
>>> def foo(*args, **kwargs):
... print args
... print kwargs
...
>>> foo(1, 2, 3, 'e', 'Welcome', age=100, name='Bob', question='How are you?')
(1, 2, 3, 'e', 'Welcome')
{'age': 100, 'question': 'How are you?', 'name': 'Bob'}
>>>
P.S.
Best regards,
Timur
More information about the Python-list
mailing list