| 2881 | // |
| 2882 | |
| 2883 | static void gen_procedure( const act* action) |
| 2884 | { |
| 2885 | const gpre_req* request = action->act_request; |
| 2886 | const gpre_port* in_port = request->req_vport; |
| 2887 | const gpre_port* out_port = request->req_primary; |
| 2888 | |
| 2889 | PAT args; |
| 2890 | args.pat_database = request->req_database; |
| 2891 | args.pat_request = action->act_request; |
| 2892 | args.pat_vector1 = status_vector(action); |
| 2893 | args.pat_request = request; |
| 2894 | args.pat_port = in_port; |
| 2895 | args.pat_port2 = out_port; |
| 2896 | const TEXT* pattern; |
| 2897 | if (in_port && in_port->por_length) |
| 2898 | pattern = "CALL \"isc_transact_request\" USING %V1, %DH, %RT, %RS, %RI, %PL, %PI, %QL, %QI\n"; |
| 2899 | else |
| 2900 | pattern = "CALL \"isc_transact_request\" USING %V1, %DH, %RT, %RS, %RI, 0, 0, %QL, %QI\n"; |
| 2901 | |
| 2902 | // Get database attach and transaction started |
| 2903 | |
| 2904 | if (gpreGlob.sw_auto) |
| 2905 | t_start_auto(0, status_vector(action), action, true); |
| 2906 | |
| 2907 | // Move in input values |
| 2908 | |
| 2909 | asgn_from(action, request->req_values); |
| 2910 | |
| 2911 | // Execute the procedure |
| 2912 | |
| 2913 | const USHORT column = static_cast<USHORT>(strlen(names[COLUMN])); |
| 2914 | PATTERN_expand(column, pattern, &args); |
| 2915 | |
| 2916 | set_sqlcode(action); |
| 2917 | |
| 2918 | printa(names[COLUMN], false, "IF SQLCODE = 0 THEN"); |
| 2919 | |
| 2920 | // Move out output values |
| 2921 | |
| 2922 | asgn_to_proc(request->req_references); |
| 2923 | printa(names[COLUMN], false, "END-IF"); |
| 2924 | } |
| 2925 | |
| 2926 | |
| 2927 | //____________________________________________________________ |
no test coverage detected