GBase 8s
安装配置
文章
#include <stdio.h>
EXEC SQL define FNAME_LEN 31;
EXEC SQL define LNAME_LEN 31;
main()
{
EXEC SQL BEGIN DECLARE SECTION;
char user[ 32 ]="root";
char password[ 32 ]="rootroot";
char tabname[ 32 ];
EXEC SQL END DECLARE SECTION;
printf( "DEMO1 Sample ESQL Program running.\n\n");
EXEC SQL WHENEVER ERROR STOP;
EXEC SQL connect to 'testdb' USER :user USING :password;
EXEC SQL declare democursor cursor for select tabname from systables where tabid>99;
EXEC SQL open democursor;
for (;;)
{
EXEC SQL fetch democursor into :tabname;
if (strncmp(SQLSTATE, "00", 2) != 0)
break;
printf("%s\n",tabname);
}
EXEC SQL close democursor;
EXEC SQL free democursor;
EXEC SQL disconnect current;
printf("\nDEMO1 Sample Program over.\n\n");
exit(0);
}
热门帖子
- 12025-12-01浏览数:183425
- 22023-05-09浏览数:26157
- 42023-09-25浏览数:19827
- 52020-05-11浏览数:18475