gpt4 book ai didi

oracle - 在此PL/SQL语句中我在做什么错?

转载 作者:行者123 更新时间:2023-12-03 08:23:25 25 4
gpt4 key购买 nike

有人可以帮我解决我在这个小陈述中做错的事情吗?

declare

cursor emp_cursor is
select employee_id, quantity * salary AS price
from employees;

emp_row emp_cursor%rowtype;

begin

open emp_cursor;

if (price < 2,000)
then price := 2,000 * 0.15;
else if (price >= 2,000)
then price := 2,000 * 0.20;
loop
fetch emp_cursor into emp_row;
exit when emp_cursor%notfound;
dbms_output.put_line(emp_row.employee_id || ' ' || emp_row.price);
end loop;

close emp_cursor;

end;

我正在使用pl/sql开发人员。

最佳答案

在比较中摆脱“,”:

if (price < 2,000)

是语法错误。如果您的意思是2E0,则只需写2;如果您的意思是2E3,则写2000。

关于oracle - 在此PL/SQL语句中我在做什么错?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20003446/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com