Collection Contents Previous Next PDF

UltraLite.NET User's Guide

iAnywhere.UltraLite namespace

SQLType enumeration


Enumerates the available UltraLite SQL database types used as table column types.

Prototypes 

' Visual Basic
Public Enum SQLType

// C#
public enum SQLType

Remarks 

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.[external link] Byte[], or System.[external link] Guid if size is 16 byte[] Byte()
BIT System.[external link] Boolean bool Boolean
CHAR System.[external link] String String String
DATE System.[external link] DateTime DateTime No built-in type. Date
DOUBLE System.[external link] Double double Double
LONGBINARY System.[external link] Byte[] byte[] Byte()
LONGVARCHAR System.[external link] String String String
NUMERIC System.[external link] String String String
REAL System.[external link] Single float Single
S_BIG System.[external link] Int64 long Long
S_LONG System.[external link] Int32 int Integer
S_SHORT System.[external link] Int16 short Short
TIME System.[external link] TimeSpan TimeSpan No built-in type. TimeSpan No built-in type.
TIMESTAMP System.[external link] DateTime DateTime No built-in type. Date
TINY System.[external link] Byte byte Byte
U_BIG System.[external link] UInt64 ulong UInt64 No built-in type.
U_LONG System.[external link] UInt32 uint UInt32 No built-in type.
U_SHORT System.[external link] UInt16 ushort UInt16 No built-in type.
UUID System.[external link] Guid Guid No built-in type. Guid No built-in type.

BINARY columns of length 16 are sometimes referred to as UUID columns.

Members 
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.

Collection Contents Previous Next PDF