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::TypeInfo Class Reference

Provides type information on Oracle Database objects. More...

#include <types.hpp>

Inherits ocilib::core::HandleHolder< OCI_TypeInfo * >.

Public Types

enum  TypeInfoTypeValues { Table = OCI_TIF_TABLE , View = OCI_TIF_VIEW , Type = OCI_TIF_TYPE }
 Type of object information enumerated values. More...
 
typedef core::Enum< TypeInfoTypeValuesTypeInfoType
 Type of object information.
 

Public Member Functions

 TypeInfo (const Connection &connection, const ostring &name, TypeInfoType type)
 Parametrized constructor.
 
TypeInfoType GetType () const
 Return the type of the given TypeInfo object.
 
ostring GetName () const
 Return the type info name.
 
Connection GetConnection () const
 Return the connection associated with a statement.
 
unsigned int GetColumnCount () const
 Return the number of columns contained in the type.
 
Column GetColumn (unsigned int index) const
 Return the column from its index in the resultset.
 
boolean IsFinalType () const
 Indicate if the given UDT type is final.
 
TypeInfo GetSuperType () const
 Return the super type of the given type (e.g. parent type for a derived ORACLE UDT type)
 

Detailed Description

Provides type information on Oracle Database objects.

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

Definition at line 4527 of file types.hpp.

Member Typedef Documentation

◆ TypeInfoType

Type of object information.

Possible values are TypeInfo::TypeInfoTypeValues

Definition at line 4558 of file types.hpp.

Member Enumeration Documentation

◆ TypeInfoTypeValues

Type of object information enumerated values.

Enumerator
Table 

Database Table information

View 

Database View information

Type 

Database type information

Definition at line 4541 of file types.hpp.

Constructor & Destructor Documentation

◆ TypeInfo()

ocilib::TypeInfo::TypeInfo ( const Connection connection,
const ostring name,
TypeInfoType  type 
)
inline

Parametrized constructor.

Parameters
connection- Parent connection
name- Type name
type- Kind of type to retrieve
Note
the TypeInfo object must not be accessed anymore once the parent connection object gets out of scope

Definition at line 28 of file TypeInfo.hpp.

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

Member Function Documentation

◆ GetType()

TypeInfo::TypeInfoType ocilib::TypeInfo::GetType ( ) const
inline

Return the type of the given TypeInfo object.

Definition at line 42 of file TypeInfo.hpp.

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

◆ GetName()

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

Return the type info name.

Definition at line 47 of file TypeInfo.hpp.

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

◆ GetConnection()

◆ GetColumnCount()

unsigned int ocilib::TypeInfo::GetColumnCount ( ) const
inline

Return the number of columns contained in the type.

Note
  • For table and views, it is the number of columns
  • For types, it is the number of member properties

Definition at line 61 of file TypeInfo.hpp.

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

◆ GetColumn()

Column ocilib::TypeInfo::GetColumn ( unsigned int  index) const
inline

Return the column from its index in the resultset.

Parameters
index- Column index
Note
Column position starts at 1.
  • For table and views, the returned column object describes a table/view column
  • For types, the returned column object describes an object property

Definition at line 66 of file TypeInfo.hpp.

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

◆ IsFinalType()

boolean ocilib::TypeInfo::IsFinalType ( ) const
inline

Indicate if the given UDT type is final.

Note
Non-final types are virtual UDT type that can be inherited
Returns
  • For table and views, it returns true
  • For types, it returns true if the type is final and false if it is virtual

Definition at line 71 of file TypeInfo.hpp.

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

◆ GetSuperType()

TypeInfo ocilib::TypeInfo::GetSuperType ( ) const
inline

Return the super type of the given type (e.g. parent type for a derived ORACLE UDT type)

Note
This property is only valid for types
Returns
  • For table and views, it return a null TypeInfo object
  • For types:
    • returns a valid TypeInfo object wrapping the parent super type
    • returns a null TypeInfo object if the given type is NOT deriving from a base type

Definition at line 76 of file TypeInfo.hpp.

References ocilib::core::Check(), GetConnection(), and OCI_TypeInfoGetSuperType().