[DB-SIG] DCOracle2 and callproc

Matthew T. Kromer matt@zope.com
Thu, 02 Jan 2003 10:23:02 -0500


Marcos S=E1nchez Provencio wrote:

>Happy new year from Madrid
>
>I am using DCOracle2 to access Ora9i in Linux. I have a bunch of
>preocedures in a package that were designed to be used from ADODB in
>Visual Basic. They return a resultset, so they act similar to
>Sybase/MSSQL stored procedures. I have managed to execute them and the
>results look fine, but the description shows nothing.
>
>Is there any solution (besides knowing in advance the columns returned)
>
>This is the code:
>
>cur=3Dcon.cursor()
>  =20
>ret,res=3Dcur.callproc('SOCOWNER.APP_ModoLista.APP_ModoLista','jaen',Non=
e)
>print ret,res.description
>print res.fetchall()
>
>###Results are
>jaen None
>[['DEN', 'Denominaci\xf3n', 'a', 2.0, '-', None], ['SEC', 'Fecha
>Inscripci\xf3n', 'bFechas', 3.0, '-', None], ['AMB', '\xc1mbito',
>'cambito', 4.0, '-', None], ['FAS', 'Fases', 'dfase', 5.0, '-', None],
>['CLA', 'Clasificaci\xf3n Inscritas', 'fcla', 6.0, '-', None], ['PER',
>'Intervinientes', 'm', 7.0, '-', None], ['EST', 'Listados', 'Informes',
>8.0, '-', None], ['LOT', 'Tramitaci\xf3n', 'elot', 9.0, '-', None],
>['DOC', 'Mantenimiento Firmantes', 'Documentos', 10.0, '-', None],
>['LOC', 'Localidades', 'Localidad', 11.0, '-', None], ['VIN',
>'Mantenimiento Car\xe1cter', 'ClasiSub', 12.0, '-', None]]
>
>Thanks
>
>
> =20
>

Newer versions of the python part of DCOracle2 should automatically=20
describe a result cursor from a stored procedure so that the description=20
attribute is pre-set.  You can also call cursor.describe() to force the=20
description to be re-fetched, but I'd just suggest you check out the=20
latest CVS copy.