Dear all:

I read page 2-36 of OCI programming guide,and add a indicator variable to
this field,but the error still the same when the "null" value fetched.

here is part of the program:

.....
text* sqlCmd = (text*)"SELECT * FROM TEST";
OCIStmtPrepare(stmthp,errhp,sqlCmd,strlen((char*)s qlCmd),OCI_NTV_SYNTAX,OCI_DEFAULT);
OCIStmtExecute(svchp,stmthp,errhp,0,0,NULL,NULL,OC I_STMT_SCROLLABLE_READONLY);

printf("TEST_ID\tTEST_NAME\tTEST_NOTE\n");
printf("-------\t---------\t---------\n");
bool o_flag = false;
int test_id = 0;
char test_name[31] = "";
char test_note[51] = "";
sb2 ind = 0;
ub2 rlenp = 0;
ub2 rcodep[31] = {0};
sword rc = 0;
while(!o_flag){
OCIDefineByPos(stmthp,&defnp,errhp,1,&test_id,size of(int),SQLT_INT,0,0,0,OCI_DEFAULT);
OCIDefineByPos(stmthp,&defnp,errhp,2,test_name,30, SQLT_STR,0,0,0,OCI_DEFAULT);
OCIDefineByPos(stmthp,&defnp,errhp,3,test_note,50, SQLT_STR,&ind,&rlenp,rcodep,OCI_DEFAULT);
memset(test_name,0,31);
memset(test_note,0,51);
ind = 0;
rlenp = 0;
memset(rcodep,0,31);
rc = OCIStmtFetch2(stmthp,errhp,1,OCI_FETCH_NEXT,0,OCI_ DEFAULT);
switch(rc){
case OCI_NO_DATA:
o_flag = true;
break;
case OCI_ERROR:
report_error(errhp);
o_flag = true;
printf("ind:%d,rlenp:%d,rcodep:%s\n",ind,rlenp,rco dep);
break;
case OCI_SUCCESS:
case OCI_SUCCESS_WITH_INFO:
printf("%d\t%s\t%s\n",test_id,test_name,test_note) ;
printf("ind:%d,rlenp:%d,rcodep:%s\n",ind,rlenp,rco dep);
break;
}
}
......

is there anything wrong to use indicator variable?