1 /* Processed by ecpg (regression mode) */
2 /* These include files are added by the preprocessor */
3 #include <ecpglib.h>
4 #include <ecpgerrno.h>
5 #include <sqlca.h>
6 /* End of automatic include section */
7 #define ECPGdebug(X,Y) ECPGdebug((X)+100,(Y))
8 
9 #line 1 "insupd.pgc"
10 #include <stdio.h>
11 #include <stdlib.h>
12 #include <string.h>
13 
14 
15 #line 1 "regression.h"
16 
17 
18 
19 
20 
21 
22 #line 5 "insupd.pgc"
23 
24 
main()25 int main() {
26   /* exec sql begin declare section */
27 
28 
29 #line 9 "insupd.pgc"
30  int i1 [ 3 ] , i2 [ 3 ] , i3 [ 3 ] , i4 ;
31 /* exec sql end declare section */
32 #line 10 "insupd.pgc"
33 
34 
35   ECPGdebug(1, stderr);
36   { ECPGconnect(__LINE__, 0, "ecpg1_regression" , NULL, NULL , NULL, 0); }
37 #line 13 "insupd.pgc"
38 
39 
40   /* exec sql whenever sql_warning  sqlprint ; */
41 #line 15 "insupd.pgc"
42 
43   /* exec sql whenever sqlerror  sqlprint ; */
44 #line 16 "insupd.pgc"
45 
46 
47   { ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "create table insupd_test ( a int , b int )", ECPGt_EOIT, ECPGt_EORT);
48 #line 18 "insupd.pgc"
49 
50 if (sqlca.sqlwarn[0] == 'W') sqlprint();
51 #line 18 "insupd.pgc"
52 
53 if (sqlca.sqlcode < 0) sqlprint();}
54 #line 18 "insupd.pgc"
55 
56 
57   { ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "insert into insupd_test ( a , b ) values ( 1 , 1 )", ECPGt_EOIT, ECPGt_EORT);
58 #line 20 "insupd.pgc"
59 
60 if (sqlca.sqlwarn[0] == 'W') sqlprint();
61 #line 20 "insupd.pgc"
62 
63 if (sqlca.sqlcode < 0) sqlprint();}
64 #line 20 "insupd.pgc"
65 
66   { ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "insert into insupd_test ( a , b ) values ( 2 , 2 )", ECPGt_EOIT, ECPGt_EORT);
67 #line 21 "insupd.pgc"
68 
69 if (sqlca.sqlwarn[0] == 'W') sqlprint();
70 #line 21 "insupd.pgc"
71 
72 if (sqlca.sqlcode < 0) sqlprint();}
73 #line 21 "insupd.pgc"
74 
75   { ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "insert into insupd_test ( a , b ) values ( 3 , 3 ) returning a", ECPGt_EOIT,
76 	ECPGt_int,&(i4),(long)1,(long)1,sizeof(int),
77 	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT);
78 #line 22 "insupd.pgc"
79 
80 if (sqlca.sqlwarn[0] == 'W') sqlprint();
81 #line 22 "insupd.pgc"
82 
83 if (sqlca.sqlcode < 0) sqlprint();}
84 #line 22 "insupd.pgc"
85 
86 
87   { ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "update insupd_test set a = a + 1 returning a", ECPGt_EOIT,
88 	ECPGt_int,(i3),(long)1,(long)3,sizeof(int),
89 	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT);
90 #line 24 "insupd.pgc"
91 
92 if (sqlca.sqlwarn[0] == 'W') sqlprint();
93 #line 24 "insupd.pgc"
94 
95 if (sqlca.sqlcode < 0) sqlprint();}
96 #line 24 "insupd.pgc"
97 
98   { ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "update insupd_test set ( a , b ) = ( 5 , 5 ) where a = 4", ECPGt_EOIT, ECPGt_EORT);
99 #line 25 "insupd.pgc"
100 
101 if (sqlca.sqlwarn[0] == 'W') sqlprint();
102 #line 25 "insupd.pgc"
103 
104 if (sqlca.sqlcode < 0) sqlprint();}
105 #line 25 "insupd.pgc"
106 
107   { ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "update insupd_test set a = 4 where a = 3", ECPGt_EOIT, ECPGt_EORT);
108 #line 26 "insupd.pgc"
109 
110 if (sqlca.sqlwarn[0] == 'W') sqlprint();
111 #line 26 "insupd.pgc"
112 
113 if (sqlca.sqlcode < 0) sqlprint();}
114 #line 26 "insupd.pgc"
115 ;
116 
117   { ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "select a , b from insupd_test order by a", ECPGt_EOIT,
118 	ECPGt_int,(i1),(long)1,(long)3,sizeof(int),
119 	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L,
120 	ECPGt_int,(i2),(long)1,(long)3,sizeof(int),
121 	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT);
122 #line 28 "insupd.pgc"
123 
124 if (sqlca.sqlwarn[0] == 'W') sqlprint();
125 #line 28 "insupd.pgc"
126 
127 if (sqlca.sqlcode < 0) sqlprint();}
128 #line 28 "insupd.pgc"
129 
130 
131   printf("changes\n%d %d %d %d\n", i3[0], i3[1], i3[2], i4);
132   printf("test\na b\n%d %d\n%d %d\n%d %d\n", i1[0], i2[0], i1[1], i2[1], i1[2], i2[2]);
133 
134   { ECPGdisconnect(__LINE__, "ALL");
135 #line 33 "insupd.pgc"
136 
137 if (sqlca.sqlwarn[0] == 'W') sqlprint();
138 #line 33 "insupd.pgc"
139 
140 if (sqlca.sqlcode < 0) sqlprint();}
141 #line 33 "insupd.pgc"
142 
143 
144   return 0;
145 }
146