Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Reading clobs from external c procedure called from PL/SQL

Re: Reading clobs from external c procedure called from PL/SQL

From: Andreas <andreas_at_volcanomail.com>
Date: 8 Feb 2002 03:16:56 -0800
Message-ID: <dad35c78.0202080316.64b8f541@posting.google.com>


Found it, I somehow forgot to initialise 'amtp' before the call to OCILobRead().

> I have problems reading clobs from Oracle 8.1.7.
>
> In a session, the first call to OCILobRead() will work.
> All OCILobRead() calls after that will only read up to the
> length of the first read clob within that session.

>
> ___CUT___
> plain=(char*)malloc( (long)lenp +1 );
> memset ((void *)plain, '\0', (long)lenp+1);
>
> // read the clob until no more data is available
> do{
> err = OCILobRead(svchp, errhp, lobplain, &amtp, offset,
> (dvoid *) (plain+offset-1), (ub4)lenp , (dvoid *) 0,
> NULL, (ub2) 0, (ub1) SQLCS_IMPLICIT);
>
> if (err == OCI_SUCCESS || err == OCI_NEED_DATA){
> offset +=amtp;
> }
>
> } while (err == OCI_NEED_DATA);
>
> ___CUT___

> Received on Fri Feb 08 2002 - 05:16:56 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US