[Zope-DB] Re: Probably bug in DCOracle2

Matthew T. Kromer matt@zope.com
Fri, 08 Nov 2002 10:00:42 -0500


Bo M. Maryniuck wrote:

>Hi, Matt and Zope DB Folks.
>
>There is _probably_ a bug in DCOracle2, but I'm not sure, let us see. Here is 
>a function on Oracle 8i which returns VARCHAR2:
>
>function PM.PM_08.CLOB_FPRINT returns OUT VARCHAR2, has arguments:
>        P_ID IN NUMBER
>        P_AMOUNT IN NUMBER
>        P_POS IN NUMBER
>
>And if you want get it via Zope PythonScript, you can set P_AMOUNT only up to 
>0xFF and only then it works:
>
>	result = context.cFprint(P_ID = 9653, P_AMOUNT=256, P_POS = 250)
>
>But if you want to set some bigger value (e.g. 257 or 3000), you'll get an 
>error:
>
>Error Value: (6502, 'ORA-06502: PL/SQL: numeric or value error: character 
>string buffer too small\nORA-06512: at line 1')
>
>On the other hand, if you do in ZSQLMethod something like:
>
>	select pm.pm_08.clob_fprint(9653, 3000, 1) from dual
>
>There is no problem and I get the result I want. So this is probably a bug and 
>probably DCOracle2 tries to handle VARCHAR2 as 0xFF string. Any suggestions?
>
>  
>

If you can export DCO2TRACEDUMP=dco2.tracedump it really helps to track 
down what ended up happening, such as converting a number to a 1 byte 
string (which should not happen).

-- 
Matt Kromer
Zope Corporation  http://www.zope.com/