返回首页

gbase数据、南大通用产品文档:GBase8sSQLBindCol (仅限核心级别)

更新日期:2024年09月11日

SQLBindCol 为结果集中的列分配存储和 GBase 8s ODBC Driver C 数据类型。
SQLBindCol 按如下方式分配存储:
l
一个存储缓冲区,用于接收一列数据的内容
l
存储缓冲区的长度
l
一个存储位置,用于接收访存操作返回的数据列的实际长度

GBase 8s ODBC Driver 程序员指南
南大通用数据技术股份有限公司
- 211 -

l
将 GBase 8s SQL 数据类型转换为 GBase 8s ODBC driver C 数据类型
下表描述了 SQLBindCol 的 SQLSTATE 和错误值。
SQLSTATE
错误值
错误消息
01000
-11001
General warning
S1000
-11060
General error
S1001
-11061
Memory-allocation failure
S1002
-11062
Invalid column number
S1003
-11063
Program type out of range
S1010
-11067
Function-sequence error
S1090
-11071
Invalid string or buffer length
S1C00
-11092
Driver not capable
重要: 应用程序可以调用 SQLBindCol 将列绑定到新的存储位置,而不管数据是否已经被存
取。新的绑定替换旧的绑定列以及其它绑定列。新的绑定不会应用到已经访存的数据;它会在
下次调用 SQLFetch 、SQLExtendedFetch 或 SQLSetPos 时发生作用。

执行initnodedatamap 命令初始化hashmap,然后将数据通过rebalance instance 命令
重分布到最新的distribution(Distribution ID:3)上。

GBase 8a MPP Cluster 产品手册
4 管理员指南
文档版本953(2022-04-10)
南大通用数据技术股份有限公司
340
说明

按distribution 分布规则,此次rebalance 操作不会实际进行数据搬移,所
以会很快完成;

本次rebalance 操作后不要删掉旧版nodedatamap 和distribution。
操作步骤
步骤1 :
步骤1:初始化hashmap:
$ gccli -uroot
GBase client 9.5.3.17.117651. Copyright (c) 2004-2020, GBase.
All Rights
Reserved.
gbase> use vc vc2;
Query OK, 0 rows affected (Elapsed: 00:00:00.00)
gbase> initnodedatamap;
Query OK, 0 rows affected, 5 warnings (Elapsed: 00:00:01.45)
步骤2:执行数据重分布:
gbase> rebalance instance;
Query OK, 3 rows affected (Elapsed: 00:00:05.60)
查看rebalance 状态:
gbase>
select
index_name,status,percentage,priority,host,distribution_id
from
gclusterdb.rebalancing_status;
+------------+-----------+------------+----------+---------------+-----------------+
| index_name | status
| percentage | priority | host
| distribution_id |
+------------+-----------+------------+----------+---------------+-----------------+
| demo.tt
| COMPLETED |
100 |
5 | 172.168.83.14 |
3 |
| demo.t
| COMPLETED |
100 |
5 | 172.168.83.14 |
3 |
| demo.ttt
| COMPLETED |
100 |
5 | 172.168.83.14 |
3 |
+------------+-----------+------------+----------+---------------+-----------------+
3 rows in set (Elapsed: 00:00:00.17)
gbase> quit
Bye

取值:[0|1]
默认值:1
说明:having 优化,打开会并行执行。默认打开。
修改方式:
可使用set 语句修改值也可在配置文件中修改值。
适用于session、
global
范围均可。