rwlogo

Rogue Wave DBLink API Reference Guide

Product Documentation:

Rogue Wave DBLink
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 fo 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

IlUInt IldAppDescriptor::getBufferSize ( ) const

Get the maximum size fo the values.

Returns
The size of the values buffer.
Note
Right after creation of the instance, the buffer is not allocated, thus its size is 0.
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.
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.
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.
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.
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.
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.
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.

© Copyright 2014, Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave is a registered trademark of Rogue Wave Software, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.