28{
29
30
31
32
33
34
35
36
37
38
39#line 15 "whenever_do_continue.pgc"
40 struct {
41#line 12 "whenever_do_continue.pgc"
42 char ename [ 12 ] ;
43
44#line 13 "whenever_do_continue.pgc"
45 float sal ;
46
47#line 14 "whenever_do_continue.pgc"
48 float comm ;
49 } emp ;
50
51#line 16 "whenever_do_continue.pgc"
52 int loopcount ;
53
54#line 17 "whenever_do_continue.pgc"
55 char msg [ 128 ] ;
56
57#line 18 "whenever_do_continue.pgc"
58
59
61
62 strcpy(msg, "connect");
63 {
ECPGconnect(__LINE__, 0,
"ecpg1_regression" , NULL, NULL , NULL, 0);
64#line 23 "whenever_do_continue.pgc"
65
66if (
sqlca.sqlcode < 0) exit (1);}
67#line 23 "whenever_do_continue.pgc"
68
69
70 strcpy(msg, "create");
71 {
ECPGdo(__LINE__, 0, 1, NULL, 0,
ECPGst_normal,
"create table emp ( ename varchar , sal double precision , comm double precision )",
ECPGt_EOIT,
ECPGt_EORT);
72#line 26 "whenever_do_continue.pgc"
73
74if (
sqlca.sqlcode < 0) exit (1);}
75#line 26 "whenever_do_continue.pgc"
76
77
78 strcpy(msg, "insert");
79 {
ECPGdo(__LINE__, 0, 1, NULL, 0,
ECPGst_normal,
"insert into emp values ( 'Ram' , 111100 , 21 )",
ECPGt_EOIT,
ECPGt_EORT);
80#line 29 "whenever_do_continue.pgc"
81
82if (
sqlca.sqlcode < 0) exit (1);}
83#line 29 "whenever_do_continue.pgc"
84
85 {
ECPGdo(__LINE__, 0, 1, NULL, 0,
ECPGst_normal,
"insert into emp values ( 'aryan' , 11110 , null )",
ECPGt_EOIT,
ECPGt_EORT);
86#line 30 "whenever_do_continue.pgc"
87
88if (
sqlca.sqlcode < 0) exit (1);}
89#line 30 "whenever_do_continue.pgc"
90
91 {
ECPGdo(__LINE__, 0, 1, NULL, 0,
ECPGst_normal,
"insert into emp values ( 'josh' , 10000 , 10 )",
ECPGt_EOIT,
ECPGt_EORT);
92#line 31 "whenever_do_continue.pgc"
93
94if (
sqlca.sqlcode < 0) exit (1);}
95#line 31 "whenever_do_continue.pgc"
96
97 {
ECPGdo(__LINE__, 0, 1, NULL, 0,
ECPGst_normal,
"insert into emp values ( 'tom' , 20000 , null )",
ECPGt_EOIT,
ECPGt_EORT);
98#line 32 "whenever_do_continue.pgc"
99
100if (
sqlca.sqlcode < 0) exit (1);}
101#line 32 "whenever_do_continue.pgc"
102
103
104
105#line 34 "whenever_do_continue.pgc"
106
107
108 {
ECPGdo(__LINE__, 0, 1, NULL, 0,
ECPGst_normal,
"declare c cursor for select ename , sal , comm from emp order by ename collate \"C\" asc",
ECPGt_EOIT,
ECPGt_EORT);
109#line 36 "whenever_do_continue.pgc"
110
111if (
sqlca.sqlcode < 0) exit (1);}
112#line 36 "whenever_do_continue.pgc"
113
114
115
116
117#line 39 "whenever_do_continue.pgc"
118
119
120
121
122#line 42 "whenever_do_continue.pgc"
123
124
125 for (loopcount = 0; loopcount < 100; loopcount++)
126 {
128 ECPGt_char,&(emp.ename),(
long)12,(
long)1,(12)*
sizeof(
char),
130 ECPGt_float,&(emp.sal),(
long)1,(
long)1,
sizeof(
float),
132 ECPGt_float,&(emp.comm),(
long)1,(
long)1,
sizeof(
float),
134#line 46 "whenever_do_continue.pgc"
135
137#line 46 "whenever_do_continue.pgc"
138
139if (
sqlca.sqlcode < 0)
continue;}
140#line 46 "whenever_do_continue.pgc"
141
142
143 printf(
"%s %7.2f %9.2f\n", emp.ename, emp.sal, emp.comm);
144 }
145
146
147
148
149
150
151#line 55 "whenever_do_continue.pgc"
152
153
155#line 57 "whenever_do_continue.pgc"
156
157
158 strcpy(msg, "drop");
160#line 60 "whenever_do_continue.pgc"
161
162
163 exit(0);
164}
bool ECPGconnect(int lineno, int c, const char *name, const char *user, const char *passwd, const char *connection_name, int autocommit)
bool ECPGdo(const int lineno, const int compat, const int force_indicator, const char *connection_name, const bool questionmarks, const int st, const char *query,...)