Execute a non-SELECT dynamic SQL statement.
| 2341 | |
| 2342 | // Execute a non-SELECT dynamic SQL statement. |
| 2343 | ISC_STATUS API_ROUTINE isc_dsql_execute2_m(ISC_STATUS* userStatus, isc_tr_handle* traHandle, |
| 2344 | isc_stmt_handle* stmtHandle, USHORT inBlrLength, const SCHAR* inBlr, USHORT inMsgType, |
| 2345 | USHORT inMsgLength, const SCHAR* inMsg, USHORT outBlrLength, |
| 2346 | SCHAR* outBlr, USHORT /*outMsgType*/, USHORT outMsgLength, SCHAR* outMsg) |
| 2347 | { |
| 2348 | StatusVector status(userStatus); |
| 2349 | CheckStatusWrapper statusWrapper(&status); |
| 2350 | |
| 2351 | try |
| 2352 | { |
| 2353 | RefPtr<IscStatement> statement(translateHandle(statements, stmtHandle)); |
| 2354 | |
| 2355 | if (((SSHORT) inMsgType) == -1) // dirty hack to support old esql code |
| 2356 | { |
| 2357 | statement->pseudoOpened = true; |
| 2358 | return status[1]; |
| 2359 | } |
| 2360 | |
| 2361 | statement->checkPrepared(); |
| 2362 | |
| 2363 | InternalMessageBuffer inMsgBuffer(inBlrLength, (const UCHAR*) inBlr, inMsgLength, (UCHAR*) inMsg); |
| 2364 | InternalMessageBuffer outMsgBuffer(outBlrLength, (const UCHAR*) outBlr, outMsgLength, (UCHAR*) outMsg); |
| 2365 | |
| 2366 | const unsigned flags = statement->statement->getFlags(&statusWrapper); |
| 2367 | if (!(status.getState() & IStatus::STATE_ERRORS)) |
| 2368 | { |
| 2369 | if ((flags & IStatement::FLAG_HAS_CURSOR) && (outMsgLength == 0)) |
| 2370 | { |
| 2371 | statement->openCursor(&statusWrapper, traHandle, |
| 2372 | inMsgBuffer.metadata, inMsgBuffer.buffer, |
| 2373 | (outBlrLength ? outMsgBuffer.metadata : DELAYED_OUT_FORMAT)); |
| 2374 | } |
| 2375 | else |
| 2376 | { |
| 2377 | statement->execute(&statusWrapper, traHandle, |
| 2378 | inMsgBuffer.metadata, inMsgBuffer.buffer, outMsgBuffer.metadata, outMsgBuffer.buffer); |
| 2379 | } |
| 2380 | } |
| 2381 | } |
| 2382 | catch (const Exception& e) |
| 2383 | { |
| 2384 | e.stuffException(&statusWrapper); |
| 2385 | } |
| 2386 | |
| 2387 | return status[1]; |
| 2388 | } |
| 2389 | |
| 2390 | |
| 2391 | // Is this really API function? Where is it declared? |
nothing calls this directly
no test coverage detected