ora-01861:literal does not match format string

declare
startDate date;
begin
select to_char(sysdate,'yyyy-MM-dd HH24:mi:ss')
into startDate
from dual;
dbms.output.put_line(to_char(startDate));
end;
我想要输出:2014-03-12 15:31:27这种格式
最新回答
听一首歌流一夜泪

2025-03-30 06:37:28

startDate date; 你这里定义了日期类型,但是 to_char(sysdate,'yyyy-MM-dd HH24:mi:ss')是字符串类型,类型不一致。你改成:startDate varchar2(20);