MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / IscStatement

Class IscStatement

src/yvalve/why.cpp:1223–1286  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1221 };
1222
1223 class IscStatement : public RefCounted, public GlobalStorage, public YObject
1224 {
1225 public:
1226 static const ISC_STATUS ERROR_CODE = isc_bad_stmt_handle;
1227
1228 explicit IscStatement(YAttachment* aAttachment)
1229 : attachment(aAttachment),
1230 cursorName(getPool()),
1231 statement(NULL),
1232 userHandle(NULL),
1233 pseudoOpened(false),
1234 delayedFormat(false)
1235 { }
1236
1237 ~IscStatement() override;
1238
1239 isc_stmt_handle& getHandle();
1240 void destroy(unsigned);
1241
1242 void openCursor(CheckStatusWrapper* status, isc_tr_handle* traHandle,
1243 IMessageMetadata* inMetadata, UCHAR* buffer, IMessageMetadata* outMetadata);
1244
1245 void closeCursor(CheckStatusWrapper* status, bool raise);
1246 void closeStatement(CheckStatusWrapper* status);
1247
1248 void execute(CheckStatusWrapper* status, isc_tr_handle* traHandle,
1249 IMessageMetadata* inMetadata, UCHAR* inBuffer, IMessageMetadata* outMetadata, UCHAR* outBuffer);
1250
1251 FB_BOOLEAN fetch(CheckStatusWrapper* status, IMessageMetadata* outMetadata, UCHAR* outBuffer);
1252
1253 void checkPrepared(ISC_STATUS code = isc_unprepared_stmt) const
1254 {
1255 if (!statement)
1256 Arg::Gds(code).raise();
1257 }
1258
1259 void checkCursorOpened() const
1260 {
1261 if (!statement || !statement->cursor)
1262 (Arg::Gds(isc_sqlerr) << Arg::Num(-504) <<
1263 Arg::Gds(isc_dsql_cursor_err) <<
1264 Arg::Gds(isc_dsql_cursor_not_open)).raise();
1265 }
1266
1267 void checkCursorClosed() const
1268 {
1269 if (statement && statement->cursor)
1270 (Arg::Gds(isc_sqlerr) << Arg::Num(-502) <<
1271 Arg::Gds(isc_dsql_cursor_open_err)).raise();
1272 }
1273
1274 IStatement* getInterface()
1275 {
1276 fb_assert(statement);
1277 statement->addRef();
1278 return statement;
1279 }
1280

Calls

no outgoing calls

Tested by

no test coverage detected