Harlinn.Windows 0.1
Loading...
Searching...
No Matches
Harlinn::OCI::BindBase Class Reference

BindBase, base class for binds. More...

#include <HOCI.h>

Inheritance diagram for Harlinn::OCI::BindBase:
[legend]
Collaboration diagram for Harlinn::OCI::BindBase:
[legend]

Public Member Functions

 BindBase (const OCI::Statement &statement)
 
 BindBase (const OCI::Statement &statement, UInt32 position)
 
 BindBase (const OCI::Statement &statement, const WideString &name)
 
const OCI::EnvironmentEnvironment () const
 
const OCI::ErrorHandleError () const noexcept final override
 Provides access to the OCIError that will be used for OCI calls for this object.
 
HO_EXPORT void BindByPos (UInt32 positon, OraType dataType, void *dataAddress, Int64 dataSize, Int16 *indicators, UInt32 *actualLengths=nullptr, UInt16 *returnCodes=nullptr, UInt32 plsqlMaxArrayLength=0, UInt32 *plsqlArrayLength=nullptr, UInt32 mode=0)
 
HO_EXPORT void BindByName (const WideString &name, OraType dataType, void *dataAddress, Int64 dataSize, Int16 *indicators, UInt32 *actualLengths=nullptr, UInt16 *returnCodes=nullptr, UInt32 plsqlMaxArrayLength=0, UInt32 *plsqlArrayLength=nullptr, UInt32 mode=0)
 
void OnExecute (UInt32 iters)
 
constexpr const OCI::StatementStatement () const
 
const OCI::ServiceContextServiceContext () const
 
UInt32 Position () const
 
void SetPosition (UInt32 position)
 
bool IsBindByPosition () const
 
const WideStringName () const
 
WideString Name ()
 
void SetName (const WideString &name)
 
void SetCharCount (UInt32 charCount)
 Sets the number of characters in character type data. (OCI_ATTR_CHAR_COUNT)
 
void SetMaxCharSize (Int32 maxCharSize)
 Sets the number of characters that an application reserves on the server to store the data being bound.
 
void SetMaxDataSize (Int32 maxDataSize)
 Sets the maximum number of bytes allowed in the buffer on the server side to accommodate client-side bind data after character set conversions.
 
UInt32 CollationId () const
 Retrieves the derived collation of a placeholder expression corresponding to this bind handle in a SQL statement. The value is relevant only for bind variables with character data types.
 
void SetCollationId (UInt32 collationId) const
 Sets the derived collation of a placeholder expression corresponding to this bind handle in a SQL statement.The attribute is relevant only for bind variables with character data types.
 
UInt16 CharacterSet () const
 Retrives the character set ID of the bind handle.
 
void SetCharacterSet (UInt16 characterSetId) const
 Sets the character set ID of the bind handle.
 
OCI::CharacterSetForm CharacterSetForm () const
 Character set form of the bind handle.The default form is OCI::CharacterSetForm::Implicit.Setting this attribute causes the bind handle to use the database or national character set on the client side.Set this attribute to OCI::CharacterSetForm::NChar for the national character set or OCI::CharacterSetForm::Implicit for the database character set.
 
void SetCharacterSetForm (OCI::CharacterSetForm charsetForm)
 
UInt32 RowsReturned () const
 Returns the number of rows that will be returned in the current iteration when you are in the OUT callback function for binding a DML statement with a RETURNING clause. (OCI_ATTR_ROWS_RETURNED)
 
- Public Member Functions inherited from Harlinn::OCI::HandleBase
constexpr void * Handle () const noexcept
 Provides access to the value of the handle object.
 
constexpr operator bool () const noexcept
 Test if the handle value is assigned.
 
constexpr bool IsValid () const noexcept
 Test if the handle value is assigned.
 
constexpr OCI::HandleType HandleType () const noexcept
 Returns a value identifying the type of the wrapped handle object.
 

Protected Member Functions

 BindBase () noexcept
 
bool IsPlSQL () const
 
virtual HO_EXPORT void Bind (UInt32 positon, UInt32 iters)
 
virtual HO_EXPORT void Bind (const WideString &name, UInt32 iters)
 
- Protected Member Functions inherited from Harlinn::OCI::HandleBase
constexpr HandleBase () noexcept
 Default constructor.
 
constexpr HandleBase (OCI::HandleType handleType, void *handle, bool ownsHandle) noexcept
 Constructs a new HandleBase object.
 
 HandleBase (const HandleBase &other)=delete
 
