| 2664 | // |
| 2665 | |
| 2666 | static void gen_get_segment( const act* action) |
| 2667 | { |
| 2668 | const blb* blob; |
| 2669 | TEXT buffer[128]; |
| 2670 | |
| 2671 | if (action->act_flags & ACT_sql) |
| 2672 | blob = (blb*) action->act_request->req_blobs; |
| 2673 | else |
| 2674 | blob = (blb*) action->act_object; |
| 2675 | |
| 2676 | strcpy(buffer, GET_SEG_CALL_TEMPLATE); // Copy seems useless instead of using constant directly. |
| 2677 | sprintf(output_buffer, |
| 2678 | buffer, |
| 2679 | names[COLUMN], |
| 2680 | ISC_GET_SEGMENT, |
| 2681 | names[isc_status_vector_pos], |
| 2682 | names[isc_a_pos], blob->blb_ident, |
| 2683 | names[isc_a_pos], blob->blb_len_ident, |
| 2684 | BY_VALUE, blob->blb_seg_length, END_VALUE, |
| 2685 | BY_REF, names[isc_a_pos], blob->blb_buff_ident, names[isc_status_pos]); |
| 2686 | |
| 2687 | COB_print_buffer(output_buffer, true); |
| 2688 | |
| 2689 | if (action->act_flags & ACT_sql) |
| 2690 | { |
| 2691 | const ref* into = action->act_object; |
| 2692 | set_sqlcode(action); |
| 2693 | printa(names[COLUMN], false, "IF SQLCODE = 0 OR SQLCODE = 101 THEN "); |
| 2694 | printa(names[COLUMN], false, "MOVE %s%d TO %s", |
| 2695 | names[isc_a_pos], blob->blb_buff_ident, into->ref_value); |
| 2696 | if (into->ref_null_value) |
| 2697 | { |
| 2698 | printa(names[COLUMN], false, "MOVE %s%d TO %s", |
| 2699 | names[isc_a_pos], blob->blb_len_ident, into->ref_null_value); |
| 2700 | } |
| 2701 | printa(names[COLUMN], false, "END-IF"); |
| 2702 | } |
| 2703 | } |
| 2704 | |
| 2705 | |
| 2706 | //____________________________________________________________ |
no test coverage detected