____________________________________________________________ Declare a cursor for a dynamic request.
| 168 | // Declare a cursor for a dynamic request. |
| 169 | // |
| 170 | ISC_STATUS API_ROUTINE isc_embed_dsql_declare(ISC_STATUS* user_status, |
| 171 | const SCHAR* stmt_name, |
| 172 | const SCHAR* cursor) |
| 173 | { |
| 174 | ISC_STATUS_ARRAY local_status; |
| 175 | |
| 176 | INIT_DSQL(user_status, local_status); |
| 177 | try |
| 178 | { |
| 179 | // get the symbol table entry |
| 180 | |
| 181 | dsql_stmt* statement = lookup_stmt(stmt_name, statement_names, NAME_statement); |
| 182 | |
| 183 | const ISC_STATUS s = isc_dsql_set_cursor_name(user_status, &statement->stmt_handle, cursor, 0); |
| 184 | if (s) { |
| 185 | return s; |
| 186 | } |
| 187 | |
| 188 | Firebird::WriteLockGuard guard(global_sync, FB_FUNCTION); |
| 189 | statement->stmt_cursor = insert_name(cursor, &cursor_names, statement); |
| 190 | |
| 191 | return s; |
| 192 | } |
| 193 | catch (const Firebird::Exception& ex) |
| 194 | { |
| 195 | return error(ex); |
| 196 | } |
| 197 | } |
| 198 | |
| 199 | |
| 200 | //____________________________________________________________ |
nothing calls this directly
no test coverage detected