constexpr HandleBase (HandleBase &&other) noexcept
 Move constructor.
 
virtual ~HandleBase ()
 Destructor.
 
constexpr void SetHandle (void *newHandleValue, bool ownsHandle) noexcept
 Assigns the handle value and ownership to this object.
 
constexpr bool OwnsHandle () const noexcept
 Returns true if this object is the owner of the handle value.
 
void * DetachHandle ()
 If this object is the owner of a handle this function rescinds that ownership, and returns the handle value without closing the handle.
 
void DestroyHandle ()
 Destroys the handle if it is owned by this object.
 
HandleBaseoperator= (const HandleBase &other)=delete
 
constexpr HandleBaseoperator= (HandleBase &&other) noexcept
 
constexpr void swap (HandleBase &other) noexcept
 
template<typename Derived >
constexpr void Take (Derived &&derived) noexcept
 Template function used to implement move assignement in derived classes.
 
void InitializeHandle (void *handle, bool ownsHandle)
 Provides a "safe" mechanism for assigning a handle value. This functions throws if a handle value is already assigned to this object.
 
HO_EXPORT Int32 GetAttribute (void *buffer, UInt32 *size, Attribute attribute) const
 Gets the value of an attribute from the handle.
 
HO_EXPORT Int32 SetAttribute (void *buffer, UInt32 size, Attribute attribute) const
 Sets the value of an attribute on the handle.
 
DateTime GetDateTimeAttribute (Attribute attribute) const
 Gets the value of an attribute from the handle as a DateTime.
 
void SetDateTimeAttribute (Attribute attribute, const DateTime &value) const
 Sets the value of an attribute on the handle as a DateTime.
 
template<WideStringLike StringT = WideString>
StringT GetStringAttribute (Attribute attribute) const
 Gets the value of an attribute from the handle as a WideString.
 
template<WideStringLike StringT = WideString>
StringT GetStringAttributeFromByteString (Attribute attribute) const
 Gets the value of an attribute from the handle as a WideString For use with attributes that are not returned as UTF-16.
 
template<WideStringLike StringT>
void SetStringAttribute (Attribute attribute, const StringT &value) const
 Sets the value of an attribute on the handle as a WideString.
 
void SetStringAttribute (Attribute attribute, const wchar_t *value, size_t valueLength) const
 
bool GetBooleanAttribute (Attribute attribute) const
 Gets the value of an attribute from the handle as a bool.
 
void SetBooleanAttribute (Attribute attribute, bool value) const
 Sets the value of an attribute on the handle as a bool.
 
Byte GetByteAttribute (Attribute attribute) const
 Gets the value of an attribute from the handle as a Byte.
 
void SetByteAttribute (Attribute attribute, Byte value) const
 Sets the value of an attribute on the handle as a Byte.
 
SByte GetSByteAttribute (Attribute attribute) const
 Gets the value of an attribute from the handle as a SByte.
 
void SetSByteAttribute (Attribute attribute, SByte value) const
 Sets the value of an attribute on the handle as a Byte.
 
Int16 GetInt16Attribute (Attribute attribute) const
 Gets the value of an attribute from the handle as an Int16.
 
void SetInt16Attribute (Attribute attribute, Int16 value) const
 Sets the value of an attribute on the handle as an Int16.
 
UInt16 GetUInt16Attribute (Attribute attribute) const
 Gets the value of an attribute from the handle as an UInt16.
 
void SetUInt16Attribute (Attribute attribute, UInt16 value) const
 Sets the value of an attribute on the handle as an UInt16.
 
Int32 GetInt32Attribute (Attribute attribute) const
 Gets the value of an attribute from the handle as an Int32.
 
void SetInt32Attribute (Attribute attribute, Int32 value) const
 Sets the value of an attribute on the handle as an Int32.
 
UInt32 GetUInt32Attribute (Attribute attribute) const
 Gets the value of an attribute from the handle as an UInt32.
 
void SetUInt32Attribute (Attribute attribute, UInt32 value) const
 Sets the value of an attribute on the handle as an UInt32.
 
Int64 GetInt64Attribute (Attribute attribute) const
 Gets the value of an attribute from the handle as an Int64.
 
void SetInt64Attribute (Attribute attribute, Int64 value) const
 Sets the value of an attribute on the handle as an Int64.
 
UInt64 GetUInt64Attribute (Attribute attribute) const
 Gets the value of an attribute from the handle as an UInt64.
 
