当前位置:网站首页>金仓数据库 KingbaseES与Oracle的兼容性说明(2. 数据类型)
金仓数据库 KingbaseES与Oracle的兼容性说明(2. 数据类型)
2022-07-28 21:46:00 【沉舟侧畔千帆过_】
2. 数据类型
2.1. KingbaseES数据类型到Oracle数据类型转换
序号 | KingbaseES 数据类型 | Oracle数据类型 | 备注说明 (KingbaseES) |
|---|---|---|---|
数值型 | |||
1 | tinyint | NUMBER | 单字节整数 -128 to +127 |
2 | smallint | NUMBER | 小范围整数 -32768 to +32767 |
3 | integer | NUMBER | 整数的典型选择 -2147483648 to +2147483647 |
4 | bigint | NUMBER | 大范围整数 -9223372036854775808 to +9223372036854775807 |
5 | decimal | NUMBER | 用户 指定精度,精确 最高小数点前 131072位,以及 小数点后16383位 |
6 | numeric, number | NUMBER | 用户 指定精度,精确 最高小数点前 131072位,以及 小数点后16383位 |
7 | real | FLOAT | 可 变精度,不精确 6位十进制精度 |
8 | float | FLOAT | |
9 | double precision, double | FLOAT | 8字节 可 变精度,不精确 15位十进制精度 |
10 | smallserial | NUMBER | 自 动增加的小整数 1到32767 |
11 | serial | NUMBER | 自动增加的整数 1到2147483647 |
12 | bigserial | NUMBER | 单字节整数 +1 to +9223372036854775807 |
字符型 | |||
1 | character (n[char | byte]), char(n[char | byte]) | CHAR/CLOB | 定长,最大 到8000,空格填 充。当长度不大 于1000时转换为 CHAR,当长度超过 1000则转换为CLOB |
2 | character varying(n[char | byte]), varchar(n[char | byte]), varchar2(n[char | byte]) | VARCHAR2/CLOB | 有限制的变长, 最大到8000。当 长度不大于2000 时转换为CHAR,当 长度超过2000 则转换为CLOB |
3 | text | CLOB | 无限变长 |
大对象类型 | |||
1 | clob | CLOB | 字符大对象 |
2 | bytea | BLOB | 变长二进制串 |
3 | blob | BLOB | 二进制大对象 |
日期时间 | |||
1 | timestamp [ (p) ] [ without time zone ] | TIMESTAMP | 日期和 时间(无时区) |
2 | timestamp [ (p) ] with time zone | TIMESTAMP() WITH TIME ZONE | 包括日期 和时间,有时区 |
3 | date | DATE | 日期 |
4 | time [ (p) ] [ without time zone ] | DATE | 一天中的时间 |
5 | time [ (p) ] with time zone | DATE | 仅仅是一天中的 时间,带有时区 |
6 | interval year | NUMBER | 时间间隔 |
7 | interval month | NUMBER | 时间间隔 |
8 | interval day | NUMBER | 时间间隔 |
9 | interval hour | NUMBER | 时间间隔 |
10 | interval minute | NUMBER | 时间间隔 |
11 | interval second | FLOAT | 时间间隔 |
12 | interval year to month | INTERVAL YEAR() TO MONTH | 时间间隔 |
13 | interval day to second | INTERVAL DAY() TO SECOND | 时间间隔 |
布尔类型 | |||
1 | boolean | NUMBER | 状态为真或假 |
位串类型 | |||
1 | bit(n) bit varying(n) | BLOB | 一串 1 和 0 的串 |
XML类型 | |||
1 | xml | XMLTYPE | 用来存储XML数据 |
JSON类型 | |||
1 | JSON | JSON | 用来存储JSON数据 |
2.2. Oracle数据类型到KingbaseES数据类型转换
序号 | Oracle数据类型 | KingbaseES 数据类型 | 备注 说明(Oracle) |
数值型 | |||
1 | NUMBER(p,s) | numeric (precision, scale) | 1.0 x |image16| 到 1.0 x |image17| |
2 | FLOAT | double | Number的子类型 |
3 | BINARY_FLOAT | double | 4字节 ,单精度浮点数 |
4 | BINARY_DOUBLE | double | 8字节 ,双精度浮点数 |
字符型 | |||
1 | CHAR | char | 定长字符串 |
2 | VARCHAR2 | varchar | 变长字符串 |
3 | NCHAR | char | Unicode 编码字符串 |
4 | NVARCHAR2 | varchar | Unicode 编码字符串 |
日期时间 | |||
1 | DATE | timestamp [ (p) ] [ without time zone ] | 日期类型 |
2 | TIMESTAMP WITH TIME ZONE | timestamp [ (p) ] [ without time zone ] | 时间类型 |
3 | TIMESTAMP() WITH TIME ZONE | timestamp [ (p) ] with time zone | 带时区时间类型 |
4 | TIMESTAMP() WITH LOCAL TIME ZONE | timestamp [ (p) ] with time zone | 带本地时区时间类型 |
5 | INTERVAL DAY() TO SECOND | interval year to month | 时间间隔 |
6 | INTERVAL YEAR() TO MONTH | interval day to second | 时间间隔 |
大对象类型 | |||
1 | BLOB | blob | 二进制大对象 |
2 | CLOB | clob | 字符大对象 |
3 | NCLOB | clob | 存储Unicode数据 |
其他类型 | |||
1 | LONG | text | 存储可变长字符串 |
2 | RAW | bytea | 存储字符型数据 |
3 | LONG RAW | bytea | 存储图像文档声音等二进制数据 |
4 | ROWID | varchar | 长度 64,可以存储A-Z, a-z, 0-9, + / |
5 | UROWID | varchar | 存储Index -organized表 和外部表的地址 |
边栏推荐
- trivy【2】工具漏洞扫描
- Wechat applet development ④
- 当初的“你“为什么做测试/开发程序员?自己存在的价值......
- Advanced C language: pointer (3)
- Arduino框架下STM32F103C系列单片机引脚映射关系
- Runloop principle (II)
- Runloop, auto release pool, thread, GCD
- Summary of koltin knowledge points
- 22 Niu Ke multi school Day1 J - serval and essay heuristic merging
- High quality programming
猜你喜欢

