DECLARE
thisyear number(4,0);
BEGIN
thisyear := year(getdate());
END;发布于 2017-10-19 05:07:10
您可以使用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;https://stackoverflow.com/questions/46823022
复制相似问题