返回首页

gbase数据、南大通用产品文档:GBase8a|

更新日期:2024年09月11日

|
2 |
1 |
4 | DMD
| zx
| dmd2 | 2013-04-01 10:23:01 | 2.30
|
+-------+------+------+------------+------+------+---------------------+------+
5 rows in set (Elapsed: 00:00:10.07)
示例2:
gbase> create table dep(depid int,depname varchar(100),upperdepid int)
replicated;
insert into dep values(0,'总经办',NULL);
insert into dep values(1,'开发部',0);
insert into dep values(2,'测试部',0);
insert into dep values(3,'Server 开发部',1);
insert into dep values(3,'Client 开发部',1);
insert into dep values(5,'TA 测试部',2);
insert into dep values(6,'项目测试部',2);
gbase> select * from dep;
+-------+-----------------+------------+
| depid | depname
| upperdepid |
+-------+-----------------+------------+
|
0 | 总经办
|
NULL |
|
1 | 开发部
|
0 |
|
2 | 测试部
|
0 |
|
3 | Server 开发部
|
1 |
|
4 | Client 开发部
|
1 |
|
5 | TA 测试部
|
2 |
|
6 | 项目测试部
|
2 |
+-------+-----------------+------------+
select depname , connect_by_root depname
"root ", connect_by_isleaf
"isleaf " , level ,
sys_connect_by_path(depname,'/')
"path"
from dep
start with upperdepid is null connect by prior depid=upperdepid;
+-----------------+-----------+--------+-------+------------------
|
depname
|
root
|
isleaf
|
level
|
path
|
+-----------------+-----------+--------+-------+------------------
|
总经办
|
总经办
|
0
|
1
| /总经办
|
|
开发部
|
总经办
|
0
|
2
| /总经办/开发部
|
|Server 开发部|
总经办
| 1
|3 | /总经办/开发部/Server 开发部
|
|Client 开发部|
总经办
| 1
|3 | /总经办/开发部/Client 开发部
|
|
测试部
| 总经办
|
0 |2 | /总经办/测试部
|
| TA 测试部
| 总经办
|
1 | 3 | /总经办/测试部/TA 测试部
|

GBase 8a MPP Cluster 产品手册
5 数据库管理指南
文档版本953(2022-04-10)
南大通用数据技术股份有限公司
1091
| 项目测试部
| 总经办
|
1 | 3 | /总经办/测试部/项目测试部
|
+-----------------+-----------+--------+-------+------------------

CHARACTER 数据类型是 CHAR 的同义词。

智能大对象是带有下列特性的大对象:

智能大对象可保存非常大量的数据。
当前,单个智能大对象可保存最多 4 TB 数据。此数据存储在称为 sbspace 的独立
磁盘空间中。

智能大对象是可恢复的。
数据库服务器可将更改日志记录至智能大对象,因此,在系统或硬件故障时可恢复
智能大对象数据。智能大对象的日志记录不是缺省的行为。

智能大对象支持对其数据的随机访问。
以“全部或者全不”方式访问简单大对象(BYTE 或 TEXT);也就是说,数据库
服务器一次返回您请求的所有简单大对象数据。对于智能大对象,可寻找所需的位
置,并读或写所需的字节数。

可定制智能大对象的存储特征。
当创建智能大对象时,可指定智能大对象的存储特征,诸如:

数据库服务器是否根据当前数据库日志模式来日志记录智能大对象

数据库服务器是否保存最后一次访问智能大对象的痕迹

数据库服务器是否使用页标头来检测数据损坏与否
在数据库中作为 BLOB 和 CLOB 数据类型来存储智能大对象,您可以两种方式访问它们:


在 GBase 8s JDBC Driver 3.0 和后来版本中,以及支持支持智能大对象数据类型
的 GBase 8s 服务器中,可使用 JDBC 3.0 规范中描述的标准 JDBC API 方法。这
是较简单的方法。
已实现了对于 BLOG 和 CLOB 内部更新的下列 JDBC 3.0 方法:
int setBytes(long, byte[]) throws SQLException

void truncate(long) throws SQLException
在 GBase 8s JDBC Driver Version 3.0 或后来版本中实现来自 BLOB 接口的下列
JDBC 3.0 方法:
OutputStream setBinaryStream(long) throws SQLException


GBase 8s JDBC Driver 程序员指南
南大通用数据技术股份有限公司
- 138
-
int setBytes(long, byte[], int, int) throws SQLException
在 GBase 8s JDBC Driver Version 3.0 或后来版本中,实现来自 CLOB 接口的下列
JDBC 3.0 方法:
OutputStream setAsciiStream(long) throws SQLException
Writer setCharacterStream(long) throws SQLException

int setString(long, String) throws SQLException

int setString(long, String, int, int) throws SQLException

可使用 GBase 8s 内基于智能大对象支持的 GBase 8s 扩展。此方法提供更多选项。