返回首页

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

更新日期:2024年09月11日

函数原型:

sword
GCIDirPathColArrayToStream(









GCIDirPathColArray *dpca,









GCIDirPathCtx *dpctx,









GCIDirPathStream *dpstr,









GCIError *errhp,









ub4 rowcnt,












ub4 rowoff











功能描述:

用于与Oracle 程序保持兼容。

bycopy() 函数将给定的字节数从一个位置复制到另一个。

语法
void bycopy(from, to, length)
char *from;
char *to;

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

mint length;
from
指向您想要 bycopy() 复制的该组字节的第一个字节的指针。
to
指向目的字节组的第一个字节的指针。
to 指向的内存区域可与 from 参数指向的区域
交叠。在此情况下,GBase 8s ESQL/C 不保留 from 指向的值。
length
您想要 bycopy() 复制的字节数。
重要: 请注意,不要重写目标区域相邻的内存区域。

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

The following program shows the results of bycopy() for three copy operations.
*/

#include

char dest[20];

main()
{
mint number1 = 12345;
mint number2 = 0;
static char string1[] = "abcdef";
static char string2[] = "abcdefghijklmn";

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

printf("String 1=%s\tString 2=%s\n", string1, string2);
printf(" Copying String 1 to destination string:\n");

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

bycopy(string1, dest, strlen(string1));
printf(" Result = %s\n\n", dest);

printf(" Copying String 2 to destination string:\n");
bycopy(string2, dest, strlen(string2));
printf(" Result = %s\n\n", dest);

printf("Number 1=%d\tNumber 2=%d\n", number1, number2);
printf(" Copying Number 1 to Number 2:\n");
bycopy( (char *) &number1, (char *) &number2, sizeof(int));
printf(" Result = number1(hex) %08x, number2(hex) %08x\n",
number1, number2);

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

String 1=abcdef String2=abcdefghijklmn
Copying String 1 to destination string:
Result = abcdef

Copying String 2 to destination string:
Result = abcdefghijklmn

Number 1=12345 Number2=0
Copying Number 1 to Number 2:
Result = number1(hex) 00003039, number2(hex) 00003039

BYCOPY Sample Program over.

kdestroy [-A] [-q] [-c cache_name]