ocilib::BindInfo Class Reference

Provides SQL bind informations. More...

`#include <ocilib.hpp>`

Inherits ocilib::HandleHolder< OCI_Bind *>.

## Public Types

enum | BindDirectionValues { In = OCI_BDM_IN, Out = OCI_BDM_OUT, InOut = OCI_BDM_IN_OUT }
| Bind direction enumerated values. More...
typedef Enum< BindDirectionValues > | BindDirection
| Bind direction. More...

## Public Member Functions

ostring | GetName () const
| Return the name of the bind object.
DataType | GetType () const
| Return the OCILIB type of the data associated with the bind object.
unsigned int | GetSubType () const
| Return the OCILIB object subtype of a column. More...
unsigned int | GetDataCount () const
| Return the number of elements associated with the bind object. More...
Statement | GetStatement () const
| Return the statement associated with the bind object.
void | SetDataNull (bool value, unsigned int index=1)
| Mark as null or not null the current bind real value(s) used in SQL statements. More...
bool | IsDataNull (unsigned int index=1) const
| Check if the current bind value(s) used in SQL statements is marked as NULL. More...
void | SetCharsetForm (CharsetForm value)
| Set the charset form of the given character based bind object. More...
BindDirection | GetDirection () const
| Get the direction mode.

## Detailed Description

Provides SQL bind informations.

This class wraps the OCILIB object handle OCI_Bind and its related methods

Definition at line 5321 of file ocilib.hpp.

## Member Typedef Documentation

## BindDirection

typedef Enum<BindDirectionValues> ocilib::BindInfo::BindDirection

Bind direction.

Possible values are BindInfo::BindDirectionValues

Definition at line 5349 of file ocilib.hpp.

## Member Enumeration Documentation

## BindDirectionValues

enum ocilib::BindInfo::BindDirectionValues

Bind direction enumerated values.

Enumerator
In | Input bind variable (will be not modified as it is an input value for the server)
Out | Output bind variable (will be modified as it is an output value by the server )
InOut | Input / Output bind variable (can be modified as it is an input value that can be modified by the server)

Definition at line 5332 of file ocilib.hpp.

## Member Function Documentation

## GetSubType()

unsigned int ocilib::BindInfo::GetSubType | ( |  | ) | const

inline

Return the OCILIB object subtype of a column.

Note
  This call is valid for the following OCILIB types:
  - Scalar numeric types
  - Clong and Blong
  - Clob, NClob and Blob
  - File
  - Timestamp
  - Interval

Warning
  - The returned values must be casted to the matching C++ class GetType() property type.
  - For scalar numeric types, returned value must be casted to ocilib::NumericType.
  - For a non valid type, it returns 0.

Definition at line 4893 of file ocilib_impl.hpp.

References ocilib::Check(), and OCI_BindGetSubtype().

## GetDataCount()

unsigned int ocilib::BindInfo::GetDataCount | ( |  | ) | const

inline

Return the number of elements associated with the bind object.

Returns
  - For single binds, it returns 1
  - For vector binds, it returns the number of element in the bind array

Definition at line 4898 of file ocilib_impl.hpp.

References ocilib::Check(), and OCI_BindGetDataCount().

## SetDataNull()

void ocilib::BindInfo::SetDataNull | ( | bool | value,
|  | unsigned int | index = `1`
| ) |  |

inline

Mark as null or not null the current bind real value(s) used in SQL statements.

Parameters

  value | - null status value
  index | - Only valid for vectors : index of the element to check

Note
  There is no notion of null value in C C++ for scalar types. It's necessary to explicitly tell Oracle that the bind has a null value. It must be done before an Execute() call

Warning
  For handled based data types (non scalar types), OCILIB performs an extra check on handles and set the bind status to null is the handle is null
  Index starts with 1

Definition at line 4908 of file ocilib_impl.hpp.

References ocilib::Check(), OCI_BindSetNotNullAtPos(), and OCI_BindSetNullAtPos().

## IsDataNull()

bool ocilib::BindInfo::IsDataNull | ( | unsigned int | index = `1` | ) | const

inline

Check if the current bind value(s) used in SQL statements is marked as NULL.

Parameters

  index | - Only valid for vectors : index of the element to check

Note
  If the bind is related to a single host variable, don't use the parameter index If the bind is related to host vectors, the parameter 'index' refers to the index in the vector

Warning
  Index starts with 1

Definition at line 4920 of file ocilib_impl.hpp.

References ocilib::Check(), and OCI_BindIsNullAtPos().

## SetCharsetForm()

void ocilib::BindInfo::SetCharsetForm | ( | CharsetForm | value | ) |

inline

Set the charset form of the given character based bind object.

Parameters

  value | - charset form

Note
  This call has to be made after Statement::Prepare() but before Statement::Execute()

Warning
  This call does nothing the bind data type is not ocilib::TypeString or ocilib::TypeLong

Definition at line 4925 of file ocilib_impl.hpp.

References ocilib::Check(), and OCI_BindSetCharsetForm().