记录中的clob字段没有内容,用oci库(c语言)的ofetch时报错,ORA-01279: db_files too large,请高人指点

解决方案 »

  1.   


    你oci访问clob字段的代码是怎么写的?
      

  2.   

    /*
      //程序运行结果
      //open oracle success!
      //ErrCode=30,ORA-01279: db_files too large
      //: Success
      
      t1表为一个NUMBER主键字段ID,一个CLOB字段content
      其中有一条content为空的记录,该记录ofetch时出错
      如果content不为空或空串,能正常查出结果
    */#include <stdio.h>
    #include "oci.h"
    #include "oratypes.h"
    #include "ocidfn.h"
    #include "ociapr.h"
    #include "ocidem.h"void ErrMsg(Lda_Def *lda, Cda_Def *cda);int main()
    {
    Lda_Def lda;
    Cda_Def cda;
    ub1 hda[512];
    char szSQL[512],szContent[2000];
    sb2 Indp;
    int nErrFlag = 0;

    if ( orlon(&lda, (ub1*)&hda, "test/test@test", -1, (text*)0, -1, 0) )
            {
      perror("open oracle error!");
              return -1;
            }
    printf("open oracle success!\n"); if ( oopen( &cda, &lda, (text*)0, -1, -1, (text*)0, -1) )
            {
               perror("create sql error!");
       goto LABEL_ERR;
            }
            sprintf( szSQL, "SELECT content from t1" );
            if ( oparse( &cda, (text *)szSQL, (sb4)-1, (sword)0, (ub4)2) )
            {
               perror("oparse sql error!");
               goto LABEL_ERR;
            }
      
             if(odefin(&cda,1,(ub1*)szContent,sizeof(szContent),SQLT_STR,-1,&Indp,(text*)0,-1,-1,(ub2*)0,(ub2*)0) )
    {
    perror("odefin sql error!");
    goto LABEL_ERR;
    }

            if ( oexec(&cda) )
    {
               perror("oexec sql error!");
               goto LABEL_ERR;
    }
      
            //问题在ofetch
            while( !(nErrFlag = ofetch(&cda)) && ( cda.rc != NO_DATA_FOUND ) )
           {
    printf("content=%s\n",szContent);
           }
      
            if ( nErrFlag )
    {
    ErrMsg(&lda,&cda);
    }
      
            if ( oclose(&cda) )
    {
               perror("oclose sql error!");
    }

    LABEL_ERR:
    if ( ologof(&lda) )
    {
               perror("ologof error!");
               return -1;
    }
    return 0;
    }void ErrMsg(Lda_Def *lda, Cda_Def *cda)
    {
      text  ErrMsg[1000];
      sword ErrCode;
      char szMsg[1024];  ErrCode = oerhms( lda, cda->rc, ErrMsg, (sword)sizeof(ErrMsg) );
      sprintf( szMsg, "ErrCode=%d,%s",ErrCode,ErrMsg);
      perror(szMsg);
    }