Question

I'm getting this error:

  code  : ORA-00000
  msg   : The statement is not scrollable

This is the code:

  char query[] ="select max(VQC_ID) from vqc";
  OCI_Statement* st;
  st = OCI_StatementCreate(cn);
  OCI_ExecuteStmt(st, query);
  OCI_Resultset* rs;
  rs = OCI_GetResultset(st);
  OCI_FetchFirst(rs);
  printf("%i \n", OCI_GetInt(rs, 1));
  return  OCI_GetInt(rs, 1);
Était-ce utile?

La solution

Read ocilib documentation and you will have the answer.... You need to declare the statement 'scrollable' in order to use OCI_FetchFirst. If you just want to fetch only one value, use OCI_FetchNext

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top