declare
msg varchar2(32);
p_name varchar2(32);
outresult varchar2(64);
begin
p_name := 'xxxx';
select loginname into MSG from users where loginname = p_name and 1=2;
dbms_output.put_line(MSG);
exception
when others then
outresult := 'failure---' || sqlerrm || ' ' || p_name;
dbms_output.put_line(outresult);
end;
字符类型的变量必须声明其精度