MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / gen_loop

Function gen_loop

src/gpre/languages/pas.cpp:2151–2187  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2149//
2150
2151static void gen_loop( const act* action, int column)
2152{
2153 gen_s_start(action, column);
2154 const gpre_req* request = action->act_request;
2155 gpre_port* port = request->req_primary;
2156
2157 printa(column, "if SQLCODE = 0 then");
2158 column += INDENT;
2159 begin(column);
2160
2161 gen_receive(action, column, port);
2162
2163 endp(column);
2164 column -= INDENT;
2165
2166 TEXT name[MAX_REF_SIZE];
2167 gen_name(name, port->por_references, true);
2168 printa(column, "if (SQLCODE = 0) and (%s = 0)", name);
2169 printa(column + INDENT, "then SQLCODE := 100;");
2170
2171 if (request->req_flags & REQ_sql_returning)
2172 {
2173 printa(column, "if (SQLCODE = 0) and (%s <> 0)", name);
2174 column += INDENT;
2175 begin(column);
2176
2177 gpre_nod* var_list = (gpre_nod*) action->act_object;
2178 for (int i = 0; var_list && i < var_list->nod_count; i++)
2179 {
2180 align(column);
2181 asgn_to(action, (ref*) (var_list->nod_arg[i]), column);
2182 }
2183
2184 endp(column);
2185 column -= INDENT;
2186 }
2187}
2188
2189
2190//____________________________________________________________

Callers 1

PAS_actionFunction · 0.70

Calls 8

gen_s_startFunction · 0.70
printaFunction · 0.70
beginFunction · 0.70
gen_receiveFunction · 0.70
endpFunction · 0.70
gen_nameFunction · 0.70
alignFunction · 0.70
asgn_toFunction · 0.70

Tested by

no test coverage detected