oci ofetch 空的clob时出错ORA-01279: db_files too large,高人指点 记录中的clob字段没有内容,用oci库(c语言)的ofetch时报错,ORA-01279: db_files too large,请高人指点 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 你oci访问clob字段的代码是怎么写的? /* //程序运行结果 //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);} oracle在插入数据的时候,如何以每10000条提交一次 请教一个建立ERD的问题 oracle11g安装后打开时显示找不到文件 range关系代数 ORACLE存储过程中的传入参数设置 ORA-06502: PL/SQL: 数字或值错误 : 字符串缓冲区太小 !!!!紧急求救ORAcle高手 如何把下面的這段Sql server代碼轉換為Oracle中的代碼 这个代码错在哪里?关于存储过程与字符串连接的 提问,关于DBMS_SQ的问题 (+)= 用java写了一段程序,生成了一段sql,如何在oracle里判断这段sql正确与否???
你oci访问clob字段的代码是怎么写的?
//程序运行结果
//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);
}