C Driver API 3.0.0
API for the NuoDB C Driver Library
Loading...
Searching...
No Matches
statement.h
Go to the documentation of this file.
1
6#ifndef _NUODB_STATEMENT_H_
7#define _NUODB_STATEMENT_H_ 1
8
9#ifndef _NUODB_UTILS_H_
10#include "nuodb/utils.h"
11#endif
12
13#ifndef _NUODB_STRUCTS_H_
14#include "nuodb/structs.h"
15#endif
16
17#ifndef _NUODB_ERROR_H_
18#include "nuodb/error.h"
19#endif
20
21#ifndef _NUODB_TEMPORAL_H_
22#include "nuodb/temporal.h"
23#endif
24
25#ifndef _NUODB_LOB_H_
26#include "nuodb/lob.h"
27#endif
28
29/* c-driver */
30#ifdef __cplusplus
31extern "C" {
32#endif
33
77
80
94
97
98
101{
102 int result;
103 int sqlCode;
104 const char* errorString;
105 const char* stateCode;
106};
107
131{
133 _NuoDB_Statement_state_t* _state;
134
157 NuoDB_Status (* executeSQL)(NuoDB_Statement* _this, const char* sql, unsigned int flags);
158
159
172 NuoDB_ResultSet* (* getGeneratedKeys)(NuoDB_Statement* _this);
173
184 NuoDB_ResultSet* (* getResultSet)(NuoDB_Statement* _this);
185
202
206 NuoDB_Connection* (* getConnection)(NuoDB_Statement* _this);
207
220
233 int64_t (* getQueryTimeout)(NuoDB_Statement* _this);
234
235
245
262 NuoDB_Status (* setQueryTimeout)(NuoDB_Statement* _this, int64_t microSeconds);
263
282 NuoDB_Status (* prepare)(NuoDB_Statement* _this, const char* sql, unsigned int flags);
283
291
301
311 NuoDB_Status (* executeWithFlags)(NuoDB_Statement* _this, unsigned int flags);
312
333 NuoDB_Status (* setString)(NuoDB_Statement* _this, int index, const char* stringValue);
334
348 NuoDB_Status (* setStringWithLength)(NuoDB_Statement* _this, int index, const char* stringValue, size_t length);
349
363 NuoDB_Status (* setBytes)(NuoDB_Statement* _this, int index, const char* stringValue, size_t length);
364
377 NuoDB_Status (* setInt)(NuoDB_Statement* _this, int index, int32_t value);
378
391 NuoDB_Status (* setLong)(NuoDB_Statement* _this, int index, int64_t value);
392
404 NuoDB_Status (* setLob)(NuoDB_Statement* _this, int index, NuoDB_Lob* lob);
405
418
430 NuoDB_Status (* setShort)(NuoDB_Statement* _this, int index, short value);
431
443 NuoDB_Status (* setByte)(NuoDB_Statement* _this, int index, char value);
444
457 NuoDB_Status (* setNull)(NuoDB_Statement* _this, int index, int type);
458
471 NuoDB_Status (* setDouble)(NuoDB_Statement* _this, int index, double value);
472
485 NuoDB_Status (* setTemporal)(NuoDB_Statement* _this, int index, NuoDB_Temporal* timeValue);
486
496
506
519 NuoDB_Status (* executeBatch)(NuoDB_Statement* _this, NuoDB_BatchResult** results, size_t* resultSize);
520
535 const char* (* analyze)(NuoDB_Statement* _this, int mask);
536
543 size_t (* getBatchCount)(NuoDB_Statement* _this);
544
554 NuoDB_Status (* setFetchSize)(NuoDB_Statement* _this, int fetchSize);
555
571 NuoDB_ResultSetMetaData* (* getMetaData)(NuoDB_Statement* _this);
572
585
602 const int* columnIndices, int count);
619 char* const* columnNames, int count);
620
637 const int* columnIndices, int count);
638
655 char* const* columnNames, int count);
656
672
693 NuoDB_Status (* registerOutParameterWithScale)(NuoDB_Statement* _this, int index, NuoDB_Type sqlType, int scale);
694
717 NuoDB_Status (* getString)(NuoDB_Statement* _this, int index, const char** strPtr);
718
739 NuoDB_Status (* getStringWithLength)(NuoDB_Statement* _this, int index, const char** strPtr, size_t* length);
740
754 NuoDB_Status (* getBoolean)(NuoDB_Statement* _this, int index, nuodb_bool_t* boolPtr);
755
769 NuoDB_Status (* getByte)(NuoDB_Statement* _this, int index, char* charPtr);
770
784 NuoDB_Status (* getShort)(NuoDB_Statement* _this, int index, short* shortPtr);
785
799 NuoDB_Status (* getInt)(NuoDB_Statement* _this, int index, int32_t* intPtr);
800
814 NuoDB_Status (* getLong)(NuoDB_Statement* _this, int index, int64_t* longPtr);
815
829 NuoDB_Status (* getDouble)(NuoDB_Statement* _this, int index, double* doublePtr);
830
849 NuoDB_Status (* getTemporal)(NuoDB_Statement* _this, int index, NuoDB_Temporal_Type temporalType, NuoDB_Temporal** temporalPtr);
850
869 NuoDB_Status (* getLob)(NuoDB_Statement* _this, int index, NuoDB_Lob_Type lobType, const NuoDB_Lob** lobPtr);
870
882
898
908};
909
918NUODB_CAPI NuoDB_Statement* NUODB_CAPICALL NuoDB_Statement_create(NuoDB_Connection* connection);
919
926NUODB_CAPI void NUODB_CAPICALL NuoDB_Statement_free(NuoDB_Statement* statement);
927
928#ifdef __cplusplus
929} /* extern "C" { */
930#endif
931
932#endif /* end of: #ifndef _NUODB_STATEMENT_H_ */
NuoDB Error information.
enum NuoDB_Status_enum NuoDB_Status
Status codes used by the C Driver.
Definition error.h:130
NuoDB Large Object.
enum NuoDB_Lob_Type_enum NuoDB_Lob_Type
Large object types used by NuoDB_Lob.
Definition lob.h:65
enum NuoDB_Type_enum NuoDB_Type
Constant SQL types used by the C-Language API.
Definition resultSetMetaData.h:60
NuoDB_Statement_Flags_enum
Enum defining bitfield flags used by NuoDB_Statement.
Definition statement.h:40
@ NUODB_NO_FLAGS
Value indicating there are NO optional flags.
Definition statement.h:44
@ NUODB_EXECUTEQUERY
flag for statements that execute a query.
Definition statement.h:54
@ NUODB_EXECUTEUPDATE
flag for statements that update.
Definition statement.h:59
@ NUODB_EXECUTECALL
flag for statements that execute stored procedures.
Definition statement.h:75
@ NUODB_AUTOGENERATEDKEYS
flag for statements with automatically generated keys.
Definition statement.h:49
NUODB_CAPI void NUODB_CAPICALL NuoDB_Statement_free(NuoDB_Statement *statement)
Frees a NuoDB_Statement data structure.
NuoDB_StatementAnalyze_Flags_enum
Enum defining flags used by NuoDB_Statement analyze().
Definition statement.h:82
@ NUODB_ANALYZESTATEMENT_RECORD
if set, include statistics on the records contained in the index.
Definition statement.h:86
@ NUODB_ANALYZESTATEMENT_EXECUTION
if set, include information about the execution plan for the statement.
Definition statement.h:92
enum NuoDB_Statement_Flags_enum NuoDB_Statement_Flags
Constant flags used by NuoDB_Statement.
Definition statement.h:79
NUODB_CAPI NuoDB_Statement *NUODB_CAPICALL NuoDB_Statement_create(NuoDB_Connection *connection)
Creates a NuoDB_Statement data structure.
enum NuoDB_StatementAnalyze_Flags_enum NuoDB_StatementAnalyze_Flags
Constant flags used by NuoDB_Statement.
Definition statement.h:96
The data structure for the result of a single batch operation.
Definition statement.h:101
NuoDB Database Connection.
Definition connection.h:97
NuoDB Large Object
Definition lob.h:79
Metadata about parameters.
Definition parameterMetaData.h:52
Table of data representing a database result set.
Definition resultSet.h:82
Data structure used to obtain metadata for a NuoDB_ResultSet.
Definition resultSetMetaData.h:69
The data structure for executing a SQL statement.
Definition statement.h:131
NuoDB_Status(* setDouble)(NuoDB_Statement *_this, int index, double value)
Sets the designated parameter to the given double-precision value.
Definition statement.h:471
NuoDB_Status(* prepareUpdateKeyNames)(NuoDB_Statement *_this, const char *sql, char *const *columnNames, int count)
Prepare a given DML SQL statement.
Definition statement.h:618
NuoDB_Status(* setTemporal)(NuoDB_Statement *_this, int index, NuoDB_Temporal *timeValue)
Sets the designated parameter to the given NuoDB_Temporal value.
Definition statement.h:485
NuoDB_Status(* setString)(NuoDB_Statement *_this, int index, const char *stringValue)
Sets the designated parameter to the given const char* value.
Definition statement.h:333
NuoDB_Status(* getParameterMetaData)(NuoDB_Statement *_this, NuoDB_ParameterMetaData **pmdPtr)
Retrieves the parameter metadata of the last prepared SQL statement.
Definition statement.h:897
NuoDB_Status(* prepare)(NuoDB_Statement *_this, const char *sql, unsigned int flags)
Prepares a parameterized SQL statement.
Definition statement.h:282
int(* getUpdateCount)(NuoDB_Statement *_this)
Retrieves the update count.
Definition statement.h:244
NuoDB_Status(* setLob)(NuoDB_Statement *_this, int index, NuoDB_Lob *lob)
Sets the designated parameter to the given Lob value.
Definition statement.h:404
nuodb_bool_t(* wasNull)(NuoDB_Statement *_this)
Retrieves whether the last OUT parameter read had the value of SQL NULL.
Definition statement.h:881
NuoDB_Status(* setBoolean)(NuoDB_Statement *_this, int index, nuodb_bool_t value)
Sets the designated parameter to the given boolean value.
Definition statement.h:417
NuoDB_Status(* getByte)(NuoDB_Statement *_this, int index, char *charPtr)
Retrieves the value of the designated SQL TINYINT parameter as a char value in the C programming lang...
Definition statement.h:769
NuoDB_Status(* clearParameters)(NuoDB_Statement *_this)
Clears the current parameter values immediately.
Definition statement.h:201
NuoDB_Status(* addBatch)(NuoDB_Statement *_this)
Stores the current set of parameter values as a batch entry.
Definition statement.h:495
NuoDB_Status(* setFetchSize)(NuoDB_Statement *_this, int fetchSize)
Setup of the fetch size.
Definition statement.h:554
NuoDB_Status(* getLob)(NuoDB_Statement *_this, int index, NuoDB_Lob_Type lobType, const NuoDB_Lob **lobPtr)
Retrieves the value of the designated SQL CLOB or BLOB parameter as a NuoDB_Lob data structure.
Definition statement.h:869
NuoDB_Status(* registerOutParameterWithScale)(NuoDB_Statement *_this, int index, NuoDB_Type sqlType, int scale)
Registers the OUT parameter in ordinal position index to the sqlType.
Definition statement.h:693
NuoDB_Status(* setLong)(NuoDB_Statement *_this, int index, int64_t value)
Sets the designated parameter to the given 64-bit integer value.
Definition statement.h:391
NuoDB_Status(* registerOutParameter)(NuoDB_Statement *_this, int index, NuoDB_Type sqlType)
Registers the OUT parameter in ordinal position index to the sqlType.
Definition statement.h:671
NuoDB_Status(* setStringWithLength)(NuoDB_Statement *_this, int index, const char *stringValue, size_t length)
Sets the designated parameter to the given const char* value.
Definition statement.h:348
NuoDB_Status(* getStringWithLength)(NuoDB_Statement *_this, int index, const char **strPtr, size_t *length)
Retrieves the value of the designated SQL CHAR, VARCHAR, STRING, BINARY or VARBINARY parameter as a c...
Definition statement.h:739
NuoDB_Status(* executeUpdateKeyNames)(NuoDB_Statement *_this, const char *sql, char *const *columnNames, int count)
Executes the given SQL statement and places the requested generated keys in the generated keys result...
Definition statement.h:654
NuoDB_Status(* close)(NuoDB_Statement *_this)
Close the statement on the server side.
Definition statement.h:907
NuoDB_Status(* getBoolean)(NuoDB_Statement *_this, int index, nuodb_bool_t *boolPtr)
Retrieves the value of the designated SQL BOOLEAN parameter as a nuodb_bool_t value.
Definition statement.h:754
NuoDB_Status(* setBytes)(NuoDB_Statement *_this, int index, const char *stringValue, size_t length)
Sets the designated parameter to the given binary string value.
Definition statement.h:363
NuoDB_Status(* executeSQL)(NuoDB_Statement *_this, const char *sql, unsigned int flags)
Executes a non-parameterized SQL statement.
Definition statement.h:157
NuoDB_Status(* prepareUpdateKeyIndices)(NuoDB_Statement *_this, const char *sql, const int *columnIndices, int count)
Prepare a given DML SQL statement.
Definition statement.h:601
NuoDB_Status(* setNull)(NuoDB_Statement *_this, int index, int type)
Sets the designated parameter to SQL NULL.
Definition statement.h:457
NuoDB_Status(* setShort)(NuoDB_Statement *_this, int index, short value)
Sets the designated parameter to the given short value.
Definition statement.h:430
NuoDB_Status(* getLastStatementTimeMicros)(NuoDB_Statement *_this, int64_t *result)
Get the server execution time of the last statement executed on the connection.
Definition statement.h:584
NuoDB_Status(* getShort)(NuoDB_Statement *_this, int index, short *shortPtr)
Retrieves the value of the designated SQL SHORTINT parameter as a short value in the C programming la...
Definition statement.h:784
NuoDB_Status(* getTemporal)(NuoDB_Statement *_this, int index, NuoDB_Temporal_Type temporalType, NuoDB_Temporal **temporalPtr)
Retrieves the value of the designated SQL DATE, TIME, TIMESTAMP or TIMESTAMP WITHOUT TIME ZONE parame...
Definition statement.h:849
NuoDB_Status(* getInt)(NuoDB_Statement *_this, int index, int32_t *intPtr)
Retrieves the value of the designated SQL INTEGER parameter as an int32_t value in the C programming ...
Definition statement.h:799
nuodb_bool_t(* lastExecuteStatus)(NuoDB_Statement *_this)
returns whether the first result from the last execute call was a result set or not
Definition statement.h:290
NuoDB_Status(* getDouble)(NuoDB_Statement *_this, int index, double *doublePtr)
Retrieves the value of the designated SQL DOUBLE parameter as a double value in the C programming lan...
Definition statement.h:829
NuoDB_Status(* setInt)(NuoDB_Statement *_this, int index, int32_t value)
Sets the designated parameter to the given 32-bit integer value.
Definition statement.h:377
NuoDB_Status(* getMoreResults)(NuoDB_Statement *_this, nuodb_bool_t *result)
Moves to this NuoDB_Statement data structure's next result, returns the new NuoDB_ResultSet and impli...
Definition statement.h:219
NuoDB_Status(* setQueryTimeout)(NuoDB_Statement *_this, int64_t microSeconds)
Sets the number of microseconds the client will wait for a NuoDB_Statement data structure to execute ...
Definition statement.h:262
NuoDB_Status(* executeUpdateKeyIndices)(NuoDB_Statement *_this, const char *sql, const int *columnIndices, int count)
Executes the given SQL statement and places the requested generated keys in the generated keys result...
Definition statement.h:636
NuoDB_Status(* execute)(NuoDB_Statement *_this)
Executes a previously prepared SQL statement.
Definition statement.h:300
NuoDB_Status(* setByte)(NuoDB_Statement *_this, int index, char value)
Sets the designated parameter to the given char value.
Definition statement.h:443
size_t(* getBatchCount)(NuoDB_Statement *_this)
Return the number of batch operations added via addBatch.
Definition statement.h:543
NuoDB_Status(* getLong)(NuoDB_Statement *_this, int index, int64_t *longPtr)
Retrieves the value of the designated SQL INTEGER parameter as an int64_t value in the C programming ...
Definition statement.h:814
NuoDB_Status(* clearBatch)(NuoDB_Statement *_this)
Clear the stored batch entries.
Definition statement.h:505
int64_t(* getQueryTimeout)(NuoDB_Statement *_this)
Retrieves the number of microseconds the driver will wait for a NuoDB_Statement data structure to exe...
Definition statement.h:233
NuoDB_Status(* executeBatch)(NuoDB_Statement *_this, NuoDB_BatchResult **results, size_t *resultSize)
Execute the batch operations added via addBatch.
Definition statement.h:519
NuoDB_Status(* executeWithFlags)(NuoDB_Statement *_this, unsigned int flags)
Executes a previously prepared SQL statement.
Definition statement.h:311
NuoDB_Status(* getString)(NuoDB_Statement *_this, int index, const char **strPtr)
Retrieves the value of the designated SQL CHAR, VARCHAR, STRING, NUMERIC, DECIMAL or NUMBER parameter...
Definition statement.h:717
Data structure used to represent temporal information.
Definition temporal.h:59
structs and typedefs.
Data structure used to represent temporal information.
enum NuoDB_Temporal_Type_enum NuoDB_Temporal_Type
Constant temporal types used by NuoDB_Temporal.
Definition temporal.h:51
NuoDB utilities.
unsigned char nuodb_bool_t
NuoDB boolean type.
Definition utils.h:49