tt.ec:
Exec sql include sqlca;
extern void err_p();
main()
{
/********/
EXEC SQL BEGIN DECLARE SECTION;
char user[30],passwd[30];
EXEC SQL END DECLARE SECTION;
/******/
EXEC SQL WHENEVER SQLERROR CALL err_p();
/****SQL SERVERRRR*/
printf("\nplease enter your userid "
;
gets(user);
printf("\npassword "
;
gets(passwd);
EXEC SQL connect :user identified by
asswd;
EXEC SQL use SIMBKWKDB;
EXEC SQL select * from simbksysctl;
/*************/
EXEC SQL disconnect all;
return (0);
}
void err_p()
{
printf("\nError occurred: code %d.\n%s", \
sqlca.sqlcode, sqlca.sqlerrm.sqlerrmc);
}
mk:
cpre -y -l -m tt.ec
cc -I/sybase/include -I/sybase/incl/c++ -I/sybase/incl/public -c tt.c
cc -I/sybase/include -c /sybase/include/sybesql.c
CC -I/sybase/include -D_H_LOCALEDEF -o tt sybesql.o tt.o -L/sybase/lib -lct -lcs -lsrv -ltcll -lsybdb -lcomn -lintl -lm -lnsl -lsocket
Exec sql include sqlca;
extern void err_p();
main()
{
/********/
EXEC SQL BEGIN DECLARE SECTION;
char user[30],passwd[30];
EXEC SQL END DECLARE SECTION;
/******/
EXEC SQL WHENEVER SQLERROR CALL err_p();
/****SQL SERVERRRR*/
printf("\nplease enter your userid "
![](https://i-blog.csdnimg.cn/blog_migrate/fe73079e9dc8d536d374bf3235c356e2.gif)
gets(user);
printf("\npassword "
![](https://i-blog.csdnimg.cn/blog_migrate/5dd12fc85ce51f908962891a4ca1c874.gif)
gets(passwd);
EXEC SQL connect :user identified by
![](https://i-blog.csdnimg.cn/blog_migrate/06be8ef3e46a04aee3708a71f2d0b6d9.gif)
EXEC SQL use SIMBKWKDB;
EXEC SQL select * from simbksysctl;
/*************/
EXEC SQL disconnect all;
return (0);
}
void err_p()
{
printf("\nError occurred: code %d.\n%s", \
sqlca.sqlcode, sqlca.sqlerrm.sqlerrmc);
}
mk:
cpre -y -l -m tt.ec
cc -I/sybase/include -I/sybase/incl/c++ -I/sybase/incl/public -c tt.c
cc -I/sybase/include -c /sybase/include/sybesql.c
CC -I/sybase/include -D_H_LOCALEDEF -o tt sybesql.o tt.o -L/sybase/lib -lct -lcs -lsrv -ltcll -lsybdb -lcomn -lintl -lm -lnsl -lsocket