Re: [Sqlrelay-discussion] Error in Oracle procedure and strange SQLRelay behaviour
Brought to you by:
mused
|
From: Maciej W. <mac...@co...> - 2005-09-07 13:00:51
|
Hi!
> I've seen errors like that when 2
> versions of SQL Relay are installed on the same machine and the Python
> API was compiled against 1 but ends up being run against another at run
> time.
I did more tests and example below causes same error
as described in previous mail. I've
checked this on two different servers with sqlrelay 0.36.4
installed. We've cleaned system and installed sqlrelay again
and the problem persists so I don't think it's because of
different sqlrelay versions.
#------------------------------------------------------------------
PROCEDURE PROC_2(a_varchar_out OUT zm_varchar%TYPE,
a_number_out OUT zm_number%TYPE,
a_varchar_in IN zm_varchar%TYPE,
a_number_in IN zm_number%TYPE)
IS
a_number NUMBER (10,2);
a_varchar VARCHAR2(10);
BEGIN
a_varchar_out := a_varchar_in;
a_number_out := a_number_in;
END;
#------------------------------------------------------------------
types are:
zm_number NUMBER(10,2);
zm_varchar VARCHAR2(10);
I call it like this from Python:
#------------------------------------------------------------------
from SQLRelay import PySQLRClient
from SQLRelay import PySQLRDB
con=PySQLRClient.sqlrconnection('localhost',9000,'','test','test',0,1)
cur=PySQLRClient.sqlrcursor(con)
res = cur.prepareQuery('begin PCK_TESTY_STEROWNIKA.PROC_2(:out1, :out2, :in1, :in2); end;')
cur.inputBind('p1', 'xxxx', 0, 0)
cur.inputBind('p2', None, 0,0) #ERROR APPEARS WHEN None IS BINDED
cur.defineOutputBind('out1', 100)
cur.defineOutputBind('out2', 100)
res = cur.executeQuery()
print 'res:', res, cur.errorMessage()
print 'out1:', cur.getOutputBind('out1')
print 'out2:', cur.getOutputBind('out2')
print 'end'
#------------------------------------------------------------------
--
Maciej Wisniowski
|