| 3099 | // |
| 3100 | |
| 3101 | static void gen_s_start(const act* action) |
| 3102 | { |
| 3103 | const gpre_req* request = action->act_request; |
| 3104 | |
| 3105 | gen_compile(action); |
| 3106 | |
| 3107 | const gpre_port* port = request->req_vport; |
| 3108 | if (port) |
| 3109 | asgn_from(action, port->por_references); |
| 3110 | |
| 3111 | if (action->act_type == ACT_open) |
| 3112 | gen_cursor_open(action, request); |
| 3113 | |
| 3114 | if (action->act_error || (action->act_flags & ACT_sql)) |
| 3115 | make_ok_test(action, request); |
| 3116 | |
| 3117 | gen_start(action, port); |
| 3118 | status_and_stop(action); |
| 3119 | |
| 3120 | if (action->act_error || (action->act_flags & ACT_sql)) |
| 3121 | printa(COLUMN, "END IF"); |
| 3122 | |
| 3123 | if (request->req_type == REQ_insert && (request->req_flags & REQ_sql_returning)) |
| 3124 | { |
| 3125 | printa(COLUMN, "IF (SQLCODE .EQ. 0) THEN"); |
| 3126 | gen_receive(action, request->req_primary); |
| 3127 | printa(COLUMN, "END IF"); |
| 3128 | |
| 3129 | printa(COLUMN, "IF (SQLCODE .EQ. 0) THEN"); |
| 3130 | |
| 3131 | gpre_nod* var_list = (gpre_nod*) action->act_object; |
| 3132 | for (int i = 0; var_list && i < var_list->nod_count; i++) |
| 3133 | { |
| 3134 | asgn_to(action, (ref*) (var_list->nod_arg[i])); |
| 3135 | } |
| 3136 | |
| 3137 | printa(COLUMN, "END IF"); |
| 3138 | } |
| 3139 | |
| 3140 | if (action->act_type == ACT_open) |
| 3141 | { |
| 3142 | printa(COLUMN, "END IF"); |
| 3143 | printa(COLUMN, "END IF"); |
| 3144 | printa(COLUMN, "END IF"); |
| 3145 | } |
| 3146 | } |
| 3147 | |
| 3148 | |
| 3149 | //____________________________________________________________ |
no test coverage detected