当前位置:网站首页>GBASE数据库迁移(Oracle到GBase 8s的数据类型映射)

GBASE数据库迁移(Oracle到GBase 8s的数据类型映射)

2022-08-11 05:21:00 蜻蜓队镸

Oracle数据类型

Gbase 8s数据类型

精度/范围

存储长度(字节)

BFILE

LONG RAW

BLOB

BLOB

BINARY_DOUBLE

DOUBLE PRECISION

14位精度浮点数

8

BINARY_FLOAT

DOUBLE PRECISION

14位精度浮点数

8

BINARY_INTEGER

PLS_INTEGER

NATURAL

NATURALN

POSITIVE

POSITIVEN

INTEGER

-2,147,483,647
到2,147,483,647

4

BOOLEAN (PL/SQL)

BOOLEAN

TRUE 或 FALSE

1

CHAR(n)

CHAR(n)

1≤n≤32,767

n

CHARACTER(n)

CHARACTER(n)

1≤n≤32,767

n

DATE

DATETIME YEAR TO SECOND

year to fraction(5)

总位数/2+1

DOUBLE PRECISION

DOUBLE PRECISION

14位精度浮点数

4

FLOAT

FLOAT

14位精度浮点数

4

INTEGER/INT

INTEGER

-2,147,483,647
到2,147,483,647

4

INTERVAL DAY(p) TOSECOND(s)

INTERVAL DAY(p) TO FRACTION(min(5,s))

INTERVAL YEAR(p) TOMONTH

INTERVAL YEAR(p) TO MONTH

LONG

CLOB

CLOB

最大4T字节

LONG VARCHAR (xxx)

LVARCHAR

1到32,767字节

NCHAR(n)

NATIONAL CHAR(n)

NATIONAL CHARACTER(n)

NCHAR(n)

1到32,767字节

NCLOB

CLOB

最大4T字节

NUMBER

NUMBER(*,0)

NUMBER(p)

NUMBER(p,s)(s<0)

INTEGER

-2,147,483,647
到2,147,483,647

4

NUMBER(p)

NUMBER (p,0)

 10 <= p <= 18

NUMBER(p, s)

 10 <= p-s < 19.

BIGINT

–9,223,372,036,854,775,807


9,223,372,036,854,775,807

NUMBER(p, s)

 s > 0 and p >= s

DECIMAL (min(p,32), min(s,32))

p/2+1

NUMBER(p, s)

(s > 0 且 p < s)

DECIMAL (min(s,32),min(s,32))

NUMBER(p, s)

(s<0 且 18<p-s<32)

DECIMAL (min(p-s,32),0)

NUMBER(p, s)

s>32, 或 p-s>32

DECIMAL(32)
DECIMAL(32,32)

DEC

DECIMAL

NUMERIC

DEC(p)

DECIMAL(p)

NUMERIC(p)

DEC(p, s)

DECIMAL(p, s)

NUMERIC(p,s)

与Oracle定义相同,无需更改

NVARCHAR2(n)

NCHARVARYING(n)

NATIONAL CHAR

VARYING(n)

NATIONAL CHARACTER

VARYING(n)

LVARCHAR(min(n, 32767))

RAW(n)

BLOB

最大4T字节

REAL

DOUBLE PRECISION

14位精度浮点数

4

Record

自定义数据类型
CREATE ROWTYPE

ROWID

INTEGER

-2,147,483,647
到2,147,483,647

4

SMALLINT

SMALLINT

–32,767到32,767

2

TIMESTAMP(p)

参数p不指定时为默认值6

DATETIME YEAR TO
FRACTION(min(5, p))

总位数/2+1

UROWID(n)

INTEGER

-2,147,483,647
到2,147,483,647

4

VARCHAR2(n)

VARCHAR(n)

CHAR VARYING(n)

CHARACTER VARYING(n)2

(n<=255)

VARCHAR(n)

1-255字节

VARCHAR2(n)

VARCHAR(n)

CHAR VARYING(n)

CHARACTER VARYING(n)2

(n>255)

LVARCHAR(n)

255-32767字节

VARCHAR2(n char)

按照VARCHAR2(2n)参考以上转换成对应类型

XML

LVARCHAR(n)    1<=n<=32,767

CLOB

最大4T字节

原网站

版权声明
本文为[蜻蜓队镸]所创,转载请带上原文链接,感谢
https://blog.csdn.net/qq_37004539/article/details/125930719