Fetch next record from a dynamic SQL cursor
| 2536 | |
| 2537 | // Fetch next record from a dynamic SQL cursor |
| 2538 | ISC_STATUS API_ROUTINE isc_dsql_fetch(ISC_STATUS* userStatus, isc_stmt_handle* stmtHandle, |
| 2539 | USHORT dialect, const XSQLDA* sqlda) |
| 2540 | { |
| 2541 | StatusVector status(userStatus); |
| 2542 | CheckStatusWrapper statusWrapper(&status); |
| 2543 | |
| 2544 | try |
| 2545 | { |
| 2546 | if (!sqlda) |
| 2547 | status_exception::raise(Arg::Gds(isc_dsql_sqlda_err) << Arg::Gds(isc_dsql_no_output_sqlda)); |
| 2548 | |
| 2549 | RefPtr<IscStatement> statement(translateHandle(statements, stmtHandle)); |
| 2550 | |
| 2551 | SQLDAMetadataLauncher outMessage(sqlda); |
| 2552 | |
| 2553 | if (statement->fetch(&statusWrapper, outMessage.metadata, outMessage.getBuffer())) |
| 2554 | outMessage.scatterData(); |
| 2555 | else if (!(status.getState() & IStatus::STATE_ERRORS)) |
| 2556 | return 100; |
| 2557 | } |
| 2558 | catch (const Exception& e) |
| 2559 | { |
| 2560 | e.stuffException(&statusWrapper); |
| 2561 | } |
| 2562 | |
| 2563 | return status[1]; |
| 2564 | } |
| 2565 | |
| 2566 | |
| 2567 | // Fetch next record from a dynamic SQL cursor |
nothing calls this directly
no test coverage detected