Fetch next record from a dynamic SQL cursor
| 2566 | |
| 2567 | // Fetch next record from a dynamic SQL cursor |
| 2568 | ISC_STATUS API_ROUTINE isc_dsql_fetch_m(ISC_STATUS* userStatus, isc_stmt_handle* stmtHandle, |
| 2569 | USHORT blrLength, SCHAR* blr, USHORT /*msgType*/, USHORT msgLength, SCHAR* msg) |
| 2570 | { |
| 2571 | StatusVector status(userStatus); |
| 2572 | CheckStatusWrapper statusWrapper(&status); |
| 2573 | |
| 2574 | try |
| 2575 | { |
| 2576 | RefPtr<IscStatement> statement(translateHandle(statements, stmtHandle)); |
| 2577 | |
| 2578 | InternalMessageBuffer msgBuffer(blrLength, reinterpret_cast<UCHAR*>(blr), msgLength, reinterpret_cast<UCHAR*>(msg)); |
| 2579 | |
| 2580 | if (!msgBuffer.metadata) |
| 2581 | { |
| 2582 | (Arg::Gds(isc_sqlerr) << Arg::Num(-502) << |
| 2583 | Arg::Gds(isc_dsql_cursor_open_err)).raise(); |
| 2584 | } |
| 2585 | |
| 2586 | if (!statement->fetch(&statusWrapper, msgBuffer.metadata, reinterpret_cast<UCHAR*>(msg)) && |
| 2587 | !(status.getState() & IStatus::STATE_ERRORS)) |
| 2588 | { |
| 2589 | return 100; |
| 2590 | } |
| 2591 | } |
| 2592 | catch (const Exception& e) |
| 2593 | { |
| 2594 | e.stuffException(&statusWrapper); |
| 2595 | } |
| 2596 | |
| 2597 | return status[1]; |
| 2598 | } |
| 2599 | |
| 2600 | |
| 2601 | // Release request for an sql statement |
nothing calls this directly
no test coverage detected