137{
138 /* exec sql begin declare section */
139
140
141
142
143
144
145#line 47 "test_informix2.pgc"
147
148#line 48 "test_informix2.pgc"
150
151#line 49 "test_informix2.pgc"
153
154#line 50 "test_informix2.pgc"
156
157#line 51 "test_informix2.pgc"
159/* exec sql end declare section */
160#line 52 "test_informix2.pgc"
161
162
164
165 /* exec sql whenever sqlerror stop ; */
166#line 56 "test_informix2.pgc"
167
168
170
171 strcpy(
dbname,
"ecpg1_regression");
173#line 61 "test_informix2.pgc"
174
175if (
sqlca.sqlcode < 0) exit (1);}
176#line 61 "test_informix2.pgc"
177
179
181#line 64 "test_informix2.pgc"
182
183if (
sqlca.sqlcode < 0) exit (1);}
184#line 64 "test_informix2.pgc"
185
186
187 {
ECPGdo(__LINE__, 1, 1, NULL, 0,
ECPGst_normal,
"create table history ( customerid integer , timestamp timestamp without time zone , action_taken char ( 5 ) , narrative varchar ( 100 ) )",
ECPGt_EOIT,
ECPGt_EORT);
188#line 66 "test_informix2.pgc"
189
190if (
sqlca.sqlcode < 0) exit (1);}
191#line 66 "test_informix2.pgc"
192
194
195 {
ECPGdo(__LINE__, 1, 1, NULL, 0,
ECPGst_normal,
"insert into history ( customerid , timestamp , action_taken , narrative ) values ( 1 , '2003年05月07日 13:28:34 CEST' , 'test' , 'test' )",
ECPGt_EOIT,
ECPGt_EORT);
196#line 71 "test_informix2.pgc"
197
198if (
sqlca.sqlcode < 0) exit (1);}
199#line 71 "test_informix2.pgc"
200
202
206#line 76 "test_informix2.pgc"
207
208if (
sqlca.sqlcode < 0) exit (1);}
209#line 76 "test_informix2.pgc"
210
212
213 {
ECPGdo(__LINE__, 1, 1, NULL, 0,
ECPGst_normal,
"select customerid , timestamp from history where timestamp = 1ドル limit 1",
220#line 83 "test_informix2.pgc"
221
222if (
sqlca.sqlcode < 0) exit (1);}
223#line 83 "test_informix2.pgc"
224
226
227 printf(
"Read in customer %d\n",
c);
228
233
234 {
ECPGdo(__LINE__, 1, 1, NULL, 0,
ECPGst_normal,
"insert into history ( customerid , timestamp , action_taken , narrative ) values ( 1ドル , 2ドル , 'test' , 'test' )",
239#line 95 "test_informix2.pgc"
240
241if (
sqlca.sqlcode < 0) exit (1);}
242#line 95 "test_informix2.pgc"
243
245
247#line 98 "test_informix2.pgc"
248
249if (
sqlca.sqlcode < 0) exit (1);}
250#line 98 "test_informix2.pgc"
251
252
254#line 100 "test_informix2.pgc"
255
256if (
sqlca.sqlcode < 0) exit (1);}
257#line 100 "test_informix2.pgc"
258
260
262#line 103 "test_informix2.pgc"
263
264if (
sqlca.sqlcode < 0) exit (1);}
265#line 103 "test_informix2.pgc"
266
267
269#line 105 "test_informix2.pgc"
270
271if (
sqlca.sqlcode < 0) exit (1);}
272#line 105 "test_informix2.pgc"
273
275
277
278 exit(0);
279
280/*
281 Table "public.history"
282 Column | Type | Nullable
283--------------+-----------------------------+----------
284 customerid | integer | not null
285 timestamp | timestamp without time zone | not null
286 action_taken | character(5) | not null
287 narrative | character varying(100) |
288*/
289
290}
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,...)
bool ECPGtrans(int lineno, const char *connection_name, const char *transaction)
interval * PGTYPESinterval_from_asc(char *str, char **endptr)
int PGTYPEStimestamp_add_interval(timestamp *tin, interval *span, timestamp *tout)