Re: cx_Oracle issues
On Dec 10, 9:48 am, huw_at1 <[EMAIL PROTECTED]> wrote: > Hey all. When using cx_Oracle to run a procedure like: > > cursor.execute("select (obj.function(value)) from table where > id=blah") > > I am getting the following error: > > ORA-06502: PL/SQL: numeric or value error: character string buffer too > small ORA-06512: at line 1 > > Looking at cursor.description I get: > > [('(obj.function(value))', , 4000, 4000, 0, > 0, 1)] > > Any tips - i have never seen this error before but am guessing that > the value being returned is too big for the buffer size set for the > cursor. the procedure fetches data from a LOB. > > Any suggestions/confirmations? > > Many thanks This error is a problem with the PL/SQL, not cx_Oracle. You need to debug obj.function to see what kind of data is being accessed and then a data analysis of that data to understand why this error occurs. I can tell you the function is most likely expecting characters from a column that are numeric [0 .. 9] and is getting alpha characters. -- Ron Reidy Sr. Oracle DBA -- http://mail.python.org/mailman/listinfo/python-list
Re: cx_Oracle issues
On Dec 15, 2:44 am, huw_at1 wrote: > On Dec 11, 5:34 pm, "ron.re...@gmail.com" wrote: > > > > > > > On Dec 10, 9:48 am, huw_at1 wrote: > > > > Hey all. When usingcx_Oracleto run a procedure like: > > > > cursor.execute("select (obj.function(value)) from table where > > > id=blah") > > > > I am getting the following error: > > > > ORA-06502: PL/SQL: numeric or value error: character string buffer too > > > small ORA-06512: at line 1 > > > > Looking at cursor.description I get: > > > > [('(obj.function(value))', , 4000, 4000, 0, > > > 0, 1)] > > > > Any tips - i have never seen this error before but am guessing that > > > the value being returned is too big for the buffer size set for the > > > cursor. the procedure fetches data from a LOB. > > > > Any suggestions/confirmations? > > > > Many thanks > > > This error is a problem with the PL/SQL, notcx_Oracle. You need to > > debug obj.function to see what kind of data is being accessed and then > > a data analysis of that data to understand why this error occurs. I > > can tell you the function is most likely expecting characters from a > > column that are numeric [0 .. 9] and is getting alpha characters. > > > -- > > Ron Reidy > > Sr. Oracle DBA > > Hi thanks for the responses. Unfortunately the procedure in question > is from a third party vendor so I can't really debug it so I'd say I > was fairly stumped. Just out of interest how do you increase the > output buffer size withcx_Oracle? > > Many thanks- Hide quoted text - > > - Show quoted text - Hi, Sure you can. You can see the PL/SQL source from the ditionary view ALL_SOURCE: select text from all_source where name = 'NAME_OF_FUNCTION'; >From there, reverse engineeer which table(s) and column(s) are being accesses and do the data analysis. -- Ron Reidy -- http://mail.python.org/mailman/listinfo/python-list
Problems with cx_Oracle and Oracle 11.1 on Windows
Hi, I am trying to use cx_Oracle and SQLAlchemy with Oracle 11gR1 (11.1) on Windows Vista 64 bit. When I import cx_Oracle, I get this error: >>> import cx_Oracle Traceback (most recent call last): File "", line 1, in ImportError: DLL load failed: %1 is not a valid Win32 application. I have a full install of Oracle (not an instant client). I know in UNIX, you have to set the LD_LIBRARY_PATH variable, but I am not sure if there is an equivalent in Windows. Has anyone else here run into this? Or, can anyone offer me suggestions on how to get this import to work correctly? Thank you so much for any help you can give me. -- Ron Reidy -- http://mail.python.org/mailman/listinfo/python-list