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

Function gen_loop

src/gpre/languages/ftn.cpp:2498–2525  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2496//
2497
2498static void gen_loop(const act* action)
2499{
2500 gen_s_start(action);
2501 const gpre_req* request = action->act_request;
2502 const gpre_port* port = request->req_primary;
2503
2504 printa(COLUMN, "IF (SQLCODE .EQ. 0) THEN");
2505 gen_receive(action, port);
2506 printa(COLUMN, "END IF");
2507
2508 TEXT name[MAX_REF_SIZE];
2509 gen_name(name, port->por_references, true);
2510 printa(COLUMN, "IF (SQLCODE .EQ. 0 .AND. %s .EQ. 0) ", name);
2511 printa(CONTINUE, "SQLCODE = 100");
2512
2513 if (request->req_flags & REQ_sql_returning)
2514 {
2515 printa(COLUMN, "IF (SQLCODE .EQ. 0 .AND. %s .NE. 0) THEN", name);
2516
2517 gpre_nod* var_list = (gpre_nod*) action->act_object;
2518 for (int i = 0; var_list && i < var_list->nod_count; i++)
2519 {
2520 asgn_to(action, (ref*) (var_list->nod_arg[i]));
2521 }
2522
2523 printa(COLUMN, "END IF");
2524 }
2525}
2526
2527
2528//____________________________________________________________

Callers 1

FTN_actionFunction · 0.70

Calls 5

gen_s_startFunction · 0.70
printaFunction · 0.70
gen_receiveFunction · 0.70
gen_nameFunction · 0.70
asgn_toFunction · 0.70

Tested by

no test coverage detected