| 2057 | // |
| 2058 | |
| 2059 | static void gen_dyn_open( const act* action) |
| 2060 | { |
| 2061 | TEXT s[MAX_CURSOR_SIZE]; |
| 2062 | gpre_req* request; |
| 2063 | gpre_req req_const; |
| 2064 | |
| 2065 | const dyn* statement = (dyn*) action->act_object; |
| 2066 | const TEXT* transaction; |
| 2067 | if (statement->dyn_trans) |
| 2068 | { |
| 2069 | transaction = statement->dyn_trans; |
| 2070 | request = &req_const; |
| 2071 | request->req_trans = transaction; |
| 2072 | } |
| 2073 | else |
| 2074 | { |
| 2075 | transaction = names[isc_trans_pos]; |
| 2076 | request = NULL; |
| 2077 | } |
| 2078 | |
| 2079 | make_name_formatted(s, "ISC-CONST-%s", statement->dyn_cursor_name); |
| 2080 | |
| 2081 | if (gpreGlob.sw_auto) |
| 2082 | { |
| 2083 | t_start_auto(request, status_vector(action), action, true); |
| 2084 | printa(names[COLUMN], false, "IF %s NOT = 0 THEN", transaction); |
| 2085 | } |
| 2086 | |
| 2087 | printa(names[COLUMN], true, |
| 2088 | statement->dyn_sqlda2 ? |
| 2089 | "CALL \"%s\" USING %s, %s%s, %s%s, %s%d%s, %s%s, %s%s" : |
| 2090 | "CALL \"%s\" USING %s, %s%s, %s%s, %s%d%s, %s%s", |
| 2091 | statement->dyn_sqlda2 ? ISC_OPEN2 : ISC_OPEN, |
| 2092 | status_vector(action), |
| 2093 | BY_REF, transaction, |
| 2094 | BY_REF, s, |
| 2095 | BY_VALUE, gpreGlob.sw_sql_dialect, END_VALUE, |
| 2096 | statement->dyn_sqlda ? BY_REF : "", |
| 2097 | statement->dyn_sqlda ? statement->dyn_sqlda : OMITTED, |
| 2098 | statement->dyn_sqlda2 ? BY_REF : "", |
| 2099 | statement->dyn_sqlda2 ? statement->dyn_sqlda2 : OMITTED); |
| 2100 | |
| 2101 | if (gpreGlob.sw_auto) |
| 2102 | printa(names[COLUMN], false, "END-IF"); |
| 2103 | |
| 2104 | set_sqlcode(action); |
| 2105 | } |
| 2106 | |
| 2107 | |
| 2108 | //____________________________________________________________ |
no test coverage detected