ABOUT ME

-

Today
-
Yesterday
-
Total
-
  • C# and Database(SQLite, MySQL, MSSQL, Oracle) data type mapping
    닷넷/C# 2019. 5. 3. 17:49
    반응형

    1. C# vs SQLite:

    C# SQLite
    The field name Type Library type GetFieldType(#) Transformation Remarks
    F_BOOL bool BIT NOT NULL Boolean    
    F_BOOL_NULL bool? BIT Boolean    
    F_SBYTE sbyte INT8 NOT NULL SByte sbyte_  
    F_SBYTE_NULL sbyte? INT8 SByte sbyte_  
    F_BYTE byte UINT8 NOT NULL Byte    
    F_BYTE_NULL byte? UINT8 Byte    
    F_SHORT short INT16 NOT NULL Int16    
    F_SHORT_NULL short? INT16 Int16    
    F_USHORT ushort UINT16 NOT NULL UInt16 ushort_  
    F_USHORT_NULL ushort? UINT16 UInt16 ushort_  
    F_INT int INT32 NOT NULL Int32    
    F_INT_NULL int? INT32 Int32    
    F_UINT uint UINT32 NOT NULL UInt32 uint_  
    F_UINT_NULL uint? UINT32 UInt32 uint_  
    F_LONG long INT64 NOT NULL Int64    
    F_LONG_NULL long? INT64 Int64    
    F_ULONG ulong UINT64 NOT NULL UInt64 ulong_  
    F_ULONG_NULL ulong? UINT64 UInt64 ulong_  
    F_FLOAT float FLOAT NOT NULL Double   Not compatible
    F_FLOAT_NULL float? FLOAT Double   Not compatible
    F_DOUBLE double DOUBLE NOT NULL Double    
    F_DOUBLE_NULL double? DOUBLE Double    
    F_DECIMAL decimal DECIMAL NOT NULL Decimal   Access is not a: <F_DECIMAL>: [-79228162514264300000000000000] != [-79228162514264337593543950335]
    F_DECIMAL_NULL decimal? DECIMAL Decimal   Access is not a: <F_DECIMAL>: [-79228162514264300000000000000] != [-79228162514264337593543950335]
    F_CHAR char TEXT NOT NULL String    
    F_CHAR_NULL char? TEXT String    
    F_STRING string TEXT NOT NULL String    
    F_STRING_NULL string TEXT String    
    F_DATETIME DateTime TEXT NOT NULL String    
    F_DATETIME_NULL DateTime? TEXT String    


    2. C# vs MySQL:

    C# MySQL
    The field name Type Library type GetFieldType(#) Transformation Remarks
    F_BOOL bool BOOL NOT NULL Boolean    
    F_BOOL_NULL bool? BOOL NULL Boolean    
    F_SBYTE sbyte TINYINT NOT NULL SByte sbyte_  
    F_SBYTE_NULL sbyte? TINYINT NULL SByte sbyte_  
    F_BYTE byte TINYINT UNSIGNED NOT NULL Byte    
    F_BYTE_NULL byte? TINYINT UNSIGNED NULL Byte    
    F_SHORT short SMALLINT NOT NULL Int16    
    F_SHORT_NULL short? SMALLINT NULL Int16    
    F_USHORT ushort SMALLINT UNSIGNED NOT NULL UInt16 ushort_  
    F_USHORT_NULL ushort? SMALLINT UNSIGNED NULL UInt16 ushort_  
    F_INT int INT NOT NULL Int32    
    F_INT_NULL int? INT NULL Int32    
    F_UINT uint INT UNSIGNED NOT NULL UInt32 uint_  
    F_UINT_NULL uint? INT UNSIGNED NULL UInt32 uint_  
    F_LONG long BIGINT NOT NULL Int64    
    F_LONG_NULL long? BIGINT NULL Int64    
    F_ULONG ulong BIGINT UNSIGNED NOT NULL UInt64 ulong_  
    F_ULONG_NULL ulong? BIGINT UNSIGNED NULL UInt64 ulong_  
    F_FLOAT float FLOAT NOT NULL Single   Extremal spillovers
    F_FLOAT_NULL float? FLOAT NULL Single   Extremal spillovers
    F_DOUBLE double DOUBLE NOT NULL Double    
    F_DOUBLE_NULL double? DOUBLE NULL Double    
    F_DECIMAL decimal DECIMAL NOT NULL Decimal   Extremal spillovers
    F_DECIMAL_NULL decimal? DECIMAL NULL Decimal   Extremal spillovers
    F_CHAR char CHARACTER NOT NULL String   Chinese error
    F_CHAR_NULL char? CHARACTER NULL String   Chinese error
    F_STRING string VARCHAR(50) NOT NULL String    
    F_STRING_NULL string VARCHAR(50) NULL String    
    F_DATETIME DateTime DATETIME NOT NULL DateTime    
    F_DATETIME_NULL DateTime? DATETIME NULL DateTime    


    3. C# vs MSSQL:

    C# MSSQL
    The field name Type Library type GetFieldType(#) Transformation Remarks
    F_BOOL bool bit NOT NULL Boolean    
    F_BOOL_NULL bool? bit NULL Boolean    
    F_SBYTE sbyte smallint NOT NULL Int16 sbyte_short  
    F_SBYTE_NULL sbyte? smallint NULL Int16 sbyte_short  
    F_BYTE byte tinyint NOT NUL; Byte    
    F_BYTE_NULL byte? tinyint NULL Byte    
    F_SHORT short smallint NOT NULL Int16    
    F_SHORT_NULL short? smallint NULL Int16    
    F_USHORT ushort int NOT NULL Int32 ushort_int  
    F_USHORT_NULL ushort? int NULL Int32 ushort_int  
    F_INT int int NOT NULL Int32    
    F_INT_NULL int? int NULL Int32    
    F_UINT uint bigint NOT NULL Int64 uint_long  
    F_UINT_NULL uint? bigint NULL Int64 uint_long  
    F_LONG long bigint NOT NULL Int64    
    F_LONG_NULL long? bigint NULL Int64    
    F_ULONG ulong real NOT NULL Single ulong_float  
    F_ULONG_NULL ulong? real NULL Single ulong_float  
    F_FLOAT float real NOT NULL Single    
    F_FLOAT_NULL float? real NULL Single    
    F_DOUBLE double float NOT NULL Double    
    F_DOUBLE_NULL double? float NULL Double    
    F_DECIMAL decimal decimal NOT NULL Decimal   Extremal spillovers
    F_DECIMAL_NULL decimal? decimal NULL Decimal   Extremal spillovers
    F_CHAR char char(1) NOT NULL String    
    F_CHAR_NULL char? char(1) NULL String    
    F_STRING string varchar(50) NOT NULL F_STRING:    
    F_STRING_NULL string varchar(50) NULL String    
    F_DATETIME DateTime datetime NOT NULL DateTime   Must be between 1/1/1753 12:00:00 AM and 12/31/9999 11:59:59 PM.
    F_DATETIME_NULL DateTime? datetime NULL DateTime    


    4. C# vs Oracle:

    C# Oracle
    The field name Type Library type GetFieldType(#) Transformation Remarks
    F_BOOL bool CHAR(1) NOT NULL String bool_string  
    F_BOOL_NULL bool? CHAR(1) String bool_string  
    F_SBYTE sbyte NUMBER(3) NOT NULL Int16 sbyte_short  
    F_SBYTE_NULL sbyte? NUMBER(3) Int16 sbyte_short  
    F_BYTE byte NUMBER(3) NOT NULL Int16 byte_short  
    F_BYTE_NULL byte? NUMBER(3) Int16 byte_short  
    F_SHORT short NUMBER(5) NOT NULL Int32 short_int  
    F_SHORT_NULL short? NUMBER(5) Int32 short_int  
    F_USHORT ushort NUMBER(5) NOT NULL Int32 ushort_int  
    F_USHORT_NULL ushort? NUMBER(5) Int32 ushort_int  
    F_INT int NUMBER(10) NOT NULL Int64 int_long  
    F_INT_NULL int? NUMBER(10) Int64 int_long  
    F_UINT uint NUMBER(10) NOT NULL Int64 uint_long  
    F_UINT_NULL uint? NUMBER(10) Int64 uint_long  
    F_LONG long NUMBER(19) NOT NULL Decimal long_decimal  
    F_LONG_NULL long? NUMBER(19) Decimal long_decimal  
    F_ULONG ulong NUMBER(19) NOT NULL Decimal ulong_decimal  
    F_ULONG_NULL ulong? NUMBER(19) Decimal ulong_decimal  
    F_FLOAT float BINARY_FLOAT NOT NULL Single    
    F_FLOAT_NULL float? BINARY_FLOAT Single    
    F_DOUBLE double BINARY_DOUBLE NOT NULL Double   Extremal spillovers
    F_DOUBLE_NULL double? BINARY_DOUBLE Double   Extremal spillovers
    F_DECIMAL decimal DECIMAL(33,3) NOT NULL Decimal    
    F_DECIMAL_NULL decimal? DECIMAL(33,3) Decimal    
    F_CHAR char CHAR(1) NOT NULL String    
    F_CHAR_NULL char? CHAR(1) String    
    F_STRING string VARCHAR(50) NOT NULL String   Empty string is not allowed
    F_STRING_NULL string VARCHAR(50) String   Empty string is not allowed
    F_DATETIME DateTime TIMESTAMP NOT NULL DateTime   The large value of reading error
    F_DATETIME_NULL DateTime? TIMESTAMP DateTime   The large value of reading newspaper


    5. 타입변환 코드

    http://colorscripter.com/s/WF5md4K

     

    공유된 코드 - Color Scripter

    코드 설명 : c# and database type mapping copyright https://www.programering.com/a/MjN3gjMwATU.html

    colorscripter.com

    출처: https://www.programering.com/a/MjN3gjMwATU.html

    반응형

    댓글

Designed by Tistory.