81{
82
83
84
85
86
87
88
89
90
91
92
93#line 30 "type.pgc"
95
96#line 31 "type.pgc"
98
99#line 32 "type.pgc"
101
102#line 33 "type.pgc"
104
105#line 38 "type.pgc"
107#line 36 "type.pgc"
109
110#line 37 "type.pgc"
112 } vc ;
113
114#line 39 "type.pgc"
115
116
117
118#line 41 "type.pgc"
119
121
122 empl.idnum = 1;
123 {
ECPGconnect(__LINE__, 0,
"ecpg1_regression" , NULL, NULL , NULL, 0); }
124#line 45 "type.pgc"
125
127 {
129 exit (
sqlca.sqlcode);
130 }
131
132 {
ECPGdo(__LINE__, 0, 1, NULL, 0,
ECPGst_normal,
"create table empl ( idnum integer , name char ( 20 ) , accs smallint , string1 char ( 10 ) , string2 char ( 10 ) , string3 char ( 10 ) )",
ECPGt_EOIT,
ECPGt_EORT);}
133#line 53 "type.pgc"
134
136 {
138 exit (
sqlca.sqlcode);
139 }
140
141 {
ECPGdo(__LINE__, 0, 1, NULL, 0,
ECPGst_normal,
"insert into empl values ( 1 , 'user name' , $1 , 'first str' , 'second str' , 'third str' )",
142 ECPGt_short,&(accs_val),(
long)1,(
long)1,
sizeof(
short),
144#line 60 "type.pgc"
145
147 {
149 exit (
sqlca.sqlcode);
150 }
151
152 {
ECPGdo(__LINE__, 0, 1, NULL, 0,
ECPGst_normal,
"select idnum , name , accs , string1 , string2 , string3 from empl where idnum = $1 ",
153 ECPGt_long,&(empl.idnum),(
long)1,(
long)1,
sizeof(
long),
163 ECPGt_char,&(ptr),(
long)0,(
long)1,(1)*
sizeof(
char),
167#line 70 "type.pgc"
168
170 {
172 exit (
sqlca.sqlcode);
173 }
174 printf (
"id=%ld name='%s' accs=%d str='%s' ptr='%s' vc='%10.10s'\n", empl.idnum, empl.name, empl.accs,
str, ptr, vc.text);
175
177#line 78 "type.pgc"
178
179
181 exit (0);
182}
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,...)
Datum varchar(PG_FUNCTION_ARGS)