سؤال

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);
هل كانت مفيدة؟

المحلول

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

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top