Unicorn XML Toolkit
Version 1.00.00

Namespace Sql
Class CParamDescr

class CParamDescr {
public:
    enum {
        sqlBigint,
        sqlBinary,
        sqlBit,
        sqlChar,
        sqlDate,
        sqlDecimal,
        sqlDouble,
        sqlFloat,
        sqlInteger,
        sqlLongvarbinary,
        sqlLongvarchar,
        sqlNumeric,
        sqlReal,
        sqlSmallint,
        sqlTime,
        sqlTimestamp,
        sqlTinyint,
        sqlVarbinary,
        sqlVarchar
        };
public:
    CParamDescr();
    ~CParamDescr();
public:
    void RemoveAll();
    void AddParam(int nType, int nPrecision, int nScale);
    int GetParamCount() const;
    int GetType(int nIndex) const;
    int GetPrecision(int nIndex) const;
    int GetScale(int nIndex) const;
    };

The list of parameter descriptions.

Instances of this class are used to describe parameters required by parametrized SQL statements. Each list is an ordered sequence of parameter descriptions. Each parameter description provides specification for SQL data type, precision and scale.

SQL data types are represented as integer codes. Allowed values are specified by the anonymous enumeration contained in this class declaration.

The precision of a numeric parameter is the maximum number of digits used by the data type of the parameter. The precision of a non-numeric parameter is the maximum length of the parameter.

The scale of the fixed numeric parameter is the maximum number of digits to the right side of the decimal point. The parameter is considered to be a fixed point numeric, if it has the numeric type other than typeReal , typeFloat , or typeDouble . The scale is not applicable to parameters which are not fixed numeric; in such cases the scale must be set to 0 .

Since:
1.00.00
Version:
1.00.00
Author:
Alexey Gokhberg
Constructor/Destructor Summary
CParamDescr ();
����������Constructs the parameter description list.
~CParamDescr ();
����������Destroys the parameter description list.

Function Summary
void RemoveAll ();
����������Clears this parameter description list, removing all descriptions.
void AddParam (int nType, int nPrecision, int nScale);
����������Adds a parameter description to the end of this list.
int GetParamCount () const;
����������Returns the number of parameter descriptions in this list.
int GetType (int nIndex) const;
����������Returns the type assigned to the parameter description at the specified index.
int GetPrecision (int nIndex) const;
����������Returns the precision assigned to the parameter description at the specified index.
int GetScale (int nIndex) const;
����������Returns the scale assigned to the parameter description at the specified index.

Constructor/Destructor Detail

CParamDescr

CParamDescr();

Constructs the parameter description list.

~CParamDescr

~CParamDescr();

Destroys the parameter description list.

Function Detail

RemoveAll

void RemoveAll();

Clears this parameter description list, removing all descriptions.

AddParam

void AddParam(int nType, int nPrecision, int nScale);

Adds a parameter description to the end of this list.

Parameters:
nType - the type of the parameter
nPrecision - the precision of the parameter
nScale - the scale of the parameter

GetParamCount

int GetParamCount() const;

Returns the number of parameter descriptions in this list.

Returns:
the number of parameter descriptions in this list

GetType

int GetType(int nIndex) const;

Returns the type assigned to the parameter description at the specified index.

Parameters:
nIndex - the index (zero-based)
Returns:
the type assigned to the parameter description at the specified index

GetPrecision

int GetPrecision(int nIndex) const;

Returns the precision assigned to the parameter description at the specified index.

Parameters:
nIndex - the index (zero-based)
Returns:
the precision assigned to the parameter description at the specified index

GetScale

int GetScale(int nIndex) const;

Returns the scale assigned to the parameter description at the specified index.

Parameters:
nIndex - the index (zero-based)
Returns:
the scale assigned to the parameter description at the specified index

Unicorn XML Toolkit
Version 1.00.00


This document was created using Unicorn DOC++.

Copyright 1999-2001 Unicorn Enterprises SA.
All Rights Reserved.