• Delphi与各数据库数据类型比较


    Delphi数据类型与各数据库数据类型对比如下表,如有具体说明见表中脚注:

    Delphi Type

    Oracle Types

    SQL Server Types

    MySQL Types [1]

    InterBase Types

    PostgreSQL Types

    SQLite Types

    ftSmallint

    NUMBER(p, 0)[2] 
    (p < 5)

    SMALLINT

    TINYINT(M) (M > 1)
    SMALLINT

    SMALLINT

    SMALLINT

    TINYINT
    SMALLINT

    ftWord

    -

    TINYINT

    TINYINT(M) UNSIGNED (M > 1)
    SMALLINT UNSIGNED
    YEAR

    -

    -

    -

    ftInteger

    NUMBER(p, 0)[2]
    (4 < p < 10)

    INT

    MEDIUMINT
    MEDIUMINT UNSIGNED
    INT

    INTEGER

    INTEGER

    INTEGER
    INT

    ftLargeint

    NUMBER(p, 0)[2] 
    (9 < p < 19)

    BIGINT

    BIT 
    INT UNSIGNED
    BIGINT
    BIGINT UNSIGNED

    BIGINT

    BIGINT

    BIGINT

    ftFloat

    NUMBER(p, s)[2] 
    BINARY FLOAT(FLOAT)
    BINARY DOUBLE

    DECIMAL(p, s)[3] 
    FLOAT
    REAL

    DECIMAL(p, s)[3] 
    FLOAT
    DOUBLE

    NUMBER(p, s)[3] 
    FLOAT
    DOUBLE PRECISION

    DECIMAL[3] 
    REAL
    DOUBLE PRECISION

    DECIMAL(p, s)[3]
    FLOAT
    DOUBLE PRECISION

    ftBCD

    NUMBER(p, s)[2] 
    (p < 15) and (s < 5)

    DECIMAL(p, s)[3] 
    (p < 15) and (s < 5)

    DECIMAL(p, s)[3] 
    (p < 15) and (s < 5)

    DECIMAL(p, s)[3] 
    (p < 15) and (s < 5)

    DECIMAL[3]

    DECIMAL[3]

    ftFMTBcd

    NUMBER(p, s)[2] 
    (14 < p < 39) and> 
    (4 < s < 39)

    DECIMAL(p, s) 
    (14 < p < 39) and 
    (4 < s < 39)

    DECIMAL(p, s)[3] 
    (14 < p < 39) and
    (4 < s < 39)

    DECIMAL(p, s)[3] 
    (14 < p < 19) and
    (4 < s < 19)

    DECIMAL[3]

    DECIMAL[3]

    ftCurrency

    -

    MONEY
    SMALLMONEY

    -

    -

    MONEY

    MONEY

    ftBoolean

    -

    BIT

    TINYINT[4] 
    BOOL[4] 
    BOOLEAN[4]

    BOOLEAN

    BOOLEAN

    BOOLEAN

    ftString

    VARCHAR2
    NVARCHAR2
    VARCHAR
    CHAR
    NCHAR
    RAW[5] 
    INTERVAL DAY TO SECOND
    INTERVAL DAY TO MONTH
    ROWID
    UROWID

    CHAR
    VARCHAR

    CHAR
    VARCHAR
    ENUM
    SET
    BINARY[6] 
    VARBINARY[6]

    CHAR
    VARCHAR

    CHAR
    VARCHAR

    CHAR
    VARCHAR

    ftWideString

    See note [7]

    NCHAR
    NVARCHAR

    See note [7]

    See note [7]

    See note [7]

    See note [7]

    ftMemo

    LONG
    Also see note [8]

    TEXT
    NTEXT[9]

    TINYTEXT
    TEXT
    MEDIUMTEXT
    LONGTEXT

    BLOB TEXT

    TEXT

    TEXT
    CLOB

    ftWideMemo

    See note[10]

    NTEXT[11]

    See note[10]

    See note[10]

    See note[10]

    See note[10]

    ftOraClob

    CLOB
    NCLOB

    -

    -

    -

    -

    -

    ftBlob

    LONG RAW

    IMAGE

    TINYBLOB
    BLOB
    MEDIUMBLOB
    LONGBLOB
    Spatial Data Types

    BLOB BINARY

    BYTEA

    BLOB

    ftOraBlob

    BLOB

    -

    -

    -

    LARGE OBJECT

    -

    ftBytes

    -

    BINARY
    TIMESTAMP

    BINARY

    -

    -

    -

    ftVarBytes

    RAW

    VARBINARY

    VARBINARY

    CHAR
    VARCHAR
    (CHARSET = OCTETS)

    -

    BINARY
    VARBINARY

    ftDate

    -

    -

    DATE

    DATE

    DATE

    DATE

    ftDateTime

    DATE

    DATE

    DATETIME

    TIMESTAMP

    TIMESTAMP

    TIMESTAMP
    DATETIME

    ftTime

    -

    -

    TIME

    TIME

    TIME

    TIME

    ftTimeStamp

    TIMESTAMP
    TIMESTAMP WITH TIMEZONE

    -

    -

    -

    -

    -

    ftCursor

    REF CURSOR

    -

    -

    -

    REFCURSOR

    -

    ftGuid

    -

    UNIQUEIDENTIFIER

    -

    -

    -

    -

    ftVariant

    -

    SQL_VARIANT

    -

    -

    -

    -

    NOT SUPPORTED

    BFILE
    OBJECT
    XML

    CURSOR
    XML
    TABLE

    -

    -

    -

    -

    [1] – 如果FieldsAsString 选项被设置 True,则除BLOB和TEXT数据类型外,全部做为ftString来处理

    [2] – Oracle NUMBER数据类型与Delphi数据类型对应方式:

    if scale equals zero, provider checks values of the specific options to choose the correct Delphi type in the following order: 

    1.1 field precision is less or equal Precision Smallint (default is 4) - uses ftSmallint;
    1.2 field precision is less or equal Precision Integer (default is 9) - uses ftInteger;
    1.3 field precision is less or equal Precision LargeInt (default is 18) - uses ftLargeint;

    if scale is greater than zero, the appropriate Delphi type is chosen using the following sequence of rules:. 

    2.1 field precision is less or equal PrecisionFloat (default is 0) - uses ftFloat;
    2.2 EnableBCD is True and field precision, scale is less or equal PrecisionBCD (default is 14,4) - uses ftBCD;
    2.3 EnableFMTBCD is True and field precision, scale is less or equal PrecisionFMTBCD (default is 38,38) - uses ftFMTBCD;
    2.4 uses ftFloat.

    [3] - The appropriate Delphi type is chosen using the following sequence of rules:

    EnableBCD is True and field precision, scale is less or equal 14,4 - uses ftBCD; 

    EnableFMTBCD is True - uses ftFMTBCD; 

    uses ftFloat. 

    [4] - If the EnableBoolean option is True

    [5] - If the RawAsString option is True

    [6] - If the BinaryAsString is True

    [7] - If the UseUnicode option is True, all server types mapped to ftString will be mapped to ftWideString.

    [8] - If the LongStrings option is False, and the field length is greater than 255, all server types mapped to ftString will be mapped to ftMemo.

    [9] - For all Delphi versions prior to BDS 2006.

    [10] - If the UseUnicode option is True, in BDS 2006 and later versions all server types mapped to ftMemo will be mapped to ftWideMemo.

    [11] - For BDS 2006 and higher IDE versions.

  • 相关阅读:
    jdk8u144安装在centos7上
    事件对象(示例、封装函数EventUtil())
    事件处理程序
    取消冒泡
    编程挑战JavaScript进阶篇(慕课网题目)
    网页卷去的距离与偏移量
    DOM编程练习(慕课网题目)
    浏览器窗口可视区域大小
    网页尺寸scrollHeight/offsetHeight
    替换元素节点replaceChild()
  • 原文地址:https://www.cnblogs.com/jijm123/p/9291589.html
Copyright © 2020-2023  润新知