| 2111 | // |
| 2112 | |
| 2113 | static void gen_dyn_prepare( const act* action) |
| 2114 | { |
| 2115 | gpre_req* request; |
| 2116 | gpre_req req_const; |
| 2117 | |
| 2118 | const dyn* statement = (dyn*) action->act_object; |
| 2119 | const gpre_dbb* database = statement->dyn_database; |
| 2120 | |
| 2121 | const TEXT* transaction; |
| 2122 | if (statement->dyn_trans) |
| 2123 | { |
| 2124 | transaction = statement->dyn_trans; |
| 2125 | request = &req_const; |
| 2126 | request->req_trans = transaction; |
| 2127 | } |
| 2128 | else |
| 2129 | { |
| 2130 | transaction = names[isc_trans_pos]; |
| 2131 | request = NULL; |
| 2132 | } |
| 2133 | |
| 2134 | TEXT s[MAX_CURSOR_SIZE], s3[80]; |
| 2135 | make_name_formatted(s, "ISC-CONST-%s", statement->dyn_statement_name); |
| 2136 | TEXT s2[MAX_CURSOR_SIZE + 1]; |
| 2137 | sprintf(s2, "%sL", s); |
| 2138 | printa(names[COLUMN], true, GET_LEN_CALL_TEMPLATE, STRING_LENGTH, statement->dyn_string, s2); |
| 2139 | fb_utils::snprintf(s3, sizeof(s3), " %s%s%s,", BY_VALUE, s2, END_VALUE); |
| 2140 | |
| 2141 | if (gpreGlob.sw_auto) |
| 2142 | { |
| 2143 | t_start_auto(request, status_vector(action), action, true); |
| 2144 | printa(names[COLUMN], false, "IF %s NOT = 0 THEN", transaction); |
| 2145 | } |
| 2146 | |
| 2147 | printa(names[COLUMN], true, "CALL \"%s\" USING %s, %s%s, %s%s, %s%s,%s %s%s, %s%d%s, %s%s", |
| 2148 | ISC_PREPARE, |
| 2149 | status_vector(action), |
| 2150 | BY_REF, database->dbb_name->sym_string, |
| 2151 | BY_REF, transaction, |
| 2152 | BY_REF, s, |
| 2153 | s3, |
| 2154 | BY_DESC, statement->dyn_string, |
| 2155 | BY_VALUE, gpreGlob.sw_sql_dialect, END_VALUE, |
| 2156 | statement->dyn_sqlda ? BY_REF : "", |
| 2157 | statement->dyn_sqlda ? statement->dyn_sqlda : OMITTED); |
| 2158 | |
| 2159 | if (gpreGlob.sw_auto) |
| 2160 | printa(names[COLUMN], false, "END-IF"); |
| 2161 | |
| 2162 | set_sqlcode(action); |
| 2163 | } |
| 2164 | |
| 2165 | |
| 2166 | //____________________________________________________________ |
no test coverage detected