我尝试了以下代码的不同方式,比如取出while或if,但是当我把它们放在一起时(if和while),我总是得到错误...
undefine numero
set serveroutput on
accept numero prompt 'Type # between 100 and 999: '
declare
i number:=1;
a char(25);
b char(1);
c varchar2(10);
d number;
begin
c := №
d := length(c);
b := substr(c, i, 1);
while i <= d loop
if b = '1' then
a:= a||'one ';
end if;
i := i+1;
end loop;
dbms_output.put_line('The number is '||a);
end;
/
Run Code Online (Sandbox Code Playgroud)
错误:
ORA-06502: PL/SQL: numeric or value error: character string buffer too small
ORA-06512: at line …Run Code Online (Sandbox Code Playgroud)