declare
v_date varchar2(15);
begin
v_date := to_char(sysdate, 'DAY');
if upper(v_date) = to_char('TUESDAY') then
dbms_output.put_line('Today is Tuesday');
else
dbms_output.put_line('Today is not tuesday'|| upper(v_date) );
end if ;
end;
答案 0 :(得分:1)
请调整你从to_char获得的值,然后你应该得到正确的结果
declare
v_date varchar2(15);
begin
v_date := to_char(sysdate, 'DAY');
if trim(v_date) = 'TUESDAY' then
dbms_output.put_line('Today is Tuesday');
else
dbms_output.put_line('Today is not tuesday '|| v_date );
end if ;
end;