~ubuntu-branches/ubuntu/hardy/postgresql-8.4/hardy-backports

« back to all changes in this revision

Viewing changes to src/interfaces/ecpg/test/expected/sql-insupd.c

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt
  • Date: 2009-03-20 12:00:13 UTC
  • Revision ID: james.westby@ubuntu.com-20090320120013-hogj7egc5mjncc5g
Tags: upstream-8.4~0cvs20090328
ImportĀ upstreamĀ versionĀ 8.4~0cvs20090328

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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
 
 
25
int main(int argc, char* argv[]) {
 
26
  /* exec sql begin declare section */
 
27
          
 
28
  
 
29
#line 9 "insupd.pgc"
 
30
 int i1 [ 3 ] , i2 [ 3 ] ;
 
31
/* exec sql end declare section */
 
32
#line 10 "insupd.pgc"
 
33
 
 
34
 
 
35
  ECPGdebug(1, stderr);
 
36
  { ECPGconnect(__LINE__, 0, "regress1" , 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 )", ECPGt_EOIT, ECPGt_EORT);
 
76
#line 22 "insupd.pgc"
 
77
 
 
78
if (sqlca.sqlwarn[0] == 'W') sqlprint();
 
79
#line 22 "insupd.pgc"
 
80
 
 
81
if (sqlca.sqlcode < 0) sqlprint();}
 
82
#line 22 "insupd.pgc"
 
83
 
 
84
 
 
85
  { ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "update insupd_test set a = a + 1", ECPGt_EOIT, ECPGt_EORT);
 
86
#line 24 "insupd.pgc"
 
87
 
 
88
if (sqlca.sqlwarn[0] == 'W') sqlprint();
 
89
#line 24 "insupd.pgc"
 
90
 
 
91
if (sqlca.sqlcode < 0) sqlprint();}
 
92
#line 24 "insupd.pgc"
 
93
 
 
94
  { ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "update insupd_test set ( a , b ) = ( 5 , 5 ) where a = 4", ECPGt_EOIT, ECPGt_EORT);
 
95
#line 25 "insupd.pgc"
 
96
 
 
97
if (sqlca.sqlwarn[0] == 'W') sqlprint();
 
98
#line 25 "insupd.pgc"
 
99
 
 
100
if (sqlca.sqlcode < 0) sqlprint();}
 
101
#line 25 "insupd.pgc"
 
102
 
 
103
  { ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "update insupd_test set a = 4 where a = 3", ECPGt_EOIT, ECPGt_EORT);
 
104
#line 26 "insupd.pgc"
 
105
 
 
106
if (sqlca.sqlwarn[0] == 'W') sqlprint();
 
107
#line 26 "insupd.pgc"
 
108
 
 
109
if (sqlca.sqlcode < 0) sqlprint();}
 
110
#line 26 "insupd.pgc"
 
111
;
 
112
 
 
113
  { ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "select a , b from insupd_test order by a", ECPGt_EOIT, 
 
114
        ECPGt_int,(i1),(long)1,(long)3,sizeof(int), 
 
115
        ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, 
 
116
        ECPGt_int,(i2),(long)1,(long)3,sizeof(int), 
 
117
        ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT);
 
118
#line 28 "insupd.pgc"
 
119
 
 
120
if (sqlca.sqlwarn[0] == 'W') sqlprint();
 
121
#line 28 "insupd.pgc"
 
122
 
 
123
if (sqlca.sqlcode < 0) sqlprint();}
 
124
#line 28 "insupd.pgc"
 
125
 
 
126
 
 
127
  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]);
 
128
 
 
129
  { ECPGdisconnect(__LINE__, "ALL");
 
130
#line 32 "insupd.pgc"
 
131
 
 
132
if (sqlca.sqlwarn[0] == 'W') sqlprint();
 
133
#line 32 "insupd.pgc"
 
134
 
 
135
if (sqlca.sqlcode < 0) sqlprint();}
 
136
#line 32 "insupd.pgc"
 
137
 
 
138
 
 
139
  return 0;
 
140
}