它给出了这样的错误:日期格式图片在转换整个输入字符串之前结束
declare
v_t timestamp;
begin
v_t := to_timestamp(systimestamp,'DD/MM/YY')+interval '12-3' year to month;
DBMS_OUTPUT.PUT_LINE(v_t);
end;
它给出了这样的错误:日期格式图片在转换整个输入字符串之前结束
declare
v_t timestamp;
begin
v_t := to_timestamp(systimestamp,'DD/MM/YY')+interval '12-3' year to month;
DBMS_OUTPUT.PUT_LINE(v_t);
end;
SYSTIMESTAMP
已经是时间戳,所以您不想调用to_timestamp
. 如果要在当前时间戳上增加 12 年 3 个月
SQL> ed
Wrote file afiedt.buf
1 declare
2 v_t timestamp;
3 begin
4 v_t := systimestamp +interval '12-3' year to month;
5 DBMS_OUTPUT.PUT_LINE(v_t);
6* end;
SQL> /
20-JUL-24 03.27.28.966000 PM
PL/SQL procedure successfully completed.