表架构
jobs(v_id, v_name, v_salary)
我想在v_name
参数
v_salary
的{{1}}和id
IN
错误找不到预期的create or replace procedure jobs_select(
id IN jobs.v_id%TYPE,
position OUT jobs.v_position%TYPE,
salary OUT jobs.v_salary%TYPE
)
IS
BEGIN
select v_position into position, v_salary
into salary from jobs where v_id = id;
dbms_output.put_line('Position: ' || position
|| ' Salary: ' || salary);
END;
/
答案 0 :(得分:2)
现在编辑的select语句中存在错误,请检查以下内容:
create or replace procedure jobs_select(
id IN jobs.v_id%TYPE,
position OUT jobs.v_position%TYPE,
salary OUT jobs.v_salary%TYPE
)
IS
BEGIN
select v_position, v_salary into
position, salary
from jobs where v_id = id;
dbms_output.put_line('Position: ' || position
|| ' Salary: ' || salary);
END;
/
-- And executed it like this:
set serveroutput on;
Declare
v_id Number := 9999;
v_name varchar2(100);
v_salary number;
Begin
jobs_select(v_id, v_name, v_salary);
end;
/