7#define ECPGdebug(X,Y) ECPGdebug((X)+100,(Y))
9#line 1 "array_of_struct.pgc"
20#line 3 "array_of_struct.pgc"
24#line 5 "array_of_struct.pgc"
27#line 6 "array_of_struct.pgc"
30#line 7 "array_of_struct.pgc"
34#line 12 "array_of_struct.pgc"
37#line 13 "array_of_struct.pgc"
40#line 14 "array_of_struct.pgc"
44#line 19 "array_of_struct.pgc"
47#line 20 "array_of_struct.pgc"
50#line 21 "array_of_struct.pgc"
54#line 26 "array_of_struct.pgc"
57#line 27 "array_of_struct.pgc"
70#line 36 "array_of_struct.pgc"
71 struct varchar_2 {
int len;
char arr[ 50 ]; }
name ;
73#line 37 "array_of_struct.pgc"
77#line 38 "array_of_struct.pgc"
96#line 32 "array_of_struct.pgc"
99#line 33 "array_of_struct.pgc"
102#line 39 "array_of_struct.pgc"
103 customer2 custs2 [ 10 ] ;
105#line 44 "array_of_struct.pgc"
107#line 42 "array_of_struct.pgc"
108 struct varchar_3 {
int len;
char arr[ 50 ]; }
name ;
110#line 43 "array_of_struct.pgc"
114#line 49 "array_of_struct.pgc"
116#line 47 "array_of_struct.pgc"
117 struct varchar_4 {
int len;
char arr[ 50 ]; }
name ;
119#line 48 "array_of_struct.pgc"
123#line 51 "array_of_struct.pgc"
126#line 53 "array_of_struct.pgc"
129#line 54 "array_of_struct.pgc"
130 struct varchar_5 {
int len;
char arr[ 50 ]; } onlyname [ 2 ] ;
132#line 55 "array_of_struct.pgc"
137 {
ECPGconnect(__LINE__, 0,
"ecpg1_regression" , NULL, NULL , NULL, 0);
138#line 59 "array_of_struct.pgc"
141#line 59 "array_of_struct.pgc"
144#line 59 "array_of_struct.pgc"
148#line 61 "array_of_struct.pgc"
151#line 61 "array_of_struct.pgc"
154#line 61 "array_of_struct.pgc"
158 strcpy(custs1[0].
name.arr,
"John Doe");
160 custs1[0].
phone = 12345;
166 {
ECPGdo(__LINE__, 0, 1, NULL, 0,
ECPGst_normal,
"insert into customers values ( $1 , $2 )",
171#line 73 "array_of_struct.pgc"
174#line 73 "array_of_struct.pgc"
177#line 73 "array_of_struct.pgc"
180#line 73 "array_of_struct.pgc"
182 {
ECPGdo(__LINE__, 0, 1, NULL, 0,
ECPGst_normal,
"insert into customers values ( $1 , $2 )",
187#line 75 "array_of_struct.pgc"
190#line 75 "array_of_struct.pgc"
193#line 75 "array_of_struct.pgc"
196#line 75 "array_of_struct.pgc"
200 memset(custs1, 0,
sizeof(
customer) * 10);
208#line 81 "array_of_struct.pgc"
211#line 81 "array_of_struct.pgc"
214#line 81 "array_of_struct.pgc"
217#line 81 "array_of_struct.pgc"
220 for (r = 0; r < 2; r++)
223 printf(
"phone - %d\n", custs1[r].phone );
227 ECPGt_varchar,&(custs2->name),(
long)50,(
long)10,
sizeof( customer2 ),
229 ECPGt_int,&(custs2->phone),(
long)1,(
long)10,
sizeof( customer2 ),
231#line 89 "array_of_struct.pgc"
234#line 89 "array_of_struct.pgc"
237#line 89 "array_of_struct.pgc"
240#line 89 "array_of_struct.pgc"
243 for (r = 0; r < 2; r++)
246 printf(
"phone - %d\n", custs2[r].phone );
250 ECPGt_varchar,&(custs3->name),(
long)50,(
long)10,
sizeof(
struct customer3 ),
252 ECPGt_int,&(custs3->phone),(
long)1,(
long)10,
sizeof(
struct customer3 ),
254#line 97 "array_of_struct.pgc"
257#line 97 "array_of_struct.pgc"
260#line 97 "array_of_struct.pgc"
263#line 97 "array_of_struct.pgc"
266 for (r = 0; r < 2; r++)
269 printf(
"phone - %d\n", custs3[r].phone );
273 ECPGt_varchar,&(custs4.name),(
long)50,(
long)1,
sizeof(
struct customer4 ),
275 ECPGt_int,&(custs4.phone),(
long)1,(
long)1,
sizeof(
struct customer4 ),
277#line 105 "array_of_struct.pgc"
280#line 105 "array_of_struct.pgc"
283#line 105 "array_of_struct.pgc"
286#line 105 "array_of_struct.pgc"
289 printf(
"name - %s\n", custs4.name.arr );
290 printf(
"phone - %d\n", custs4.phone );
293 ECPGt_varchar,(onlyname),(
long)50,(
long)2,
sizeof(
struct varchar_5),
295#line 110 "array_of_struct.pgc"
298#line 110 "array_of_struct.pgc"
301#line 110 "array_of_struct.pgc"
304#line 110 "array_of_struct.pgc"
307 for (r = 0; r < 2; r++)
309 printf(
"name - %s\n", onlyname[r].arr );
313#line 117 "array_of_struct.pgc"
316#line 117 "array_of_struct.pgc"
319#line 117 "array_of_struct.pgc"
bool ECPGdisconnect(int lineno, const char *connection_name)
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,...)
struct customer::varchar_1 name