| 2735 | // |
| 2736 | |
| 2737 | static act* act_describe() |
| 2738 | { |
| 2739 | bool in_sqlda; |
| 2740 | |
| 2741 | if (MSC_match(KW_INPUT)) |
| 2742 | in_sqlda = true; |
| 2743 | else |
| 2744 | { |
| 2745 | MSC_match(KW_OUTPUT); |
| 2746 | in_sqlda = false; |
| 2747 | } |
| 2748 | |
| 2749 | dyn* statement = par_statement(); |
| 2750 | |
| 2751 | if (!MSC_match(KW_INTO)) |
| 2752 | { |
| 2753 | // check for SQL2 syntax |
| 2754 | // "USING SQL DESCRIPTOR sqlda" |
| 2755 | |
| 2756 | if (!MSC_match(KW_USING) || !MSC_match(KW_SQL) || !MSC_match(KW_DESCRIPTOR)) |
| 2757 | CPR_s_error("INTO or USING SQL DESCRIPTOR sqlda"); |
| 2758 | } |
| 2759 | else if (MSC_match(KW_SQL) && !MSC_match(KW_DESCRIPTOR)) |
| 2760 | CPR_s_error("INTO SQL DESCRIPTOR sqlda"); |
| 2761 | |
| 2762 | statement->dyn_sqlda = PAR_native_value(false, false); |
| 2763 | act* action = (act*) MSC_alloc(ACT_LEN); |
| 2764 | if (in_sqlda) |
| 2765 | action->act_type = ACT_dyn_describe_input; |
| 2766 | else |
| 2767 | action->act_type = ACT_dyn_describe; |
| 2768 | action->act_object = (ref*) statement; |
| 2769 | action->act_whenever = gen_whenever(); |
| 2770 | |
| 2771 | return action; |
| 2772 | } |
| 2773 | |
| 2774 | |
| 2775 | //____________________________________________________________ |
no test coverage detected