Symbian Developer Library

SYMBIAN OS V6.1 EDITION FOR C++

[Index] [Glossary] [Previous] [Next]



Location: d32dbms.h
Link against: edbms.lib

Class TDbCol

TDbCol

Support

Supported from 5.0

Description

Defines a column in a table or rowset. The data members are public because this is really a structure to group the attributes of the column together.

Three non-default constructors are provided for convenience.

Defined in TDbCol:
Anonymous, EAutoIncrement, ENotNull, IsLong(), TDbCol(), iAttributes, iMaxLength, iName, iType


Construction


TDbCol()

TDbCol();

Description

Constructs an uninitialised TDbCol. It is necessary because there are also non-default constructors in this class.


TDbCol()

TDbCol(const TDesC& aName);
TDbCol(const TDesC& aName,TDbColType aType);
TDbCol(const TDesC& aName,TDbColType aType,TInt aMaxLength);

Description

Constructs a TDbCol with the given name, optional type and optional maximum length.

Note:

Parameters

const TDesC& aName

The column name.

TDbColType aType

The column type.

TInt aMaxLength

If present, this specifies a limit on how many characters may be stored in a Text column, or how many bytes can be stored in a Binary column. By default this is set to KDbDefaultTextColLength for Text (but not LongText) columns and KDbUndefinedLength for other columns.

[Top]


Utility functions


IsLong()

inline TBool IsLong(TDbColType aType);

Description

Tests if a column is of the Long column type, i.e. one of the EDbColLongXxxx types.

Parameters

TDbColType aType

The column type to test.

Return value

TBool

True if the aType is a Long column type, false otherwise.

[Top]


Data members

Description

All the data members are public:


iAttributes

TUint iAttributes

Description

A set of flags describing other column attributes. This must be one of the anonymous enum values ENotNull or EAutoIncrement.


iMaxLength

TInt iMaxLength

Description

The maximum length of data that can be stored in a Text or Binary column.


iName

TDbColNameC iName

Description

The column name.


iType

TDbColType iType

Description

The column type.

[Top]


Enumerations


Enum Anonymous

Anonymous

Description

ENotNull

A flag in the iAttributes member which indicates that the column cannot be Null.

EAutoIncrement

A flag in the iAttributes member which indicates that this column should be assigned an automatically incremented value in any row inserted into the table. Such columns can be used to generate a unique key for the table.