返回首页

gbase数据、南大通用产品文档:GBase8sbyfill() 函数

更新日期:2024年09月11日

byfill() 函数以一个字符填充指定的区域。

GBase 8s ESQL/C 编程指南
南大通用数据技术股份有限公司
- 616 -

语法
void byfill(to, length, ch)
char *to;
mint length;
char ch;
to
指向您想要 byfill() 填充的内存区域的第一个字节的指针。
length
您想要 byfill() 在该区域内重复该字符的次数。
ch
您想要 byfill() 用于填充该区域的字符。
重要: 请注意,不要重写您想要 byfill() 填充的区域相邻的内存区域。

示例

此样例程序位于 demo 目录中的 byfill.ec 文件中。
/*
* byfill.ec *

The following program shows the results of three byfill() operations on an area that is
initialized to x's.
*/

#include

main()
{
static char area[20] = "xxxxxxxxxxxxxxxxxxx";

printf("BYFILL Sample ESQL Program running.\n\n");

printf("String = %s\n", area);

GBase 8s ESQL/C 编程指南
南大通用数据技术股份有限公司
- 617 -

printf("\nFilling string with five 's' characters:\n");
byfill(area, 5, 's');
printf("Result = %s\n", area);

printf("\nFilling string with two 's' characters starting at ");
printf("position 16:\n");
byfill(&area[16], 2, 's');
printf("Result = %s\n", area);

printf("Filling entire string with 'b' characters:\n");
byfill(area, sizeof(area)-1, 'b');
printf("Result = %s\n", area);

printf("\nBYFILL Sample Program over.\n\n");
}
输出
BYFILL Sample ESQL Program running.

String = xxxxxxxxxxxxxxxxxxx

Filling string with five 's' characters:
Result = sssssxxxxxxxxxxxxxx

Filling string with two 's' characters starting at position 16:
Result = sssssxxxxxxxxxxxssx

Filling entire string with 'b' characters:
Result = bbbbbbbbbbbbbbbbbbb

BYFILL Sample Program over.

(1 row)
当一个money 类型的值除以另一个money 类型的值时,结果是double precision(也就
是,一个纯数字,而不是money 类型)
;在运算过程中货币单位相互抵消。

移动 sysadmin 数据

GBase 8s 管理员参考
南大通用数据技术股份有限公司 - 792 -
库(SQL 管理 API)
随同 admin() 或 task() 函数,使用 reset sysadmin 参数来将 sysadmin 数据库移到指定的
dbspace。移动 sysadmin 数据库将该数据库重置回到首次创建它时的原始状态;所有数据、

command history 和结果表都会丢失。仅内建任务、传感器和阈值保留在 sysadmin 表中。
语法

元素
描述
关键考虑
dbspace
dbspace 的名称。


用法
这个函数没有等同的实用程序命令。
如果您未指定 dbspace 作为最后的参数,则这个命令删除 sysadmin 数据库,然后在
rootdbs 中重新创建它。删除所有 ph_* 表和 command_history 行,并删除所有结果表。
示例
下列示例删除现有的 sysadmin 数据库并在名为 dbsp1 的 dbspace 内创建新的 sysadmin
数据库:
EXECUTE FUNCTION task("reset sysadmin","dbs1");
下一个示例删除 sysadmin 数据库,然后在 rootdbs 中重新创建它。
EXECUTE FUNCTION admin("reset sysadmin");
除了内建任务、传感器和阈值之外,从 ph_ 表中删除所有数据行,通过这个函数调用从
sysadmin 删除所有结果表。该函数执行完成之后,command_history 表为空。