Daily_QC
init_pcprpt.c
Go to the documentation of this file.
1
#include <sqlhdr.h>
2
#include <sqlca.h>
3
extern
_SQCURSOR *
_iqnprep
();
4
static
char
*
_Cn4
=
"sensorcursor"
;
static
_SQCURSOR *
_SQ4
= 0;
5
static
char
*
_Cn3
=
"selectsensor"
;
static
_SQCURSOR *
_SQ3
= 0;
6
static
char
*
_Cn2
=
"stncursor"
;
static
_SQCURSOR *
_SQ2
= 0;
7
static
char
*
_Cn1
=
"selectstn"
;
static
_SQCURSOR *
_SQ1
= 0;
8
#line 1 "init_pcprpt.ec"
9
10
void
init_pcprpt
()
11
12
{
13
14
/*
15
* EXEC SQL database fastetc;
16
*/
17
#line 6 "init_pcprpt.ec"
18
{
19
#line 6 "init_pcprpt.ec"
20
_iqdbase(
"fastetc"
, 0);
21
#line 6 "init_pcprpt.ec"
22
}
23
24
if
(
sqlca
.
sqlcode
< 0){
25
26
printf
(
"informix error %d\n"
,
sqlca
.
sqlcode
);
27
exit
(1);
28
29
}
30
31
/*
32
* EXEC SQL prepare selectstn from
33
* "select unique *
34
* from stn
35
* order by stat,des";
36
*/
37
#line 15 "init_pcprpt.ec"
38
{
39
#line 15 "init_pcprpt.ec"
40
#line 15 "init_pcprpt.ec"
41
_SQ1
=
_iqnprep
(
_Cn1
,
"select unique * from stn order by stat,des"
, 0);
42
#line 18 "init_pcprpt.ec"
43
}
44
45
if
(
sqlca
.
sqlcode
< 0){
46
47
printf
(
"informix error %d\n"
,
sqlca
.
sqlcode
);
48
exit
(1);
49
50
}
51
52
/*
53
* EXEC SQL declare stncursor cursor for selectstn;
54
*/
55
#line 27 "init_pcprpt.ec"
56
{
57
#line 27 "init_pcprpt.ec"
58
#line 27 "init_pcprpt.ec"
59
if
(!
_SQ2
)
_SQ2
= _iqlocate_cursor(
_Cn2
, 0, 0, 0);
60
#line 27 "init_pcprpt.ec"
61
if
(!
_SQ1
)
_SQ1
= _iqlocate_cursor(
_Cn1
, 1, 1, 0);
62
#line 27 "init_pcprpt.ec"
63
_iqcddcl(
_SQ2
,
_Cn2
,
_SQ1
, 0);
64
#line 27 "init_pcprpt.ec"
65
}
66
67
if
(
sqlca
.
sqlcode
< 0){
68
69
printf
(
"informix error %d\n"
,
sqlca
.
sqlcode
);
70
exit
(1);
71
72
}
73
74
/*
75
* EXEC SQL prepare selectsensor from
76
* "select *
77
* from sens
78
* where pe1='P' and
79
* pe2='P' and
80
* dur='D' and
81
* id = ?";
82
*/
83
#line 36 "init_pcprpt.ec"
84
{
85
#line 36 "init_pcprpt.ec"
86
#line 36 "init_pcprpt.ec"
87
_SQ3
=
_iqnprep
(
_Cn3
,
"select * from sens where pe1='P' and pe2='P' and dur='D' and id = ?"
, 0);
88
#line 42 "init_pcprpt.ec"
89
}
90
91
if
(
sqlca
.
sqlcode
< 0){
92
93
printf
(
"informix error %d\n"
,
sqlca
.
sqlcode
);
94
exit
(1);
95
96
}
97
98
/*
99
* EXEC SQL declare sensorcursor cursor for selectsensor;
100
*/
101
#line 51 "init_pcprpt.ec"
102
{
103
#line 51 "init_pcprpt.ec"
104
#line 51 "init_pcprpt.ec"
105
if
(!
_SQ4
)
_SQ4
= _iqlocate_cursor(
_Cn4
, 0, 0, 0);
106
#line 51 "init_pcprpt.ec"
107
if
(!
_SQ3
)
_SQ3
= _iqlocate_cursor(
_Cn3
, 1, 1, 0);
108
#line 51 "init_pcprpt.ec"
109
_iqcddcl(
_SQ4
,
_Cn4
,
_SQ3
, 0);
110
#line 51 "init_pcprpt.ec"
111
}
112
113
if
(
sqlca
.
sqlcode
< 0){
114
115
printf
(
"informix error %d\n"
,
sqlca
.
sqlcode
);
116
exit
(1);
117
118
}
119
120
}
121
122
123
sqlca
struct sqlca_s sqlca
_SQ2
static _SQCURSOR * _SQ2
Definition:
init_pcprpt.c:6
_Cn2
static char * _Cn2
Definition:
init_pcprpt.c:6
_SQ4
static _SQCURSOR * _SQ4
Definition:
init_pcprpt.c:4
_SQ3
static _SQCURSOR * _SQ3
Definition:
init_pcprpt.c:5
_SQ1
static _SQCURSOR * _SQ1
Definition:
init_pcprpt.c:7
_Cn3
static char * _Cn3
Definition:
init_pcprpt.c:5
init_pcprpt
void init_pcprpt()
Definition:
init_pcprpt.c:10
_Cn1
static char * _Cn1
Definition:
init_pcprpt.c:7
_iqnprep
_SQCURSOR * _iqnprep()
_Cn4
static char * _Cn4
Definition:
init_pcprpt.c:4
printf
printf("pcp %d\n", pcp_in_use[103])
exit
exit(1)
sqlca_s::sqlcode
long sqlcode
Definition:
build_list.c:47
Generated by
1.9.1