每次我运行它并添加“黄色”或“红色”或“蓝色”作为输入时,都会出现相同的错误。
set serveroutput on
undefine color1
undefine color2
accept color1 prompt 'Type the 1st primary color: '
accept color2 prompt 'Type the 2nd primary color: '
begin
if &color1 = &color2 then
dbms_output.put_line(&color1||' plus '||&color2||' then '||&color1);
elsif (&color1 = 'red' and &color2 = 'blue') or (&color2 = 'red' and &color1 = 'blue') then
dbms_output.put_line(&color1||' plus '||&color2||' is purple');
elsif (&color1 = 'red' and &color2 = 'yellow') or (&color2 = 'red' and &color1 = 'yellow') then
dbms_output.put_line(&color1||' plus '||&color2||' is orange');
else
dbms_output.put_line(&color1||' plus '||&color2||' is green');
end if;
end;
/
错误:
ORA-06550: line 2, column 7:
PLS-00201: identifier 'BLUE' must be declared
ORA-06550: line 2, column 4:
PL/SQL: Statement ignored
请帮忙!:)