[DB-SIG] problems with DCOracle2 running on solaris 8 (oracle 8.1.6)
Molina Carron
ernesto.molina@externo.mju.es
Tue, 28 Jan 2003 12:15:58 +0100
Right, this should help.
My data (just a row):
CD_CAMINO 2
CD_TRAMITE Registro
CD_OPERACION 13800
CONDICION ANIO_EXP_FISCALIA & '' # ''
CD_ACCION X>X
PARAMETRO1 ANIO_EXP_FISCALIA
PARAMETRO2 x
PARAMETRO3
PARAMETRO4
----------------------------------------------------------------------------
----------------------------
My problem:
*I get different values for the field Parametro2 depending on how i access
to it: if my query is:
select * from rm_tra_acciones where cd_tramite=:p1 and cd_camino=:p2,
(2, 'Registro',)
it returns a lot of rows, and, when i move to the one above, and ask for my
field Parametro2 it returns None (wrong!)
*On the other hand, if my query is:
select * from rm_tra_acciones where cd_tramite=:p1 and cd_camino=:p2 and
cd_operacion=:p3,
(2, 'Registro',13800,)
and ask my field, it returns x (correct!)
*sqlplus works fine
*No error messagges are returned
*I get data from every query, but not every data is good
----------------------------------------------------------------------------
----------------------
My python code:
def test():
sql=[''' select * from rm_tra_acciones
where cd_tramite=:p1 and cd_camino=:p2
''',
''' select * from rm_tra_acciones
where cd_tramite=:p1 and cd_camino=:p2 and cd_operacion=:p3
''']
params=[('Registro', 2,),('Registro', 2,13800,)]
import DCOracle2
cadenaConn='%s/%s@%s'% ('menores','menores','datos10k')
conn=DCOracle2.connect(cadenaConn)
print 'test1'
cur=conn.cursor()
cur.execute(sql[0],params[0])
rs = cur.fetchall()
print rs[41] ##the row
print 'test2'
cur=conn.cursor()
cur.execute(sql[1],params[1])
print cur.fetchall()[0]
----------------------------------------------------------------------------
--------------------------------
The results:
>python -u etcPythonOracle.py
test1
[2L, 'Registro', 13800L, "ANIO_EXP_FISCALIA & '' # ''", 'X>X',
'ANIO_EXP_FISCALIA', None, None, None]
test2
[2L, 'Registro', 13800L, "ANIO_EXP_FISCALIA & '' # ''", 'X>X',
'ANIO_EXP_FISCALIA', 'x', None, None]
>Exit code: 0
Thanks