Public Member Functions | |
PROUDSRV_API void | Prepare (COdbcConnection &conn, const String &query) |
PROUDSRV_API void | AppendInputParameter (const COdbcVariant ¶m, OdbcSqlDataType sqlType=OdbcSqlDataType_UNKNOWN) |
PROUDSRV_API void | AppendOutputParameter (const COdbcVariant ¶m, OdbcSqlDataType sqlType=OdbcSqlDataType_UNKNOWN) |
PROUDSRV_API void | AppendInputOutputParameter (const COdbcVariant ¶m, OdbcSqlDataType sqlType=OdbcSqlDataType_UNKNOWN) |
PROUDSRV_API void | SetNullParameter (unsigned int paramIndex, bool state) |
PROUDSRV_API int | Execute (COdbcWarnings *odbcWarnings=NULL) |
PROUDSRV_API int | Execute (COdbcRecordset &recordset, COdbcWarnings *odbcWarnings=NULL) |
It is a class that deals with Prepared Statement. It is useful for continuous use by changing parameter value of a query, differently from Execute in COdbcConnection. Also used when executing Stored Procedure that Input, Output and Input&Output parameter need.
PROUDSRV_API void Proud::COdbcCommand::AppendInputOutputParameter | ( | const COdbcVariant & | param, |
OdbcSqlDataType | sqlType = OdbcSqlDataType_UNKNOWN |
||
) |
It is used when designating “Input&Output parameter”. You can only input data in the form of pointer in order to receive data. In case of inputting in the form of pointer, you must check if there is problem occurred by scope of the relevant variable.
Depending on inputted data, sqlType is automatically decided, so in case you input a type you want in the database, you can input OdbcSqlDataType. ex> In case of inputting & outputting variable whose type is int32_t as data whose type is int64_t,
In case of inputting & outputting string, you must use GetBuffer와 ReleaseBuffer of Proud::String class before/after execution.
In case of receiving binary data, you must use Proud::COdbcByteData class. COdbcByteData is only allowed to be inputted by the pointer.
PROUDSRV_API void Proud::COdbcCommand::AppendInputParameter | ( | const COdbcVariant & | param, |
OdbcSqlDataType | sqlType = OdbcSqlDataType_UNKNOWN |
||
) |
It is used when inputting “Input parameter”. You can just input data in the form of pointer in case you want to change variables only. In case of inputting in the form of pointer, you must check if there is problem occurred by scope of the relevant variable.
Depending on inputted data, sqlType is automatically decided, so in case you input a type you want in the database, you can input OdbcSqlDataType. ex> In case of inputting variable whose type is int32_t as data whose type is int64_t,
In case of inputting binary data, you must use Proud::COdbcByteData class. COdbcByteData is only allowed to be inputted by the pointer.
PROUDSRV_API void Proud::COdbcCommand::AppendOutputParameter | ( | const COdbcVariant & | param, |
OdbcSqlDataType | sqlType = OdbcSqlDataType_UNKNOWN |
||
) |
It is used when designating “Output parameter”. You can only input data in the form of pointer in order to receive data. In case of inputting in the form of pointer, you must check if there is problem occurred by scope of the relevant variable.
Depending on inputted data, sqlType is automatically decided, so in case you input a type you want in the database, you can input OdbcSqlDataType. ex> In case of receiving data whose type is int64_t as variable whose type is int32_t,
In case of receiving string, you must use GetBuffer와 ReleaseBuffer of Proud::String class before/after execution.
In case of receiving binary data, you must use Proud::COdbcByteData class. COdbcByteData is only allowed to be inputted by the pointer.
PROUDSRV_API int Proud::COdbcCommand::Execute | ( | COdbcWarnings * | odbcWarnings = NULL | ) |
Execute the query.
PROUDSRV_API int Proud::COdbcCommand::Execute | ( | COdbcRecordset & | recordset, |
COdbcWarnings * | odbcWarnings = NULL |
||
) |
Execute the query.
recordset | It is a Recordset object that is received after query execution. |
PROUDSRV_API void Proud::COdbcCommand::Prepare | ( | COdbcConnection & | conn, |
const String & | query | ||
) |
It is used when inputting a query. Input the query as ?. (ex> INSERT INTO test(id, name) VALUES(?, ?)). Table name and field name cannot be inputted as ?.
conn | COdbcConnection Object |
query | Query |
PROUDSRV_API void Proud::COdbcCommand::SetNullParameter | ( | unsigned int | paramIndex, |
bool | state | ||
) |
Set a parameter as NULL. In case you want to input data as NULL in the database, change the status of NULL to TRUE by using this function. Once setting is done, the status is continuously used, so in case of restring the status, you must reset it as FALSE after execution.
paramIndex | parameter Index (ex> 1, 2, 3, ...) |
state | true or false |