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

Function gen_s_start

src/gpre/languages/rmc.cpp:3350–3405  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3348//
3349
3350static void gen_s_start( const act* action)
3351{
3352 const gpre_req* request = action->act_request;
3353
3354 gen_compile(action);
3355
3356 const gpre_port* port = request->req_vport;
3357 if (port)
3358 asgn_from(action, port->por_references);
3359
3360 if (action->act_type == ACT_open)
3361 gen_cursor_open(action, request);
3362
3363 // Do not call "gen_start" in case if "gen_compile" failed
3364
3365 if (action->act_error || (action->act_flags & ACT_sql))
3366 {
3367 if (gpreGlob.sw_auto)
3368 printa(names[COLUMN], false, "IF %s NOT = 0 AND %s NOT = 0 THEN",
3369 request_trans(action, request), request->req_handle);
3370 else
3371 printa(names[COLUMN], false, "IF %s NOT = 0 THEN", request->req_handle);
3372 }
3373
3374 gen_start(action, port);
3375 set_sqlcode(action);
3376
3377 if (action->act_error || (action->act_flags & ACT_sql))
3378 printa(names[COLUMN], false, "END-IF");
3379
3380 if (request->req_type == REQ_insert && (request->req_flags & REQ_sql_returning))
3381 {
3382 printa(names[COLUMN], false, "IF SQLCODE = 0 THEN");
3383 gen_receive(action, request->req_primary);
3384 printa(names[COLUMN], false, "END-IF");
3385
3386 printa(names[COLUMN], false, "IF SQLCODE = 0 THEN");
3387
3388 gpre_nod* var_list = (gpre_nod*) action->act_object;
3389 for (int i = 0; var_list && i < var_list->nod_count; i++)
3390 {
3391 asgn_to(action, (ref*) (var_list->nod_arg[i]));
3392 }
3393
3394 printa(names[COLUMN], false, "END-IF");
3395 }
3396
3397 if (action->act_type == ACT_open)
3398 {
3399 printa(names[COLUMN], false, "END-IF");
3400 printa(names[COLUMN], false, "END-IF");
3401 if (gpreGlob.sw_auto)
3402 printa(names[COLUMN], false, "END-IF");
3403 printa(names[COLUMN], false, "END-IF");
3404 }
3405}
3406
3407

Callers 5

RMC_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