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
How can I get only one value with ocilib?
-
10-06-2023 - |
سؤال
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);
المحلول
لا تنتمي إلى StackOverflow