| 2099 | // |
| 2100 | |
| 2101 | static void gen_dyn_immediate( const act* action) |
| 2102 | { |
| 2103 | gpre_req* request; |
| 2104 | gpre_req req_const; |
| 2105 | |
| 2106 | const dyn* statement = (dyn*) action->act_object; |
| 2107 | const TEXT* transaction; |
| 2108 | if (statement->dyn_trans) |
| 2109 | { |
| 2110 | transaction = statement->dyn_trans; |
| 2111 | request = &req_const; |
| 2112 | request->req_trans = transaction; |
| 2113 | } |
| 2114 | else |
| 2115 | { |
| 2116 | transaction = names[isc_trans_pos]; |
| 2117 | request = NULL; |
| 2118 | } |
| 2119 | |
| 2120 | const gpre_dbb* database = statement->dyn_database; |
| 2121 | |
| 2122 | TEXT s[64]; |
| 2123 | const TEXT* s2 = "ISC-CONST-DYN-IMMEDL"; |
| 2124 | printa(names[COLUMN], true, GET_LEN_CALL_TEMPLATE, STRING_LENGTH, statement->dyn_string, s2); |
| 2125 | sprintf(s, " %s,", s2); |
| 2126 | |
| 2127 | if (gpreGlob.sw_auto) |
| 2128 | { |
| 2129 | t_start_auto(request, status_vector(action), action, true); |
| 2130 | printa(names[COLUMN], false, "IF %s NOT = 0 THEN", transaction); |
| 2131 | } |
| 2132 | |
| 2133 | printa(names[COLUMN], true, |
| 2134 | statement->dyn_sqlda2 ? |
| 2135 | "CALL \"%s\" USING %s, %s, %s,%s %s, %d, %s, %s" : |
| 2136 | "CALL \"%s\" USING %s, %s, %s,%s %s, %d, %s", |
| 2137 | statement->dyn_sqlda2 ? ISC_EXECUTE_IMMEDIATE2 : ISC_EXECUTE_IMMEDIATE, |
| 2138 | status_vector(action), database->dbb_name->sym_string, |
| 2139 | transaction, s, statement->dyn_string, |
| 2140 | gpreGlob.sw_sql_dialect, |
| 2141 | statement->dyn_sqlda ? statement->dyn_sqlda : OMITTED, |
| 2142 | statement->dyn_sqlda2 ? statement->dyn_sqlda2 : OMITTED); |
| 2143 | |
| 2144 | if (gpreGlob.sw_auto) |
| 2145 | printa(names[COLUMN], false, "END-IF"); |
| 2146 | |
| 2147 | set_sqlcode(action); |
| 2148 | } |
| 2149 | |
| 2150 | |
| 2151 | //____________________________________________________________ |
no test coverage detected