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

Function gen_s_start

src/gpre/languages/cob.cpp:3225–3280  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3223//
3224
3225static void gen_s_start( const act* action)
3226{
3227 const gpre_req* request = action->act_request;
3228
3229 gen_compile(action);
3230
3231 const gpre_port* port = request->req_vport;
3232 if (port)
3233 asgn_from(action, port->por_references);
3234
3235 if (action->act_type == ACT_open)
3236 gen_cursor_open(action, request);
3237
3238 // Do not call "gen_start" in case if "gen_compile" failed
3239
3240 if (action->act_error || (action->act_flags & ACT_sql))
3241 {
3242 if (gpreGlob.sw_auto)
3243 printa(names[COLUMN], false, "IF %s NOT = 0 AND %s NOT = 0 THEN",
3244 request_trans(action, request), request->req_handle);
3245 else
3246 printa(names[COLUMN], false, "IF %s NOT = 0 THEN", request->req_handle);
3247 }
3248
3249 gen_start(action, port);
3250 set_sqlcode(action);
3251
3252 if (action->act_error || (action->act_flags & ACT_sql))
3253 printa(names[COLUMN], false, "END-IF");
3254
3255 if (request->req_type == REQ_insert && (request->req_flags & REQ_sql_returning))
3256 {
3257 printa(names[COLUMN], false, "IF SQLCODE NOT = 0 THEN");
3258 gen_receive(action, request->req_primary);
3259 printa(names[COLUMN], false, "END-IF");
3260
3261 printa(names[COLUMN], false, "IF SQLCODE NOT = 0 THEN");
3262
3263 gpre_nod* var_list = (gpre_nod*) action->act_object;
3264 for (int i = 0; var_list && i < var_list->nod_count; i++)
3265 {
3266 asgn_to(action, (ref*) (var_list->nod_arg[i]));
3267 }
3268
3269 printa(names[COLUMN], false, "END-IF");
3270 }
3271
3272 if (action->act_type == ACT_open)
3273 {
3274 printa(names[COLUMN], false, "END-IF");
3275 printa(names[COLUMN], false, "END-IF");
3276 if (gpreGlob.sw_auto)
3277 printa(names[COLUMN], false, "END-IF");
3278 printa(names[COLUMN], false, "END-IF");
3279 }
3280}
3281
3282

Callers 5

COB_actionFunction · 0.70
gen_forFunction · 0.70
gen_functionFunction · 0.70
gen_loopFunction · 0.70
gen_selectFunction · 0.70

Calls 9

gen_compileFunction · 0.70
asgn_fromFunction · 0.70
gen_cursor_openFunction · 0.70
printaFunction · 0.70
request_transFunction · 0.70
gen_startFunction · 0.70
set_sqlcodeFunction · 0.70
gen_receiveFunction · 0.70
asgn_toFunction · 0.70

Tested by

no test coverage detected