我有几个块无法在Oracle SQL Developer 18.2.0.183中运行。我不确定我的代码块中是否遗漏了什么,或者我是否需要对开发人员进行一些更改。下面的代码块输出"Error starting at line :1 in command -“。(用于声明)。
declare
total_purchases number(7,2);
begin
total_purchases :=20;
case
when (total_purchases>200) then dbms_output.put_line(‘high’);
when (total_purchases>100) and total_purchases<200) then dbms_output.put_line(‘mid);
when (total_purchases<100) then dbms_output.put_line(‘low’);
end case;
end它还输出以下内容:

任何帮助都是非常感谢的。谢谢。
发布于 2018-10-02 13:40:39
我用"^“标记
declare
total_purchases number(7,2);
begin
total_purchases :=20;
case
when (total_purchases>200) then dbms_output.put_line('high');
when ((total_purchases>100) and total_purchases<200) then dbms_output.put_line('mid');
^ ^
when (total_purchases<100) then dbms_output.put_line('low');
end case;
end;
^发布于 2018-10-02 13:24:46
你有两个打字错误
when (total_purchases>100) and total_purchases<200) then dbms_output.put_line(‘mid);替换为
when (total_purchases>100 and total_purchases<200) then dbms_output.put_line(‘mid‘);发布于 2018-10-02 13:25:00
使用单引号('')未正确定义大小写
declare
total_purchases number(7,2);
begin
total_purchases :=20;
case
when (total_purchases>200) then dbms_output.put_line('high');
when (total_purchases>100) and total_purchases<200) then
dbms_output.put_line('mid');
when (total_purchases<100) then dbms_output.put_line('low');
end
endhttps://stackoverflow.com/questions/52602434
复制相似问题