| 2100 | // |
| 2101 | |
| 2102 | static void gen_get_or_put_slice(const act* action, |
| 2103 | ref* reference, |
| 2104 | bool get, |
| 2105 | int column) |
| 2106 | { |
| 2107 | const TEXT* pattern1 = |
| 2108 | "firebird.GET_SLICE (%V1 %RF%DH%RE, %RF%S1%RE, %S2, %N1, %S3, %N2, %S4, %L1, %S5, %S6);"; |
| 2109 | const TEXT* pattern2 = |
| 2110 | "firebird.PUT_SLICE (%V1 %RF%DH%RE, %RF%S1%RE, %S2, %N1, %S3, %N2, %S4, %L1, %S5);"; |
| 2111 | |
| 2112 | if (!(reference->ref_flags & REF_fetch_array)) |
| 2113 | return; |
| 2114 | |
| 2115 | PAT args; |
| 2116 | args.pat_vector1 = status_vector(action); // status vector |
| 2117 | args.pat_database = action->act_request->req_database; // database handle |
| 2118 | args.pat_string1 = action->act_request->req_trans; // transaction handle |
| 2119 | |
| 2120 | TEXT s1[MAX_REF_SIZE]; |
| 2121 | gen_name(s1, reference, true); // blob handle |
| 2122 | args.pat_string2 = s1; |
| 2123 | |
| 2124 | args.pat_value1 = reference->ref_sdl_length; // slice descr. length |
| 2125 | |
| 2126 | TEXT s2[25]; |
| 2127 | sprintf(s2, "isc_%d", reference->ref_sdl_ident); // slice description |
| 2128 | args.pat_string3 = s2; |
| 2129 | |
| 2130 | args.pat_value2 = 0; // parameter length |
| 2131 | |
| 2132 | TEXT s3[25]; |
| 2133 | sprintf(s3, "isc_null_vector_l"); // parameter block init |
| 2134 | args.pat_string4 = s3; |
| 2135 | |
| 2136 | args.pat_long1 = reference->ref_field->fld_array_info->ary_size; |
| 2137 | // slice size |
| 2138 | TEXT s4[25]; |
| 2139 | if (action->act_flags & ACT_sql) { |
| 2140 | sprintf(s4, "%s'address", reference->ref_value); |
| 2141 | } |
| 2142 | else { |
| 2143 | sprintf(s4, "isc_%d'address", reference->ref_field->fld_array_info->ary_ident); |
| 2144 | } |
| 2145 | args.pat_string5 = s4; // array name |
| 2146 | |
| 2147 | args.pat_string6 = "isc_array_length"; // return length |
| 2148 | |
| 2149 | if (get) |
| 2150 | PATTERN_expand(column, pattern1, &args); |
| 2151 | else |
| 2152 | PATTERN_expand(column, pattern2, &args); |
| 2153 | } |
| 2154 | |
| 2155 | |
| 2156 | //____________________________________________________________ |
no test coverage detected