我有一个表说EMPLOYER与EMPLOYER_ID作为主键。我编写以下脚本来更新表中的行:
declare
emp_row EMPLOYER%ROWTYPE;
begin
select * into emp_row from EMPLOYER where rownum <= 1;
emp_row.NAME := 'ABC';
emp_row.AGE := 99;
-- Can I write something like below?
update EMPLOYER set ??? = emp_row where EMPLOYER_ID = emp_row.EMPLOYER_ID;
end;
Run Code Online (Sandbox Code Playgroud)
我可以在单个语句中使用记录类型对象更新行吗?如上例所示。