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

Function gen_procedure

src/gpre/languages/cob.cpp:2780–2827  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2778//
2779
2780static void gen_procedure( const act* action)
2781{
2782 const gpre_req* request = action->act_request;
2783 const gpre_port* in_port = request->req_vport;
2784 const gpre_port* out_port = request->req_primary;
2785
2786 PAT args;
2787 args.pat_database = request->req_database;
2788 args.pat_request = action->act_request;
2789 args.pat_vector1 = status_vector(action);
2790 args.pat_request = request;
2791 args.pat_port = in_port;
2792 args.pat_port2 = out_port;
2793 const TEXT* pattern;
2794 if (in_port && in_port->por_length)
2795 {
2796 pattern =
2797 "CALL \"isc_transact_request\" USING %V1, %RF%DH%RE, %RF%RT%RE, %VF%RS%VE, %RF%RI%RE, %VF%PL%VE, %RF%PI%RE, %VF%QL%VE, %RF%QI%RE\n";
2798 }
2799 else
2800 {
2801 pattern =
2802 "CALL \"isc_transact_request\" USING %V1, %RF%DH%RE, %RF%RT%RE, %VF%RS%VE, %RI, %VF0%VE, 0, %VF%QL%VE, %RF%QI%RE\n";
2803 }
2804
2805 // Get database attach and transaction started
2806
2807 if (gpreGlob.sw_auto)
2808 t_start_auto(0, status_vector(action), action, true);
2809
2810 // Move in input values
2811
2812 asgn_from(action, request->req_values);
2813
2814 // Execute the procedure
2815
2816 const USHORT column = static_cast<USHORT>(strlen(names[COLUMN]));
2817 PATTERN_expand(column, pattern, &args);
2818
2819 set_sqlcode(action);
2820
2821 printa(names[COLUMN], false, "IF SQLCODE = 0 THEN");
2822
2823 // Move out output values
2824
2825 asgn_to_proc(request->req_references);
2826 printa(names[COLUMN], false, "END-IF");
2827}
2828
2829
2830//____________________________________________________________

Callers 1

COB_actionFunction · 0.70

Calls 7

PATTERN_expandFunction · 0.85
status_vectorFunction · 0.70
t_start_autoFunction · 0.70
asgn_fromFunction · 0.70
set_sqlcodeFunction · 0.70
printaFunction · 0.70
asgn_to_procFunction · 0.70

Tested by

no test coverage detected