void SetUInt64Attribute (Attribute attribute, UInt64 value) const
 Sets the value of an attribute on the handle as an UInt64.
 
void * GetPointerAttribute (Attribute attribute) const
 Gets the value of an attribute from the handle as a pointer.
 
void SetPointerAttribute (Attribute attribute, void *value) const
 Sets the value of an attribute on the handle as a pointer.
 
OCI::NumberGetNumberAttribute (Attribute attribute) const
 Gets the value of an attribute from the handle as a pointer to an OCI::Number.
 

Private Types

using Base = HandleBase
 

Private Member Functions

void EnsureStatementIsValid (const OCI::Statement &statement)
 

Private Attributes

OCI::Statementstatement_
 
UInt32 position_
 
WideString name_
 

Friends

class Statement
 

Additional Inherited Members

- Static Protected Member Functions inherited from Harlinn::OCI::HandleBase
static HO_EXPORT void HandleFree (void *handle, OCI::HandleType handleType) noexcept
 Calls OCIHandleFree to release the handle.
 

Detailed Description

BindBase, base class for binds.

Member Typedef Documentation

◆ Base

Constructor & Destructor Documentation

◆ BindBase() [1/4]

Harlinn::OCI::BindBase::BindBase ( )
inlineprotectednoexcept

◆ BindBase() [2/4]

Harlinn::OCI::BindBase::BindBase ( const OCI::Statement & statement)
inline

◆ BindBase() [3/4]

Harlinn::OCI::BindBase::BindBase ( const OCI::Statement & statement,
UInt32 position )
inline

◆ BindBase() [4/4]

Harlinn::OCI::BindBase::BindBase ( const OCI::Statement & statement,
const WideString & name )
inline

Member Function Documentation

◆ Bind() [1/2]

◆ Bind() [2/2]

◆ BindByName()

void Harlinn::OCI::BindBase::BindByName ( const WideString & name,
OraType dataType,
void * dataAddress,
Int64 dataSize,
Int16 * indicators,
UInt32 * actualLengths = nullptr,
UInt16 * returnCodes = nullptr,
UInt32 plsqlMaxArrayLength = 0,
UInt32 * plsqlArrayLength = nullptr,
UInt32 mode = 0 )

◆ BindByPos()

void Harlinn::OCI::BindBase::BindByPos ( UInt32 positon,
OraType dataType,
void * dataAddress,
Int64 dataSize,
Int16 * indicators,
UInt32 * actualLengths = nullptr,
UInt16 * returnCodes = nullptr,
UInt32 plsqlMaxArrayLength = 0,
UInt32 * plsqlArrayLength = nullptr,
UInt32 mode = 0 )

◆ CharacterSet()

UInt16 Harlinn::OCI::BindBase::CharacterSet ( ) const
inline

Retrives the character set ID of the bind handle.

Returns
the character set ID of the bind handle

◆ CharacterSetForm()

OCI::CharacterSetForm Harlinn::OCI::BindBase::CharacterSetForm ( ) const
inline

Character set form of the bind handle.The default form is OCI::CharacterSetForm::Implicit.Setting this attribute causes the bind handle to use the database or national character set on the client side.Set this attribute to OCI::CharacterSetForm::NChar for the national character set or OCI::CharacterSetForm::Implicit for the database character set.

◆ CollationId()

UInt32 Harlinn::OCI::BindBase::CollationId ( ) const
inline

Retrieves the derived collation of a placeholder expression corresponding to this bind handle in a SQL statement. The value is relevant only for bind variables with character data types.

Returns
The collation id

◆ EnsureStatementIsValid()

void Harlinn::OCI::BindBase::EnsureStatementIsValid ( const OCI::Statement & statement)
inlineprivate

◆ Environment()

const OCI::Environment & Harlinn::OCI::BindBase::Environment ( ) const
inline

◆ Error()

const OCI::ErrorHandle & Harlinn::OCI::BindBase::Error ( ) const
inlinefinaloverridevirtualnoexcept

Provides access to the OCIError that will be used for OCI calls for this object.

Returns

Implements Harlinn::OCI::HandleBase.

◆ IsBindByPosition()

bool Harlinn::OCI::BindBase::IsBindByPosition ( ) const
inline

◆ IsPlSQL()

bool Harlinn::OCI::BindBase::IsPlSQL ( ) const
inlineprotected

◆ Name() [1/2]

