| 2178 | // |
| 2179 | |
| 2180 | static void gen_dyn_open( const act* action) |
| 2181 | { |
| 2182 | TEXT s[MAX_CURSOR_SIZE]; |
| 2183 | gpre_req* request; |
| 2184 | gpre_req req_const; |
| 2185 | |
| 2186 | const dyn* statement = (dyn*) action->act_object; |
| 2187 | const TEXT* transaction; |
| 2188 | if (statement->dyn_trans) |
| 2189 | { |
| 2190 | transaction = statement->dyn_trans; |
| 2191 | request = &req_const; |
| 2192 | request->req_trans = transaction; |
| 2193 | } |
| 2194 | else |
| 2195 | { |
| 2196 | transaction = names[isc_trans_pos]; |
| 2197 | request = NULL; |
| 2198 | } |
| 2199 | |
| 2200 | make_name_formatted(s, "ISC-CONST-%s", statement->dyn_cursor_name); |
| 2201 | |
| 2202 | if (gpreGlob.sw_auto) |
| 2203 | { |
| 2204 | t_start_auto(request, status_vector(action), action, true); |
| 2205 | printa(names[COLUMN], false, "IF %s NOT = 0 THEN", transaction); |
| 2206 | } |
| 2207 | |
| 2208 | printa(names[COLUMN], true, |
| 2209 | statement->dyn_sqlda2 ? |
| 2210 | "CALL \"%s\" USING %s, %s, %s, %d, %s, %s" : |
| 2211 | "CALL \"%s\" USING %s, %s, %s, %d, %s", |
| 2212 | statement->dyn_sqlda2 ? ISC_OPEN2 : ISC_OPEN, |
| 2213 | status_vector(action), |
| 2214 | transaction, |
| 2215 | s, |
| 2216 | gpreGlob.sw_sql_dialect, |
| 2217 | statement->dyn_sqlda ? statement->dyn_sqlda : OMITTED, |
| 2218 | statement->dyn_sqlda2 ? statement->dyn_sqlda2 : OMITTED); |
| 2219 | |
| 2220 | if (gpreGlob.sw_auto) |
| 2221 | printa(names[COLUMN], false, "END-IF"); |
| 2222 | |
| 2223 | set_sqlcode(action); |
| 2224 | } |
| 2225 | |
| 2226 | |
| 2227 | //____________________________________________________________ |
no test coverage detected