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

Function gen_loop

src/gpre/languages/cob.cpp:2712–2740  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2710//
2711
2712static void gen_loop( const act* action)
2713{
2714 gen_s_start(action);
2715 const gpre_req* request = action->act_request;
2716 const gpre_port* port = request->req_primary;
2717
2718 printa(names[COLUMN], false, "IF SQLCODE = 0 THEN");
2719 gen_receive(action, port);
2720 printa(names[COLUMN], false, "END-IF");
2721
2722 TEXT name[MAX_REF_SIZE];
2723 gen_name(name, port->por_references, true);
2724 printa(names[COLUMN], false, "IF SQLCODE = 0 AND %s = 0 THEN ", name);
2725 printa(names[COLUMN], false, "MOVE 100 TO SQLCODE");
2726 printa(names[COLUMN], false, "END-IF");
2727
2728 if (request->req_flags & REQ_sql_returning)
2729 {
2730 printa(names[COLUMN], false, "IF SQLCODE = 0 AND %s NOT = 0 THEN", name);
2731
2732 gpre_nod* var_list = (gpre_nod*) action->act_object;
2733 for (int i = 0; var_list && i < var_list->nod_count; i++)
2734 {
2735 asgn_to(action, (ref*) (var_list->nod_arg[i]));
2736 }
2737
2738 printa(names[COLUMN], false, "END-IF");
2739 }
2740}
2741
2742
2743//____________________________________________________________

Callers 1

COB_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