Enumerates the available UltraLite SQL database types used as table column types.
' Visual Basic
Public Enum SQLType
// C#
public enum SQLType
The table below lists which .NET types are compatible with each SQL type. In the case of integral types, table columns can always be set using smaller integer types and can be set using larger types as long as the actual value is within the range of the SQL type. For example:
[Visual Basic]
Dim t as iAnywhere.UltraLite.Table
Dim s as Short
...
' Column 1 is of type S_LONG (Equivalent to a .NET 'System.Int32')
t.SetShort( 1, s ) ' will succeed for all values in s
t.SetLong( 1, 10 ) ' (long)10 is ok
t.SetLong( 1, Int32.MaxValue + 1 ) ' throws SQLException
' Column 2 is of type U_SHORT
Dim i as Integer = t.GetInt( 2 ) ' will succeed for all column values
t.SetInt( 2, 0x0ffff ) ' largest valid 'int' column can be set with
t.SetInt( 2, -1 ) ' SQLException
[C#]
Table t;
short s;
...
// Column 1 is of type S_LONG (Equivalent to a .NET 'System.Int32')
t.SetShort( 1, s ); // will succeed for all values in s
t.SetLong( 1, 10 ); // (long)10 is ok
t.SetLong( 1, Int32.MaxValue + 1 ); // throws SQLException
// Column 2 is of type U_SHORT
int i = t.GetInt( 2 ); // will succeed for all column values
t.SetInt( 2, 0x0ffff ); // largest valid 'int' column can be set with
t.SetInt( 2, -1 ); // SQLException
| SQL Type | Compatible .NET Type | C# Built-in Type | Visual Basic Built-in Type |
|---|---|---|---|
| BINARY | System. Byte[], or System. Guid if size is 16 |
byte[] | Byte() |
| BIT | System. Boolean |
bool | Boolean |
| CHAR | System. String |
String | String |
| DATE | System. DateTime |
DateTime No built-in type. | Date |
| DOUBLE | System. Double |
double | Double |
| LONGBINARY | System. Byte[] |
byte[] | Byte() |
| LONGVARCHAR | System. String |
String | String |
| NUMERIC | System. String |
String | String |
| REAL | System. Single |
float | Single |
| S_BIG | System. Int64 |
long | Long |
| S_LONG | System. Int32 |
int | Integer |
| S_SHORT | System. Int16 |
short | Short |
| TIME | System. TimeSpan |
TimeSpan No built-in type. | TimeSpan No built-in type. |
| TIMESTAMP | System. DateTime |
DateTime No built-in type. | Date |
| TINY | System. Byte |
byte | Byte |
| U_BIG | System. UInt64 |
ulong | UInt64 No built-in type. |
| U_LONG | System. UInt32 |
uint | UInt32 No built-in type. |
| U_SHORT | System. UInt16 |
ushort | UInt16 No built-in type. |
| UUID | System. Guid |
Guid No built-in type. | Guid No built-in type. |
BINARY columns of length 16 are sometimes referred to as UUID columns.
| Member | Description |
|---|---|
| BAD_INDEX | Column type returned if bad column indentifier is passed to GetColumnSQLType method. |
| BINARY | Binary data, with a specified length. |
| BIT | 1-bit flag. |
| CHAR | Character data, with a specified length. |
| DATE | Date information. |
| DOUBLE | Double precision floating point number (8 bytes). |
| LONGBINARY | Binary data, with variable length. |
| LONGVARCHAR | Character data, with variable length. |
| NUMERIC | Exact numerical data, with a specified precision and scale. |
| REAL | Single precision floating point number (4 bytes). |
| S_BIG | Signed 64-bit integer. |
| S_LONG | Signed 32-bit integer. |
| S_SHORT | Signed 16-bit integer. |
| TIME | Time information. |
| TIMESTAMP | Timestamp information (date, time). |
| TINY | Unsigned 8-bit integer. |
| U_BIG | Unsigned 64-bit integer. |
| U_LONG | Unsigned 32-bit integer. |
| U_SHORT | Unsigned 16-bit integer. |
| UUID | Universally Unique Identifer. |
SQL Anywhere Studio 9.0.2
Copyright © 1989–2004 Sybase, Inc. Portions copyright © 2001–2004 iAnywhere Solutions, Inc. All rights reserved.