我想編寫一個PL/SQL代碼塊,用於在更改前後顯示兩位員工的員工編號和薪水。PL/SQL顯示工資變更前後的工資
請告知
cursor cur is select employees.employee_ID, employees.salary
from employees
where employees.employee_ID=&employee_ID
AND employees.salary= employees.salary
sal number;
emp_ID number(10);
introduction clob;
begin
open cur;
loop
fetch cur into sal,emp_ID;
exit when cur>=2;
introduction := ' Display the Employees_ID and Salary before and after change.';
dbms_output.put_line(introduction);
DBMS_OUTPUT.PUT_LINE('employee_id =' || emp_ID);
DBMS_OUTPUT.PUT_LINE('Salary =' || Sal);
end loop;
close cur;
END;
這似乎與你在[你在前面的問題](http://stackoverflow.com/q/32147986/266304)中所做的非常相似。你有什麼嘗試,你有什麼問題適應? –
嘗試過光標,但沒有很好地與我合作 – Chaz
請修改您的問題以顯示您嘗試過的以及爲什麼它不起作用。如果你有錯誤,然後顯示這些,如果它給出了錯誤的結果顯示你有什麼和你的預期。我們不能從頭開始爲你寫全部內容。 –