我想显示:员工 id、员工姓名、工作 id、薪水,对于 4 名员工有像 SA_MAN 这样的工作 id 并且使用循环语句的薪水 >10000 我写了这段代码,但我得到了一个错误
这段代码有什么问题?
DECLARE
emp_name employees.last_name%type;
emp_id employees.employee_id%type;
sal employees.salary%type;
jobid employees.job_id%type;
BEGIN
SELECT employee_id,
last_name,
job_id,
salary
INTO emp_id,
emp_name,
jobid,
sal
FROM employees
WHERE salary>10000
AND job_id LIKE'%SA\_%N' ESCAPE'\';
FOR i 1..3 dpms_output.put_line(emp_id||' '||emp_name||' '||jobid||' '||sal);
END LOOP;
END;
这是我得到的错误:
Error starting at line 1 in command:
DECLARE
emp_name employees.last_name%type;
emp_id employees.employee_id%type;
sal employees.salary%type;
jobid employees.job_id%type;
BEGIN
SELECT employee_id,
last_name,
job_id,
salary
INTO emp_id,
emp_name,
jobid,
sal
FROM employees
WHERE salary>10000
AND job_id LIKE'%SA\_%N' ESCAPE'\';
FOR i 1..3 dpms_output.put_line(emp_id||' '||emp_name||' '||jobid||' '||sal);
END LOOP;
END;
Error report:
ORA-06550: line 20, column 7:
PLS-00103: Encountered the symbol "1" when expecting one of the following:
in
06550. 00000 - "line %s, column %s:\n%s"
*Cause: Usually a PL/SQL compilation error.
*Action: