| 2571 | // |
| 2572 | |
| 2573 | static void gen_procedure(const act* action) |
| 2574 | { |
| 2575 | const gpre_req* request = action->act_request; |
| 2576 | const gpre_port* in_port = request->req_vport; |
| 2577 | const gpre_port* out_port = request->req_primary; |
| 2578 | |
| 2579 | gpre_dbb* database = request->req_database; |
| 2580 | PAT args; |
| 2581 | args.pat_database = database; |
| 2582 | args.pat_request = action->act_request; |
| 2583 | args.pat_vector1 = status_vector(); |
| 2584 | args.pat_request = request; |
| 2585 | args.pat_port = in_port; |
| 2586 | args.pat_port2 = out_port; |
| 2587 | |
| 2588 | const TEXT* pattern; |
| 2589 | if (in_port && in_port->por_length) |
| 2590 | pattern = |
| 2591 | "CALL ISC_TRANSACT_REQUEST (%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"; |
| 2592 | else |
| 2593 | pattern = |
| 2594 | "CALL ISC_TRANSACT_REQUEST (%V1, %RF%DH%RE, %RF%RT%RE, %VF%RS%VE, %RI, %VF0%VE, 0, %VF%QL%VE, %RF%QI%RE)\n"; |
| 2595 | |
| 2596 | // Get database attach and transaction started |
| 2597 | |
| 2598 | if (gpreGlob.sw_auto) |
| 2599 | t_start_auto(0, status_vector(), action, true); |
| 2600 | |
| 2601 | // Move in input values |
| 2602 | |
| 2603 | asgn_from(action, request->req_values); |
| 2604 | |
| 2605 | // Execute the procedure |
| 2606 | |
| 2607 | const USHORT column = 6; |
| 2608 | |
| 2609 | PATTERN_expand(column, pattern, &args); |
| 2610 | |
| 2611 | status_and_stop(action); |
| 2612 | |
| 2613 | printa(COLUMN, "IF (SQLCODE .EQ. 0) THEN"); |
| 2614 | |
| 2615 | // Move out output values |
| 2616 | |
| 2617 | asgn_to_proc(request->req_references); |
| 2618 | printa(COLUMN, "END IF"); |
| 2619 | } |
| 2620 | |
| 2621 | |
| 2622 | //____________________________________________________________ |
no test coverage detected