返回首页

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

更新日期:2024年09月11日

51% /data2

/dev/nvme2n1

rtoday() 函数返回系统日期作为 long integer 值。

语法
void rtoday(today)
int4 *today;
today
指向接收内部 DATE 的 int4 值的指针。

用法
rtoday() 函数取得客户机计算机上的系统日期,而不是服务器计算机上的。

示例
demo 目录在 rtoday.ec 文件中包含此样例程序。
/*
* rtoday.ec *
The following program obtains today's date from the system,
converts it to ASCII using rdatestr(), and displays the result.
*/

#include

main()
{
mint errnum;

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

char today_date[20];
int4 i_date;

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

/* Get today's date in the internal format */
rtoday(&i_date);
/* Convert date from internal format into a mm/dd/yyyy string */
if ((errnum = rdatestr(i_date, today_date)) == 0)
printf("\n\tToday's date is %s.\n", today_date);
else
printf("\n\tError %d in converting date to mm/dd/yyyy\n", errnum);

printf("\nRTODAY Sample Program over.\n\n");
}
输出

RTODAY Sample ESQL Program running.

Today's date is 09/16/2007.

RTODAY Sample Program over.

Incorrect number of arguments
标量函数转义语法传递了不正确的参数。正确的语法是 {fn function(arguments)}。
验证正确数的参数传递给了此函数。