返回首页

gbase数据、南大通用产品文档:GBase8sWindows 环境变量的优先顺序规则

更新日期:2024年09月11日


GBase 8s SQL 指南:参考
南大通用数据技术股份有限公司 - 143 -

当 GBase 8s 产品访问环境变量时,通常下列优先级规则适用:
1.
具有选中的 Use my settings 框的 Setnet32 中的设置
2.
具有未选中的 Use my settings 框的 Setnet32 中的设置
3.
在运行应用程序之前对命令行的设置。
4.
作为用户变量在 Windows™ 中的设置。
5.
作为系统变量在 Windows 中的设置。
6.
最低优先级授予缺省值。
在应用程序启动时它检验最初的五个值。除非另有说明,否则在运行应用程序之
后再更改环境变量将不会起任何作用。

当传递给 rleapyear() 函数的是闰年时,它返回 1(TRUE),当不是时,它返回 0
(FALSE)。

语法
mint rleapyear(year)
mint year;
year
整数。

用法
参数 year 必须是日期的年份组件,而不是该日期本身。您必须必须以完整的形式
(2007),而不是缩写的形式(07)来表达 year。

返回代码
1
该年份为闰年。
0
该年份不是闰年。
示例

GBase 8s ESQL/C 编程指南
南大通用数据技术股份有限公司
- 890 -
demo 目录在 rleapyear.ec 文件中包含此样例程序。
/*
* rleapyear.ec *

The following program accepts a date entered from the console and stores this date into an
int4, which stores the date in an internal format. It then converts the internal format into an array
of three short integers that contain the month, day, and year portions of the date. It then tests the
year value to see if the year is a leap year.
*/

#include

main()
{
int4 i_date;
mint errnum;
short mdy_array[3];
char date[20];
mint x;

static char fmtstr[9] = "mmddyyyy";

printf("RLEAPYEAR Sample Program running.\n\n");

/* Allow user to enter a date */
printf("Enter a date as a single string, month.day.year\n");
gets(date);

printf("\nThe date string is %s.\n", date);

/* Put entered date in internal format */
if (x = rdefmtdate(&i_date, fmtstr, date))
printf("Error %d on rdefmtdate conversion\n", x);
else

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

/* Convert internal format into a MDY array */
if ((errnum = rjulmdy(i_date, mdy_array)) == 0)
{
/* Check if it is a leap year */
if (rleapyear(mdy_array[2]))
printf("%d is a leap year\n", mdy_array[2]);
else
printf("%d is not a leap year\n", mdy_array[2]);
}
else
printf("rjulmdy() call failed with error %d", errnum);
}

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

Enter a date as a single string, month.day.year
10.12.07

The date string is 10.12.07.
2007 is not a leap year

RLEAPYEAR Sample Program over.

参数说明:控制是否开启自动打印执行计划。该参数是用来定位慢存储过程或慢查询,
只对当前连接的数据库主节点有效。

GBase 8c V5 开发者手册
南大通用数据技术股份有限公司
1270
该参数属于USERSET 类型参数,请参考表15-1 中对应设置方法进行设置。
取值范围:布尔型

true 表示开启。

false 表示关闭。
默认值:false