想在 oracle dev6i 表格中获取当前年份
want to get current year In oracle dev6i forms
DECLARE
thisyear number(4,0);
BEGIN
thisyear := year(getdate());
END;
您可以使用EXTRACT
函数:
DECLARE
thisyear number(4,0);
BEGIN
thisyear := extract(year from sysdate);
END;
或者,您可以将 TO_CHAR
与格式字符串一起使用:
DECLARE
thisyear number(4,0);
BEGIN
thisyear := to_number(to_char(sysdate, 'YYYY'));
END;
DECLARE
thisyear number(4,0);
BEGIN
thisyear := year(getdate());
END;
您可以使用EXTRACT
函数:
DECLARE
thisyear number(4,0);
BEGIN
thisyear := extract(year from sysdate);
END;
或者,您可以将 TO_CHAR
与格式字符串一起使用:
DECLARE
thisyear number(4,0);
BEGIN
thisyear := to_number(to_char(sysdate, 'YYYY'));
END;