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 -> OCI 8 :- ORA-24370 on piecewise (callback) insert.

OCI 8 :- ORA-24370 on piecewise (callback) insert.

From: Tom Fosdick <tom_at_easysoft.FISH.com>
Date: 3 Dec 1999 11:58:36 GMT
Message-ID: <828b9c$vns$1@alsvider.easysoft.com>


I'm at my wits end on this one. I have a situation where I need to insert a LONG, and rather than using the polling method I thought I'd try using callbacks, except when the callback executes I get "ORA-24370: illegal piecewise operation attempted" returned from OCIStmtExecute. This would appear to indicate that SQLT_LVB is not a valid type for a piecewise insert.

The abbreviated code for what I'm doing is as follows.

sb4 callback(...)
{

   *alenp = fread(buffer,1,BUFSIZ,file);    if(feof(file))
   {

       if(iter)

*piecep=OCI_LAST_PIECE;
else
*piecep=OCI_ONE_PIECE;

   }
   else
   {
       if(iter)

*piecep=OCI_NEXT_PIECE;
else
*piecep=OCI_FIRST_PIECE;

   }
   *bufpp=buffer;
   *indpp=<an sb2>;
   return OCI_CONTINUE;
}

main()
{

    /* Session setup */
    /* CREATE TABLE TEST (FNAME VARCHAR(40), FCONTENT LONG); */     OCIHandleAlloc(Stmt,OCI_HTYPE_STMT);

    OCIStmtPrepare(Stmt,Err,"INSERT INTO TEST VALUES ( :FN , :FC )",

        ..,OCI_DEFAULT);     OCIBindByName(Stmt,&BindFN,Err,":FN",3,fnamestr,strlen(fnamestr),

        ,SQLT_STR,NULL,NULL,NULL,0,NULL,OCI_DEFAULT);     OCIBindByName(Stmt,&BindFC,Err,":FC",3,0,SB4MAXVAL,

        ,SQLT_LVB,NULL,NULL,NULL,0,NULL,OCI_DATA_AT_EXEC);     OCIBindDynamic(BindFC,Err,&MyStruct,0,<do nothing function>);

    OCIStmtExecute(Service,Stmt,Err,1,0,NULL,NULL,OCI_DEFAULT); }

Presumable I've missed or misunderstood something in the manual somewhere... *where* is the question!

Any help much appreciated.
--
-Tom Fosdick
Software Developer, Easysoft Ltd.
tom (at) easysoft (dot) com
Do not be fooled by the FISH. Received on Fri Dec 03 1999 - 05:58:36 CST

Original text of this message

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