54{
55
56
57
58
59
60#line 22 "binary.pgc"
62
63#line 23 "binary.pgc"
64 char * pointer = NULL ;
65
66#line 24 "binary.pgc"
67 char *
data =
"\\001\\155\\000\\212" ;
68
69#line 25 "binary.pgc"
70
72
74
75 empl.idnum = 1;
76 {
ECPGconnect(__LINE__, 0,
"ecpg1_regression" , NULL, NULL , NULL, 0);
77#line 31 "binary.pgc"
78
80#line 31 "binary.pgc"
81
83#line 32 "binary.pgc"
84
86#line 32 "binary.pgc"
87
88 {
ECPGdo(__LINE__, 0, 1, NULL, 0,
ECPGst_normal,
"create table empl ( idnum integer , name char ( 20 ) , accs smallint , byte bytea )",
ECPGt_EOIT,
ECPGt_EORT);
89#line 34 "binary.pgc"
90
92#line 34 "binary.pgc"
93
94 {
ECPGdo(__LINE__, 0, 1, NULL, 0,
ECPGst_normal,
"insert into empl values ( 1 , 'first user' , 320 , $1 )",
97#line 35 "binary.pgc"
98
100#line 35 "binary.pgc"
101
103
104#line 36 "binary.pgc"
105
107#line 36 "binary.pgc"
108
109#line 36 "binary.pgc"
110
111 {
ECPGdo(__LINE__, 0, 1, NULL, 0,
ECPGst_normal,
"declare C cursor for select name , accs , byte from empl where idnum = $1 ",
112 ECPGt_long,&(empl.idnum),(
long)1,(
long)1,
sizeof(
long),
114#line 37 "binary.pgc"
115
117#line 37 "binary.pgc"
118
120 ECPGt_char,(empl.name),(
long)21,(
long)1,(21)*
sizeof(
char),
122 ECPGt_short,&(empl.accs),(
long)1,(
long)1,
sizeof(
short),
124 ECPGt_char,(empl.byte),(
long)20,(
long)1,(20)*
sizeof(
char),
126#line 38 "binary.pgc"
127
129#line 38 "binary.pgc"
130
131 printf (
"name=%s, accs=%d byte=%s\n", empl.name, empl.accs, empl.byte);
132
134#line 41 "binary.pgc"
135
137#line 41 "binary.pgc"
138
139
140 memset(empl.name, 0, 21L);
142
143#line 44 "binary.pgc"
144
146#line 44 "binary.pgc"
147
148#line 44 "binary.pgc"
149
150 {
ECPGdo(__LINE__, 0, 1, NULL, 0,
ECPGst_normal,
"declare B binary cursor for select name , accs , byte from empl where idnum = $1 ",
151 ECPGt_long,&(empl.idnum),(
long)1,(
long)1,
sizeof(
long),
153#line 45 "binary.pgc"
154
156#line 45 "binary.pgc"
157
159 ECPGt_char,(empl.name),(
long)21,(
long)1,(21)*
sizeof(
char),
161 ECPGt_short,&(empl.accs),(
long)1,(
long)1,
sizeof(
short),
163 ECPGt_char,(empl.byte),(
long)20,(
long)1,(20)*
sizeof(
char),
165#line 46 "binary.pgc"
166
168#line 46 "binary.pgc"
169
171#line 47 "binary.pgc"
172
174#line 47 "binary.pgc"
175
176
177
178 printf (
"name=%s, byte=", empl.name);
180 printf(
"(%o)", (
unsigned char)empl.byte[
i]);
182
184
185#line 55 "binary.pgc"
186
188#line 55 "binary.pgc"
189
190#line 55 "binary.pgc"
191
192 {
ECPGdo(__LINE__, 0, 1, NULL, 0,
ECPGst_normal,
"declare A binary cursor for select byte from empl where idnum = $1 ",
193 ECPGt_long,&(empl.idnum),(
long)1,(
long)1,
sizeof(
long),
195#line 56 "binary.pgc"
196
198#line 56 "binary.pgc"
199
201 ECPGt_char,&(pointer),(
long)0,(
long)1,(1)*
sizeof(
char),
203#line 57 "binary.pgc"
204
206#line 57 "binary.pgc"
207
209#line 58 "binary.pgc"
210
212#line 58 "binary.pgc"
213
214
215 if (pointer) {
218 printf(
"(%o)", (
unsigned char)pointer[
i]);
221 }
222
224#line 68 "binary.pgc"
225
227#line 68 "binary.pgc"
228
230}
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,...)
void ECPGset_var(int number, void *pointer, int lineno)