一个关于嵌入式sql语言的问题!
我建立了student数据库,里面有个student表,也存有数据的!
下面是我用c语言编写的,可以通过绑定,但是在vc里面编译是却得不到所要的数据!!
请大虾指点一下!谢谢!
#include<stdio.h>
exec sql include sqlca;
int main()
{
exec sql begin declare section;
char stuno[7];
exec sql end declare section;
exec sql connect to student;
exec sql declare stucursor cursor for select sno from student;
exec sql open stucursor;
while(1)
{
exec sql fetch stucursor into :stuno;
if (sqlca.sqlcode!=0) break;
printf("%s",stuno);
}
exec sql close stucursor;
}