DB Link
API Reference Guide
Product Documentation:

Visualization DB Link
Documentation Home
List of all members | Public Member Functions
IldAppDescriptor Class Reference

Instances of the class IldAppDescriptor hold the description of a column or a parameter, the size of the data buffer, and the addresses of the data and null indicator buffers. More...

#include <ildblink/ildtuple.h>

Inheritance diagram for IldAppDescriptor:
IldDescriptor

Public Member Functions

IlUInt getBufferSize () const
 Get the maximum size of the values. More...
 
short * getNulls () const
 Get the null indicators buffer. More...
 
char * getValue (IlUInt r=0) const
 Get the value buffer. More...
 
IlBoolean isExtNulls () const
 Tell if the null indicators buffer is externally allocated. More...
 
IlBoolean isExtValue () const
 Tell if the buffer is externally managed. More...
 
void setBufferSize (IlUInt size)
 Set the actual size of the values buffer. More...
 
void setNulls (short *nulls, IlBoolean ext=IlFalse)
 Change the null-indicators buffer of the descriptor. More...
 
void setValue (char *v, IlBoolean ext=IlFalse)
 Change the data buffer of the descriptor. More...
 
- Public Member Functions inherited from IldDescriptor
IldADTDescriptorgetADTDescriptor () const
 Get the abstract data type descriptor. More...
 
const char * getName () const
 Get the name of the described object. More...
 
short getPrecision () const
 Get the precision of the described object. More...
 
short getScale () const
 Get the scale of the described object. More...
 
IlUInt getSize () const
 Get the maximum data size of the described object. More...
 
short getSqlType () const
 Get the SQL type of the decribed object. More...
 
const char * getSqlTypeName () const
 Get the SQL type name of the described object. More...
 
IldColumnType getType () const
 Get the type of the described object. More...
 
IlBoolean isNullable () const
 Indicates whether or not the column can contain values that are NULL in the RDBMS sense.
 

Detailed Description

Instances of the class IldAppDescriptor hold the description of a column or a parameter, the size of the data buffer, and the addresses of the data and null indicator buffers.

Library: dbkernel

The descriptors of a result set are built during the parse step if the statement is prepared, or during the execute step if the statement is executed immediately (see the member functions IldRequest::parse and IldRequest::execute).

The descriptors of a parameters set are built at bind time for RDBMSs that do not have the "describe parameter" capability, and at prepare time for the other RDBMSs (see the member functions IldRequest::bindParam and IldRequest::parse).

See also
IldDescriptor, IldRequest

Member Function Documentation

◆ getBufferSize()

IlUInt IldAppDescriptor::getBufferSize ( ) const

Get the maximum size of the values.

Returns
The size of the values buffer in bytes.
Note
Right after creation of the instance, the buffer is not allocated, thus its size is 0.

◆ getNulls()

short * IldAppDescriptor::getNulls ( ) const

Get the null indicators buffer.

Returns
The current null-indicators buffer.
Note
Right after creation of the instance, the nulls buffer is not allocated.

◆ getValue()

char* IldAppDescriptor::getValue ( IlUInt  r = 0) const

Get the value buffer.

Parameters
rThe row index.
Returns
The value buffer corresponding to the row r in the rows set.
Note
The given row index is not checked by this function. It is the application responsibility to ensure this index is smaller that the number of rows in the column or parameter set.
See also
IldRequest::getColArraySize, IldRequest::getParamArraySize.

◆ isExtNulls()

IlBoolean IldAppDescriptor::isExtNulls ( ) const

Tell if the null indicators buffer is externally allocated.

Returns
IlFalse if the null-indicators buffer was allocated by DB Link, or IlTrue if the buffer was allocated by an external application.
Note
Right after creation of the instance, the nulls buffer is not allocated, thus is considered as externally allocated.

◆ isExtValue()

IlBoolean IldAppDescriptor::isExtValue ( ) const

Tell if the buffer is externally managed.

Returns
IlFalse if the values buffer was allocated by DB Link, or IlTrue if the buffer was allocated by an external application.
Note
Right after creation of the instance, the buffer is not allocated and thus is considered as been externally allocated.

◆ setBufferSize()

void IldAppDescriptor::setBufferSize ( IlUInt  size)

Set the actual size of the values buffer.

Parameters
sizeThe maximum size, in bytes, of the data for one value.

The application must ensure that the parameter size is not smaller than the actual size of the buffer. While this function will accept such a value, the error ILD_BAD_VARIABLE_SIZE could be raised at bind time.

If the buffer size is changed after bindings have been processed or in between fetches, the behavior of the application is unpredictable.

Warning
Never use this function once the buffer is allocated by DB Link.
See also
IldRequest::bindCol, IldRequest::bindParam.

◆ setNulls()

void IldAppDescriptor::setNulls ( short *  nulls,
IlBoolean  ext = IlFalse 
)

Change the null-indicators buffer of the descriptor.

Parameters
nullsThe new null indicators buffer.
extOptionally, is the buffer externally managed or managed by DB Link.

The second argument ext specifies the owner of the allocated buffer as follows:

  • If the buffer was allocated by DB Link, its value is IlFalse,
  • If the buffer was allocated by the application, its value is IlTrue. In this case, the buffer will not be deleted by DB Link when requests are cleaned up or deleted.

◆ setValue()

void IldAppDescriptor::setValue ( char *  v,
IlBoolean  ext = IlFalse 
)

Change the data buffer of the descriptor.

Parameters
vThe new buffer to be used to store data.
extOptionally, is the buffer externally managed or managed by DB Link.

The second argument ext specifies the owner of the allocated buffer as follows:

  • If the buffer was allocated by DB Link, its value is IlFalse.
  • If the buffer was allocated by the application, its value is IlTrue. In this case, the buffer will not be deleted by DB Link when requests are cleaned up or deleted.