Enum odbc_api_helper::data_type::DataType
source · [−]pub enum DataType {
Show 29 variants
NUMERIC,
NUMBER,
DECIMAL,
BIT,
INTEGER,
BIGINT,
TINYINT,
BYTE,
SMALLINT,
BINARY,
VARBINARY,
REAL,
FLOAT,
DOUBLE,
DOUBLE_PRECISION,
CHAR,
VARCHAR,
TEXT,
IMAGE,
BLOB,
CLOB,
BFILE,
DATE,
TIME,
TIMESTAMP,
TIME_WITH_TIME_ZONE,
TIMESTAMP_WITH_TIME_ZONE,
TIMESTAMP_WITH_LOCAL_TIME_ZONE,
BOOL,
}Variants
NUMERIC
`NUMERIC 数据类型用于存储零、正负定点数。其中:精度是一个无符号整数, 定义 了总的数字数,精度范围是 1至38,标度定义了小数点右边的数字位数,定义时如省略 精度,则默认是 16。 如省略标度,则默认是 0。一个数的标度不应大于其精度。例如: NUMERIC(4,1)定义了小数点前面 3 位和小数点后面 1 位,共 4 位的数字,范围在 - 999.9 到 999.9。 所有 NUMERIC 数据类型,如果其值超过精度,达梦数据库返回一个 出错信息,如果超过标度,则多余的位截断。 如果不指定精度和标度,缺省精度为 38。 NUMERIC[( 精度 [, 标度])]
NUMBER
与 NUMERIC 类型相同。 NUMBER[(精度 [, 标度])]
DECIMAL
与 NUMERIC 相似。 DECIMAL[(精度 [, 标度])],
BIT
BIT 类型用于存储整数数据 1、0 或 NULL,可以用来支持 ODBC 和 JDBC 的布尔数据 类型。DM 的 BIT 类型与 SQL SERVER2000 的 BIT 数据类型相似。
INTEGER
用于存储有符号整数,精度为 10,标度为 0。取值范围为:-2147483648(- 2^31)~ +2147483647(2^31-1)。
BIGINT
用于存储有符号整数,精度为 19,标度为 0。取值范围为:-9223372036854775808(-2^63)~ 9223372036854775807(2^63-1)。
TINYINT
用于存储有符号整数,精度为 3,标度为 0。取值范围为:-128~+127。
BYTE
与 TINYINT 相似,精度为 3,标度为 0。
SMALLINT
用于存储有符号整数,精度为 5,标度为 0。
BINARY
BINARY 数据类型指定定长二进制数据。缺省长度为 1 个字节,最大长度由数据库页 面大小决定,具体可参考《DM8_SQL 语言使用手册》1.4.1 节。BINARY 常量以 0x 开始, 后跟数据的十六进制表示,例如 0x2A3B4058。
VARBINARY
VARBINARY 数据类型指定变长二进制数据,用法类似 BINARY 数据类型,可以指定 一个正整数作为数据长度。缺省长度为 8188 个字节,最大长度由数据库页面大小决定, 具体可参考《DM8_SQL 语言使用手册》1.4.1 节。
REAL
REAL 是带二进制的浮点数,但它不能由用户指定使用的精度,系统指定其二进制精 度为24,十进制精度为7。取值范围-3.4E + 38 ~ 3.4E + 38。
FLOAT
FLOAT 是带二进制精度的浮点数,精度最大不超过 53,如省略精度,则二进制精度 为53,十进制精度为15。取值范围为-1.7E + 308 ~ 1.7E + 308。
DOUBLE
同 FLOAT 相似,精度最大不超过 53。
DOUBLE_PRECISION
该类型指明双精度浮点数,其二进制精度为 53,十进制精度为 15。取值范围-1.7E + 308 ~ 1.7E + 308。
CHAR
定长字符串,最大长度由数据库页面大小决定,具体可参考《DM8_SQL 语言使用手册》 1.4.1 节。长度不足时,自动填充空格。
VARCHAR
可变长字符串,最大长度由数据库页面大小决定,具体可参考《DM8_SQL 语言使用手 册》1.4.1 节。
TEXT
变长字符串类型,其字符串的长度最大为 2G-1,可用于存储长的文本串。
IMAGE
可用于存储多媒体信息中的图像类型。图像由不定长的象素点阵组成,长度最大为2G-1 字节。该类型除了存储图像数据之外,还可用于存储任何其它二进制数据。
BLOB
BLOB 类型用于指明变长的二进制大对象,长度最大为 2G-1 字节。
CLOB
CLOB 类型用于指明变长的字符串,长度最大为 2G-1 字节。
BFILE
BFILE 用于指明存储在操作系统中的二进制文件,文件存储在操作系统而非数据库中, 仅能进行只读访问。
DATE
DATE 类型包括年、月、日信息,定义了’-4712-01-01’和’9999-12-31’之间任 何一个有效的格里高利日期。
TIME
TIME 类型包括时、分、秒信息,定义了一个在’00:00:00.000000’和 ’23:59:59.999999’之间的有效时间。TIME 类型的小数秒精度规定了秒字段中小数点 后面的位数,取值范围为 0~6,如果未定义,缺省精度为 0。
TIMESTAMP
TIMESTAMP/DATETIME 类型包括年、月、日、时、分、秒信息,定义了一个在’- 4712-01-01 00:00:00.000000’和’9999-12-31 23:59:59.999999’之间的有效 格里高利日期时间。小数秒精度规定了秒字段中小数点后面的位数,取值范围为 0~6,如 果未定义,缺省精度为 6。
TIME_WITH_TIME_ZONE
描述一个带时区的 TIME 值,其定义是在 TIME 类型的后面加上时区信息。时区部分 的实质是 INTERVAL HOUR TO MINUTE 类型,取值范围:-12:59 与+14:00 之间。例 如:TIME ‘09:10:21 +8:00’
TIMESTAMP_WITH_TIME_ZONE
描述一个带时区的 TIMESTAMP 值,其定义是在 TIMESTAMP 类型的后面加上时区信 息。时区部分的实质是 INTERVAL HOUR TO MINUTE 类型,取值范围:-12:59 与 +14:00 之间。例如:’2009-10-11 19:03:05.0000 -02:10’。
TIMESTAMP_WITH_LOCAL_TIME_ZONE
描述一个本地时区的TIMESTAMP值,能够将标准时区类型TIMESTAMP WITH TIME ZONE 类型转化为本地时区类型,如果插入的值没有指定时区,则默认为本地时区。
BOOL
布尔数据类型:TRUE 和 FALSE。DMSQL 程序的布尔类型和 INT 类型可以相互转化。 如果变量或方法返回的类型是布尔类型,则返回值为 0 或 1。TRUE 和非 0 值的返回值为 1,FALSE 和 0 值返回为 0。
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for DataType
impl Send for DataType
impl Sync for DataType
impl Unpin for DataType
impl UnwindSafe for DataType
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<D> OwoColorize for D
impl<D> OwoColorize for D
fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
fn black(&'a self) -> FgColorDisplay<'a, Black, Self>
fn black(&'a self) -> FgColorDisplay<'a, Black, Self>
fn on_black(&'a self) -> BgColorDisplay<'a, Black, Self>
fn on_black(&'a self) -> BgColorDisplay<'a, Black, Self>
fn red(&'a self) -> FgColorDisplay<'a, Red, Self>
fn red(&'a self) -> FgColorDisplay<'a, Red, Self>
fn on_red(&'a self) -> BgColorDisplay<'a, Red, Self>
fn on_red(&'a self) -> BgColorDisplay<'a, Red, Self>
fn green(&'a self) -> FgColorDisplay<'a, Green, Self>
fn green(&'a self) -> FgColorDisplay<'a, Green, Self>
fn on_green(&'a self) -> BgColorDisplay<'a, Green, Self>
fn on_green(&'a self) -> BgColorDisplay<'a, Green, Self>
fn yellow(&'a self) -> FgColorDisplay<'a, Yellow, Self>
fn yellow(&'a self) -> FgColorDisplay<'a, Yellow, Self>
fn on_yellow(&'a self) -> BgColorDisplay<'a, Yellow, Self>
fn on_yellow(&'a self) -> BgColorDisplay<'a, Yellow, Self>
fn blue(&'a self) -> FgColorDisplay<'a, Blue, Self>
fn blue(&'a self) -> FgColorDisplay<'a, Blue, Self>
fn on_blue(&'a self) -> BgColorDisplay<'a, Blue, Self>
fn on_blue(&'a self) -> BgColorDisplay<'a, Blue, Self>
fn magenta(&'a self) -> FgColorDisplay<'a, Magenta, Self>
fn magenta(&'a self) -> FgColorDisplay<'a, Magenta, Self>
fn on_magenta(&'a self) -> BgColorDisplay<'a, Magenta, Self>
fn on_magenta(&'a self) -> BgColorDisplay<'a, Magenta, Self>
fn purple(&'a self) -> FgColorDisplay<'a, Magenta, Self>
fn purple(&'a self) -> FgColorDisplay<'a, Magenta, Self>
fn on_purple(&'a self) -> BgColorDisplay<'a, Magenta, Self>
fn on_purple(&'a self) -> BgColorDisplay<'a, Magenta, Self>
fn cyan(&'a self) -> FgColorDisplay<'a, Cyan, Self>
fn cyan(&'a self) -> FgColorDisplay<'a, Cyan, Self>
fn on_cyan(&'a self) -> BgColorDisplay<'a, Cyan, Self>
fn on_cyan(&'a self) -> BgColorDisplay<'a, Cyan, Self>
fn white(&'a self) -> FgColorDisplay<'a, White, Self>
fn white(&'a self) -> FgColorDisplay<'a, White, Self>
fn on_white(&'a self) -> BgColorDisplay<'a, White, Self>
fn on_white(&'a self) -> BgColorDisplay<'a, White, Self>
fn default_color(&'a self) -> FgColorDisplay<'a, Default, Self>
fn default_color(&'a self) -> FgColorDisplay<'a, Default, Self>
fn on_default_color(&'a self) -> BgColorDisplay<'a, Default, Self>
fn on_default_color(&'a self) -> BgColorDisplay<'a, Default, Self>
fn bright_black(&'a self) -> FgColorDisplay<'a, BrightBlack, Self>
fn bright_black(&'a self) -> FgColorDisplay<'a, BrightBlack, Self>
fn on_bright_black(&'a self) -> BgColorDisplay<'a, BrightBlack, Self>
fn on_bright_black(&'a self) -> BgColorDisplay<'a, BrightBlack, Self>
fn bright_red(&'a self) -> FgColorDisplay<'a, BrightRed, Self>
fn bright_red(&'a self) -> FgColorDisplay<'a, BrightRed, Self>
fn on_bright_red(&'a self) -> BgColorDisplay<'a, BrightRed, Self>
fn on_bright_red(&'a self) -> BgColorDisplay<'a, BrightRed, Self>
fn bright_green(&'a self) -> FgColorDisplay<'a, BrightGreen, Self>
fn bright_green(&'a self) -> FgColorDisplay<'a, BrightGreen, Self>
fn on_bright_green(&'a self) -> BgColorDisplay<'a, BrightGreen, Self>
fn on_bright_green(&'a self) -> BgColorDisplay<'a, BrightGreen, Self>
fn bright_yellow(&'a self) -> FgColorDisplay<'a, BrightYellow, Self>
fn bright_yellow(&'a self) -> FgColorDisplay<'a, BrightYellow, Self>
fn on_bright_yellow(&'a self) -> BgColorDisplay<'a, BrightYellow, Self>
fn on_bright_yellow(&'a self) -> BgColorDisplay<'a, BrightYellow, Self>
fn bright_blue(&'a self) -> FgColorDisplay<'a, BrightBlue, Self>
fn bright_blue(&'a self) -> FgColorDisplay<'a, BrightBlue, Self>
fn on_bright_blue(&'a self) -> BgColorDisplay<'a, BrightBlue, Self>
fn on_bright_blue(&'a self) -> BgColorDisplay<'a, BrightBlue, Self>
fn bright_magenta(&'a self) -> FgColorDisplay<'a, BrightMagenta, Self>
fn bright_magenta(&'a self) -> FgColorDisplay<'a, BrightMagenta, Self>
fn on_bright_magenta(&'a self) -> BgColorDisplay<'a, BrightMagenta, Self>
fn on_bright_magenta(&'a self) -> BgColorDisplay<'a, BrightMagenta, Self>
fn bright_purple(&'a self) -> FgColorDisplay<'a, BrightMagenta, Self>
fn bright_purple(&'a self) -> FgColorDisplay<'a, BrightMagenta, Self>
fn on_bright_purple(&'a self) -> BgColorDisplay<'a, BrightMagenta, Self>
fn on_bright_purple(&'a self) -> BgColorDisplay<'a, BrightMagenta, Self>
fn bright_cyan(&'a self) -> FgColorDisplay<'a, BrightCyan, Self>
fn bright_cyan(&'a self) -> FgColorDisplay<'a, BrightCyan, Self>
fn on_bright_cyan(&'a self) -> BgColorDisplay<'a, BrightCyan, Self>
fn on_bright_cyan(&'a self) -> BgColorDisplay<'a, BrightCyan, Self>
fn bright_white(&'a self) -> FgColorDisplay<'a, BrightWhite, Self>
fn bright_white(&'a self) -> FgColorDisplay<'a, BrightWhite, Self>
fn on_bright_white(&'a self) -> BgColorDisplay<'a, BrightWhite, Self>
fn on_bright_white(&'a self) -> BgColorDisplay<'a, BrightWhite, Self>
fn bold(&'a self) -> BoldDisplay<'a, Self>
fn bold(&'a self) -> BoldDisplay<'a, Self>
fn dimmed(&'a self) -> DimDisplay<'a, Self>
fn dimmed(&'a self) -> DimDisplay<'a, Self>
fn italic(&'a self) -> ItalicDisplay<'a, Self>
fn italic(&'a self) -> ItalicDisplay<'a, Self>
fn underline(&'a self) -> UnderlineDisplay<'a, Self>
fn underline(&'a self) -> UnderlineDisplay<'a, Self>
fn blink(&'a self) -> BlinkDisplay<'a, Self>
fn blink(&'a self) -> BlinkDisplay<'a, Self>
fn blink_fast(&'a self) -> BlinkFastDisplay<'a, Self>
fn blink_fast(&'a self) -> BlinkFastDisplay<'a, Self>
fn reversed(&'a self) -> ReversedDisplay<'a, Self>
fn reversed(&'a self) -> ReversedDisplay<'a, Self>
fn strikethrough(&'a self) -> StrikeThroughDisplay<'a, Self>
fn strikethrough(&'a self) -> StrikeThroughDisplay<'a, Self>
fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
OwoColorize::fg or
a color-specific method, such as OwoColorize::green, Read morefn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
OwoColorize::bg or
a color-specific method, such as OwoColorize::on_yellow, Read more