返回首页

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

更新日期:2024年09月11日

UPDATE INDEX 句法更新全文索引
语法格式
UPDATE INDEX index_name ON table_name [WITH ANALYZE];
表5- 39 参数说明
参数名称


index_name
索引名(索引名全局唯一,索引名区分大小写)。
table_name
表名。
WITH ANALYZE
分析指令,加入后更新全文索时会对不连续数据重整,提升
I/O 速度,从而提升性能。

GBase 8a MPP Cluster 产品手册
5 数据库管理指南
文档版本953(2022-04-10)
南大通用数据技术股份有限公司
923
示例
示例1:更新sms 表中名为idx_t 的全文索引。
gbase> UPDATE INDEX idx_t ON sms;
Query OK, 0 rows affected

1)
在工程项目中引用用于显示报表的组件
CrytalDecisions.CrystalReports.Engine
CrystalDecisions.ReportSource
CrystalDecisions.Shared
CrystalDecisions.Windows.Forms
2)
在用户界面上拖放一个Viewer 控件
3)
在代码中引用水晶报表命名空间
CrystalDecisions.CrystalReports.Engine
4)
使用 GBaseConnection 创建连接对象
5)
使用 GBaseCommand 创建命令对象
6)
使用 GBaseDataAdapter 创建适配器对象
7)
使用 ReportDocument 创建报表对象
8)
使用 DataSet 创建数据集对象
9)
建立命令对象与连接对象的关系
10) 设置命令对象的CommandText 属性,指明查询语句
11) 从数据源中获取数据后使用适配器对象填充到数据集
12) 使用报表对象加载world_report.rpt 文件
13) 设置报表对象的数据源为数据集对象
14) 设置Viewer 空间的报表源为报表对象

GBase 8a 程序员手册ADO.NET 篇


- 44 -

南大通用数据技术股份有限公司
15) 显示在界面上
C# 示例:
using CrystalDecisions.CrystalReports.Engine;
using System.Data;
using GBase.Data.GBaseClient;

ReportDocument gsReport = new ReportDocument();
DataSet gsData = new DataSet();
GBaseConnection conn;
GBaseCommand cmd;
GBaseDataAdapter gsAdapter;

conn = new GBaseConnection();
cmd = new GBaseCommand();
gsAdapter = new GBaseDataAdapter();

conn.ConnectionString = "server=127.0.0.1;uid=root;" +
"pwd=12345;database=test;";

try
{
cmd.CommandText = "SELECT city.name AS cityName,
city.population AS CityPopulation, " + "country.name,
country.population, country.continent " + "FROM country, city ORDER BY
country.continent, country.name";
cmd.Connection = conn;

gsAdapter.SelectCommand = cmd;
gsAdapter.Fill(gsData);

gsReport.Load(@".\world_report.rpt");
gsReport.SetDataSource(gsData);
gsViewer.ReportSource = gsReport;



GBase 8a 程序员手册ADO.NET 篇
南大通用数据技术股份有限公司

- 45 -
}
catch (GBaseException ex)
{
MessageBox.Show(ex.Message, "Report could not be created",
MessageBoxButtons.OK, MessageBoxIcon.Error);
}

增加合法字段时,字段增加成功;增加不合法字段时,系统不增加字段,显示出
错原因
1. sysdba 登录企业管理器,左树菜单-数据库-db1-t1
2. 右键单击“t1”->“设计表”
3. 增加一列,列名输入 c3,数据类型选择 varchar(50)
4. 保存成功
5. 增加一列,列名输入 c1,数据类型选择 varchar(50)
6. 操作失败,报错列名已经存在