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

Function gen_s_start

src/gpre/languages/ada.cpp:2738–2795  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2736//
2737
2738static void gen_s_start( const act* action, int column)
2739{
2740 gpre_req* request = action->act_request;
2741
2742 if ((action->act_type == ACT_open))
2743 {
2744 make_cursor_open_test(ACT_open, request, column);
2745 column += INDENT;
2746 }
2747
2748 gen_compile(action, column);
2749
2750 gpre_port* port = request->req_vport;
2751 if (port)
2752 asgn_from(action, port->por_references, column);
2753
2754 if (action->act_error || (action->act_flags & ACT_sql))
2755 make_ok_test(action, request, column);
2756
2757 gen_start(action, port, column);
2758 set_sqlcode(action, column);
2759
2760 if (action->act_error || (action->act_flags & ACT_sql))
2761 endif(column);
2762
2763 if (request->req_type == REQ_insert && (request->req_flags & REQ_sql_returning))
2764 {
2765 printa(column, "if (SQLCODE = 0) then");
2766 column += INDENT;
2767
2768 gen_receive(action, column, request->req_primary);
2769
2770 endif(column);
2771 column -= INDENT;
2772
2773 printa(column, "if (SQLCODE = 0) then");
2774 column += INDENT;
2775
2776 gpre_nod* var_list = (gpre_nod*) action->act_object;
2777 for (int i = 0; var_list && i < var_list->nod_count; i++)
2778 {
2779 align(column);
2780 asgn_to(action, (ref*) (var_list->nod_arg[i]), column);
2781 }
2782
2783 endif(column);
2784 column -= INDENT;
2785 }
2786
2787 if (action->act_type == ACT_open)
2788 {
2789 printa(column, "if (SQLCODE = 0) then");
2790 printa(column + INDENT, "isc_%do := 1;", request->req_ident);
2791 endif(column);
2792 column -= INDENT;
2793 endif(column);
2794 }
2795}

Callers 5

ADA_actionFunction · 0.70
gen_forFunction · 0.70
gen_functionFunction · 0.70
gen_loopFunction · 0.70
gen_selectFunction · 0.70

Calls 11

make_cursor_open_testFunction · 0.85
gen_compileFunction · 0.70
asgn_fromFunction · 0.70
make_ok_testFunction · 0.70
gen_startFunction · 0.70
set_sqlcodeFunction · 0.70
endifFunction · 0.70
printaFunction · 0.70
gen_receiveFunction · 0.70
alignFunction · 0.70
asgn_toFunction · 0.70

Tested by

no test coverage detected