| 2230 | // |
| 2231 | |
| 2232 | static void gen_dyn_prepare( const act* action) |
| 2233 | { |
| 2234 | gpre_req* request; |
| 2235 | gpre_req req_const; |
| 2236 | |
| 2237 | const dyn* statement = (dyn*) action->act_object; |
| 2238 | const gpre_dbb* database = statement->dyn_database; |
| 2239 | |
| 2240 | const TEXT* transaction; |
| 2241 | if (statement->dyn_trans) |
| 2242 | { |
| 2243 | transaction = statement->dyn_trans; |
| 2244 | request = &req_const; |
| 2245 | request->req_trans = transaction; |
| 2246 | } |
| 2247 | else |
| 2248 | { |
| 2249 | transaction = names[isc_trans_pos]; |
| 2250 | request = NULL; |
| 2251 | } |
| 2252 | |
| 2253 | TEXT s[MAX_CURSOR_SIZE], s3[80]; |
| 2254 | make_name_formatted(s, "ISC-CONST-%s", statement->dyn_statement_name); |
| 2255 | TEXT s2[MAX_CURSOR_SIZE + 1]; |
| 2256 | sprintf(s2, "%sL", s); |
| 2257 | printa(names[COLUMN], true, GET_LEN_CALL_TEMPLATE, STRING_LENGTH, statement->dyn_string, s2); |
| 2258 | fb_utils::snprintf(s3, sizeof(s3), " %s,", s2); |
| 2259 | |
| 2260 | if (gpreGlob.sw_auto) |
| 2261 | { |
| 2262 | t_start_auto(request, status_vector(action), action, true); |
| 2263 | printa(names[COLUMN], false, "IF %s NOT = 0 THEN", transaction); |
| 2264 | } |
| 2265 | |
| 2266 | printa(names[COLUMN], true, "CALL \"%s\" USING %s, %s, %s, %s,%s %s, %d, %s", |
| 2267 | ISC_PREPARE, |
| 2268 | status_vector(action), |
| 2269 | database->dbb_name->sym_string, |
| 2270 | transaction, |
| 2271 | s, |
| 2272 | s3, |
| 2273 | statement->dyn_string, |
| 2274 | gpreGlob.sw_sql_dialect, |
| 2275 | statement->dyn_sqlda ? statement->dyn_sqlda : OMITTED); |
| 2276 | |
| 2277 | if (gpreGlob.sw_auto) |
| 2278 | printa(names[COLUMN], false, "END-IF"); |
| 2279 | |
| 2280 | set_sqlcode(action); |
| 2281 | } |
| 2282 | |
| 2283 | |
| 2284 | //____________________________________________________________ |
no test coverage detected