CV目标检测模型小抄(2)

Arduino UNO驱动合宙1.8‘TFT SPI屏幕示例演示(含资料包)

Achieve high throughput through Wi Fi 7 - insight into the next generation of Wi Fi physical layer

一文读懂Okaleido Tiger近期动态,挖掘背后价值与潜力

如何开一家盈利的健身房?我用1年回本的经验告诉你,别谈恋爱

MyCms 自媒体商城 v3.6 发布,兼容微擎应用开发(Laravel框架)

Sdwebimage source code combs 5 author motivation, modifies directory, and changes inheritance relationship

6 个超级良心的开源教程!

JSP tag case

What if win11 quick copy and paste cannot be used? Win11 shortcut copy and paste cannot be used
随机推荐
Elements in the middle (one article is enough)
Solve the problem of using anonymous users in pod due to the failure of attaching ciphertext token files for serviceaccount user authentication
Typescript类方法this指针绑定
6 open source tutorials of super conscience!
二叉搜索树
Wechat applet development ③
Applet, JS, transfer object jump transfer parameter problem
网络流量监控工具iftop
The development mode of digital retail dominated by traffic is only the beginning
The safety dog has been selected into many details of cloud security panorama 2.0
如何在VR全景中嵌入AI数字人功能?打造云端体验感
trivy【3】自定义扫描策略
Several common methods of SQL optimization
With the "integration of driving and parking", freytek's high-performance domain controller leads the new track
Thesis reading (2) - vggnet of classification
事件抽取文献整理(2008-2017)
mgr.exe病毒导致启动程序启动失败
How does VR panorama entrepreneurship expand the market? How to make the road of entrepreneurship smoother?
通过Wi-Fi 7实现极高吞吐量——洞察下一代Wi-Fi物理层
Media query adaptation