| 2776 | // |
| 2777 | |
| 2778 | static void gen_select( const act* action, int column) |
| 2779 | { |
| 2780 | TEXT name[MAX_REF_SIZE]; |
| 2781 | |
| 2782 | const gpre_req* request = action->act_request; |
| 2783 | const gpre_port* port = request->req_primary; |
| 2784 | gen_name(name, request->req_eof, true); |
| 2785 | |
| 2786 | gen_s_start(action, column); |
| 2787 | begin(column); |
| 2788 | gen_receive(action, column, port); |
| 2789 | printa(column, "if SQLCODE = 0 then", name); |
| 2790 | column += INDENT; |
| 2791 | printa(column, "if %s <> 0 then", name); |
| 2792 | column += INDENT; |
| 2793 | |
| 2794 | begin(column); |
| 2795 | const gpre_nod* var_list = (gpre_nod*) action->act_object; |
| 2796 | if (var_list) |
| 2797 | { |
| 2798 | for (int i = 0; i < var_list->nod_count; i++) |
| 2799 | { |
| 2800 | align(column); |
| 2801 | asgn_to(action, reinterpret_cast<const ref*>(var_list->nod_arg[i]), column); |
| 2802 | } |
| 2803 | } |
| 2804 | |
| 2805 | printa(column - INDENT, "else"); |
| 2806 | printa(column, "SQLCODE := 100;"); |
| 2807 | column -= INDENT; |
| 2808 | ends(column); |
| 2809 | } |
| 2810 | |
| 2811 | |
| 2812 | //____________________________________________________________ |
no test coverage detected