Dear all,

I am facing problem in executing a query in Pro*c. The below is the function in Pro*C

static int get_LSM_CCLIB(void)
{
int i;

EXEC SQL BEGIN DECLARE SECTION;

int cclib_val_bd_1[NB_FETCH_LSMCCLIB];
VARCHAR cclib_cod_lib_1[NB_FETCH_LSMCCLIB][256];

EXEC SQL END DECLARE SECTION;

fprintf(gf_log,"%s Before executing st_statut_asi_sts query - SQLCODE <%d> : %s\n", FILE_NAME, sqlca.sqlcode, sqlca.sqlerrm.sqlerrmc);

fprintf(gf_log,"Test 6 -> Test_variable - \n");

EXEC SQL
SELECT NVL(CLCIB_LVA_DB,0),NVL(CLCIB_DOC_IBL,'0')
INTO :clcib_lva_db_1,:clcib_doc_ibl_1
FROM lmsoclcib
WHERE clcib_omn_abt = 'STATUT' AND clcib_omn_loc = 'ASI_STS'
ORDER BY CLCIB_LVA_DB ;

fetch_statut_asi_sts = sqlca.sqlerrd[2] ;
for (i = 0 ; i < fetch_statut_asi_sts; i++)
{
st_statut_asi_sts[i].val_bd = cclib_val_bd_1[i];
sprintf(st_statut_asi_sts[i].sLib,"%10s",(char *)cclib_cod_lib_1[i].arr);

fprintf(gf_log,"st_statut_asi_sts[i].val_bd - : %d\n",st_statut_asi_sts[i].val_bd);
fprintf(gf_log,"st_statut_asi_sts[i].sLib - : %s\n",st_statut_asi_sts[i].sLib);
}
fprintf(gf_log,"%s After executing st_statut_asi_sts query - SQLCODE <%d> : %s\n", FILE_NAME, sqlca.sqlcode, sqlca.sqlerrm.sqlerrmc);

if ( 0 > sqlca.sqlcode )
{
fprintf(gf_log,"%s erreur select statut asi_sts - SQLCODE <%d> : %s\n", FILE_NAME, sqlca.sqlcode, sqlca.sqlerrm.sqlerrmc);
fflush (gf_log);
return(N_ERREUR);
}
else if (((1403 != sqlca.sqlcode) || (sqlca.sqlcode != 100)) && (fetch_statut_asi_sts == 0))
{
fprintf(gf_log,"%s tab statut_asi_sts trop petit [%d][%s]\n", FILE_NAME,sqlca.sqlcode,sqlca.sqlerrm.sqlerrmc);
fflush (gf_log);
return(N_ERREUR);
}
}

After the execution the the query in the above function I am receiving the SQL error as "ORA-00100: no data found" (ANSI C mode compilation).

Even after the successful exectuion of the query(The above query fetched 15 records) I am getting the SQLCODE from the above query as "ORA-00100: no data found". Before this function no query is executed.

Can anyone please let me know why I am getting this error and how to resolve it.