返回首页

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

更新日期:2024年09月11日

语法
use vc vc_name;

SQLAllocStmt
在ODBC 3.x 版本中,ODBC 2.x 的函数SQLAllocStmt 已被SQLAllocHandle 代替。有
关详细信息请参阅8.2.3 SQLAllocHandle。

ldchar() 函数将定长的字符串复制至以空终止的字符串内,并移除任何结尾的空格。

语法
void ldchar(from, count, to)
char *from;
mint count;
char *to;
from
指向定长的源字符串的指针。
count
定长的源字符串中的字节数。
to
指向以空为终止的目标字符串的第一个字节的指针。
to 参数可指向与 from 参数相同
的位置,或指向覆盖 from 参数的位置。如果如此,则 ldchar() 不保留 from 指向的值。

示例
demo 目录中 ldchar.ec 的文件中为此样例程序。
/*
* ldchar.ec *

The following program loads characters to specific locations in an array that is initialized
to z's. It displays the result of each ldchar() operation.
*/

#include

main()

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

{
static char src1[] = "abcd ";
static char src2[] = "abcd g ";
static char dest[40];

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

ldchar(src1, stleng(src1), dest);
printf("\tSource: [%s]\n\tDestination: [%s]\n\n", src1, dest);

ldchar(src2, stleng(src2), dest);
printf("\tSource: [%s]\n\tDestfination: [%s]\n", src2, dest);

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

Source: [abcd ]
Destination: [abcd]

Source: [abcd g ]
Destination: [abcd g]
LDCHAR Sample Program over.