[Zope-DB] Clob's in DCOracle2

Bogdan M. Maryniuck b.maryniuk at forbis.lt
Mon Jul 19 12:20:51 EDT 2004


On Mon, Jul 19, 2004 at 11:07:31AM -0400, Matthew T. Kromer wrote:
> You should be able to.   I haven't tried in some time though.   There's 
> a LOB creation mechanism that lets you make a new empty LOB object if 
> you need to use one as an IN parameter.

...

> Errors like that are really invalid handles.  What it means for some
> reason is that the handle it tried to use on a call was invalid.  The
> routine RaiseOCIError doesn't get the actual status code of the result
> which almost for sure was an invalid handle status code.
> 
> It *could* be that you need the database to allocate and return the LOB
> you want for you with the EMPTY_CLOB() function, e.g. "SELECT
> EMPTY_CLOB() AS CLOB FROM DUAL"

Matt, can you help me to get know why this does not work:

 FUNCTION GET_CLB RETURN CLOB IS
 clb_test CLOB;
 BEGIN
   dbms_lob.createtemporary(lob_loc => clb_test, CACHE => TRUE);
   DBMS_LOB.writeappend(clb_test, Length ( 'Hi there!' ), 'Hi there!');
   RETURN clb_test;
 END GET_CLB;

...and output just strange:

----------------------------------------------
Traceback (most recent call last):
  File "clobprocedure.py", line 35, in ?
    print out.read()
dco2.DatabaseError: (1075348352,
'\\\x06\x04@\x90\x87\x18 at h\x9e(\x08\xeag\x03@\\\x06\x04@\x90\x87\x18 at X\xd8+\x082\xec\x0b\x08|G\x0f\x08\xd4\xd9+\x08\x88\x97\x0f')
\@��@��b�
        |�ħL�������
----------------------------------------------

So what I _exactly_ should do? Do "c.execute('select EMPTY_CLOB() as CLOB from dual')"
before I call procedure? But this is does not works... Or rewrite
procedure somehow? If yes, then how?

-- 
Regards, Bogdan M. Maryniuk
Developer. Forbis UAB


More information about the Zope-DB mailing list