MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / API_ROUTINE isc_dsql_fetch_m

Function API_ROUTINE isc_dsql_fetch_m

src/yvalve/why.cpp:2568–2598  ·  view source on GitHub ↗

Fetch next record from a dynamic SQL cursor

Source from the content-addressed store, hash-verified

2566
2567// Fetch next record from a dynamic SQL cursor
2568ISC_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

Callers

nothing calls this directly

Calls 7

translateHandleFunction · 0.85
GdsClass · 0.85
NumClass · 0.85
raiseMethod · 0.45
fetchMethod · 0.45
getStateMethod · 0.45
stuffExceptionMethod · 0.45

Tested by

no test coverage detected