PRO*C程序每次FETCH100行,惯用法是如何实现的?
程序代码:
#include<stdio.h> EXEC SQL INCLUDE sqlca; void sqlerror(); int main(void) { EXEC SQL BEGIN DECLARE SECTION; char *uid="scott/scott@testdb"; unsigned empno; char ename[11]; double sal; EXEC SQL END DECLARE SECTION; EXEC SQL WHENEVER SQLERROR DO sqlerror(); EXEC SQL CONNECT :uid; EXEC SQL DECLARE emp_cursor CURSOR FOR SELECT empno,ename,sal from emp; EXEC SQL OPEN emp_cursor; while(1){ EXEC SQL WHENEVER NOT FOUND DO BREAK; EXEC SQL FETCH emp_cursor INTO :empno,:ename,:sal; //这里每次只fetch一行,想每次fetch100行的话,惯用法是什么? fprintf(stdout,"%d %s %lf\n",empno,ename,sal); } EXEC SQL CLOSE emp_cursor; exit(0); } void sqlerror() { EXEC SQL WHENEVER SQLERROR CONTINUE; fprintf(stderr,"sqlcode=%d\n%-70s\n",sqlca.sqlcode,sqlca.sqlerrm.sqlerrmc); exit(1); }具体要求请参看程序注释处,我想知道惯用法是怎样的?