WideString Harlinn::OCI::BindBase::Name ( )
inline

◆ Name() [2/2]

const WideString & Harlinn::OCI::BindBase::Name ( ) const
inline

◆ OnExecute()

void Harlinn::OCI::BindBase::OnExecute ( UInt32 iters)
inline

◆ Position()

UInt32 Harlinn::OCI::BindBase::Position ( ) const
inline

◆ RowsReturned()

UInt32 Harlinn::OCI::BindBase::RowsReturned ( ) const
inline

Returns the number of rows that will be returned in the current iteration when you are in the OUT callback function for binding a DML statement with a RETURNING clause. (OCI_ATTR_ROWS_RETURNED)

◆ ServiceContext()

const OCI::ServiceContext & Harlinn::OCI::BindBase::ServiceContext ( ) const
inline

◆ SetCharacterSet()

void Harlinn::OCI::BindBase::SetCharacterSet ( UInt16 characterSetId) const
inline

Sets the character set ID of the bind handle.

If SetCharacterSetForm will be called for this handle it must be called before calling SetCharacterSet. Setting the character set ID before setting the character set form causes unexpected results.

Parameters
characterSetIdThe new character set ID for the bind handle

◆ SetCharacterSetForm()

void Harlinn::OCI::BindBase::SetCharacterSetForm ( OCI::CharacterSetForm charsetForm)
inline

◆ SetCharCount()

void Harlinn::OCI::BindBase::SetCharCount ( UInt32 charCount)
inline

Sets the number of characters in character type data. (OCI_ATTR_CHAR_COUNT)

Parameters
charCount

◆ SetCollationId()

void Harlinn::OCI::BindBase::SetCollationId ( UInt32 collationId) const
inline

Sets the derived collation of a placeholder expression corresponding to this bind handle in a SQL statement.The attribute is relevant only for bind variables with character data types.

the collation id can be set on a bind variable handle to any of the supported collation IDs. Collation IDs of both named collations and pseudocollations are allowed. The attribute value is passed to the server with other bind information and the corresponding bind variable reference, formally known as SQL placeholder expression, assumes the provided collation at the coercibility level 0. If the attribute value is Collation::None (the default value), the collation of the bind variable is USING_NLS_COMP at the coercibility level 4. OCI does not check whether the collation is valid for a given data type of a bind variable. If the collation id is set for a non-character data type variable, it is ignored by the server. Collation of bind variables is currently ignored in PL/SQL expressions. For forward compatibility reasons, the collation id should not be set for bind variables passed to an anonymous PL/SQL block, unless the variables are referenced exclusively in SQL statements.

Parameters
collationIdThe collation id

◆ SetMaxCharSize()

void Harlinn::OCI::BindBase::SetMaxCharSize ( Int32 maxCharSize)
inline

Sets the number of characters that an application reserves on the server to store the data being bound.

SetMaxCharSize enables processing to work with data in terms of number of characters, rather than number of bytes. SetMaxCharSize sets the number of characters reserved in the Oracle database to store the bind data. For example, if SetMaxDataSize is with the argument set to 100, and SetMaxCharSize is called with the argument set to 0, then the maximum possible size of the data in the Oracle database after conversion is 100 bytes. However, if SetMaxDataSize iscalled with the argument set to 300, and SetMaxCharSize is with the argument set to 100, then if the character set has 2 bytes/character, the maximum possible allocated size is 200 bytes.

Parameters
maxCharSizecharacter count

◆ SetMaxDataSize()

void Harlinn::OCI::BindBase::SetMaxDataSize ( Int32 maxDataSize)
inline

Sets the maximum number of bytes allowed in the buffer on the server side to accommodate client-side bind data after character set conversions.

Parameters
maxDataSizebyte count

◆ SetName()

void Harlinn::OCI::BindBase::SetName ( const WideString & name)
inline

◆ SetPosition()

void Harlinn::OCI::BindBase::SetPosition ( UInt32 position)
inline

◆ Statement()

const OCI::Statement & Harlinn::OCI::BindBase::Statement ( ) const
inlineconstexpr

Friends And Related Symbol Documentation

◆ Statement

friend class Statement
friend

Member Data Documentation

◆ name_

WideString Harlinn::OCI::BindBase::name_
private

◆ position_

UInt32 Harlinn::OCI::BindBase::position_
private

◆ statement_

OCI::Statement* Harlinn::OCI::BindBase::statement_
private

The documentation for this class was generated from the following files: