OCILIB (C and C++ Driver for Oracle)  4.7.5
Open source and cross platform Oracle Driver delivering efficient access to Oracle databases.
Loading...
Searching...
No Matches
ocilib::BindInfo Class Reference

Provides SQL bind information. More...

#include <types.hpp>

Inherits ocilib::core::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...
 
enum  VectorTypeValues { AsArray = 1 , AsPlSqlTable = 2 }
 Vector type values. More...
 
typedef core::Enum< BindDirectionValuesBindDirection
 Bind direction.
 
typedef core::Enum< VectorTypeValuesVectorType
 Vector type.
 

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.
 
unsigned int GetDataCount () const
 Return the number of elements associated with the bind object.
 
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.
 
bool IsDataNull (unsigned int index=1) const
 Check if the current bind value(s) used in SQL statements is marked as NULL.
 
void SetCharsetForm (CharsetForm value)
 Set the charset form of the given character based bind object.
 
BindDirection GetDirection () const
 Get the direction mode.
 

Detailed Description

Provides SQL bind information.

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

Definition at line 5378 of file types.hpp.

Member Typedef Documentation

◆ BindDirection

Bind direction.

Possible values are BindInfo::BindDirectionValues

Definition at line 5406 of file types.hpp.

◆ VectorType

Vector type.

Possible values are BindInfo::VectorTypeValues

Definition at line 5428 of file types.hpp.

Member Enumeration Documentation

◆ 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 5389 of file types.hpp.

◆ VectorTypeValues

Vector type values.

Enumerator
AsArray 

Vector is binded as an array in a regular DML array operation

AsPlSqlTable 

Vector is binded as a PL/SQL index by table

Definition at line 5413 of file types.hpp.

Member Function Documentation

◆ GetName()

ostring ocilib::BindInfo::GetName ( ) const
inline

Return the name of the bind object.

Definition at line 33 of file BindInfo.hpp.

References ocilib::core::Check(), ocilib::core::MakeString(), and OCI_BindGetName().

◆ GetType()

DataType ocilib::BindInfo::GetType ( ) const
inline

Return the OCILIB type of the data associated with the bind object.

Definition at line 38 of file BindInfo.hpp.

References ocilib::core::Check(), and OCI_BindGetType().

◆ 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:
Warning
  • Cast returned values to the matching C++ class GetType() property type.
  • For scalar numeric types, cast returned value to ocilib::NumericType values.
  • For a non valid type, it returns 0.

Definition at line 43 of file BindInfo.hpp.

References ocilib::core::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 48 of file BindInfo.hpp.

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

◆ GetStatement()

Statement ocilib::BindInfo::GetStatement ( ) const
inline

Return the statement associated with the bind object.

Definition at line 53 of file BindInfo.hpp.

References ocilib::core::Check(), and OCI_BindGetStatement().

◆ 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 58 of file BindInfo.hpp.

References ocilib::core::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 70 of file BindInfo.hpp.

References ocilib::core::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 75 of file BindInfo.hpp.

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

◆ GetDirection()

BindInfo::BindDirection ocilib::BindInfo::GetDirection ( ) const
inline

Get the direction mode.

Definition at line 80 of file BindInfo.hpp.

References ocilib::core::Check(), and OCI_BindGetDirection().