Database.DataType
Description
A class that enumerates various database storage types.
This class' enumerations are used in binding parameters in a Database.PreparedStatement.
statement.bindParam(1, myValue, Database.DataType.SmallInt);
This set of available values corresponds closely with the ANSI standard SQL language's set of supported database storage types.
Methods
fromString | Gets the data type value associated with the name of a storage type. |
Static Properties
BigInt | A 64-bit integer. |
Bool | A boolean 0 or 1 value. |
Char | A fixed length string. |
Date | A date value. |
DateTime | A date-time value. |
Decimal | A decimal value. |
Double | A double precision floating point value. |
Float | A variable precision floating point value. |
Int | A 32-bit integer generally 32-bit. |
Interval | A time interval value. |
NChar | A fixed length unicode string. |
Numeric | A numeric value. |
NVarChar | A variable length unicode string. |
Real | A 32-bit floating point value. |
SmallInt | A 16-bit integer. |
Text | A variable length string. |
Time | A time value. |
Unknown | An unknown data type. |
VarChar | A variable length string. |
Details
Database.DataType.fromString()
int fromString( string typeName ) |
Returns
int | The data type value for the given name. |
Description
Gets the data type value associated with the name of a storage type.
This can be used if you are querying the information schema of a database. In information schemas, field storage types are stored as strings such as "varchar" or "smallint". This method will interpret such a string an return the enumeration type value associated with it.
Database.DataType.Double
static readonly int Double
Description
A double precision floating point value.
Database.DataType.Float
static readonly int Float
Description
A variable precision floating point value.
Database.DataType.NVarChar
static readonly int NVarChar
Description
A variable length unicode string.