| 1277 | // |
| 1278 | |
| 1279 | static void gen_compile( const act* action) |
| 1280 | { |
| 1281 | const gpre_req* request = action->act_request; |
| 1282 | const gpre_dbb* db = request->req_database; |
| 1283 | const gpre_sym* symbol = db->dbb_name; |
| 1284 | |
| 1285 | // generate automatic ready if appropriate |
| 1286 | |
| 1287 | if (gpreGlob.sw_auto) |
| 1288 | t_start_auto(request, status_vector(action), action, true); |
| 1289 | |
| 1290 | // always generate a compile, a test for the success of the compile, |
| 1291 | // and an end to the 'if not compiled test |
| 1292 | |
| 1293 | // generate an 'if not compiled' |
| 1294 | |
| 1295 | printa(names[COLUMN], false, "IF %s = 0 THEN", request->req_handle); |
| 1296 | |
| 1297 | if (gpreGlob.sw_auto && action->act_error) |
| 1298 | printa(names[COLUMN], false, "IF %s NOT = 0 THEN", request_trans(action, request)); |
| 1299 | |
| 1300 | sprintf(output_buffer, "%sCALL \"%s%s\" USING %s, %s%s, %s%s, %s%d%s, %s%s%d\n", |
| 1301 | names[COLUMN], ISC_COMPILE_REQUEST, |
| 1302 | (request->req_flags & REQ_exp_hand) ? "" : "2", |
| 1303 | status_vector(action), BY_REF, symbol->sym_string, BY_REF, |
| 1304 | request->req_handle, BY_VALUE, request->req_length, END_VALUE, |
| 1305 | BY_REF, names[isc_a_pos], request->req_ident); |
| 1306 | |
| 1307 | COB_print_buffer(output_buffer, true); |
| 1308 | if (gpreGlob.sw_auto && action->act_error) |
| 1309 | printa(names[COLUMN], false, "END-IF"); |
| 1310 | |
| 1311 | set_sqlcode(action); |
| 1312 | printa(names[COLUMN], false, "END-IF"); |
| 1313 | |
| 1314 | // If blobs are present, zero out all of the blob handles. After this |
| 1315 | // point, the handles are the user's responsibility |
| 1316 | |
| 1317 | for (const blb* blob = request->req_blobs; blob; blob = blob->blb_next) |
| 1318 | { |
| 1319 | sprintf(output_buffer, "%sMOVE 0 TO %s%d\n", |
| 1320 | names[COLUMN], names[isc_a_pos], blob->blb_ident); |
| 1321 | |
| 1322 | COB_print_buffer(output_buffer, false); |
| 1323 | } |
| 1324 | } |
| 1325 | |
| 1326 | |
| 1327 | //____________________________________________________________ |
no test coverage detected