『ORACLE』 PLSQL更新数据示例(11g)

SQL> select * from dept1 where deptno=20;

DEPTNO DNAME LOC
---------- -------------- -------------
20 RESEARCH DALLAS

SQL> declare
2 v_deptno dept.deptno%TYPE :=20;
3 V_loc dept.loc%TYPE :='BEIJING';
4 begin
5 update dept1 set loc=v_loc where deptno=v_deptno;
6 end;
7 /

PL/SQL procedure successfully completed.

SQL> select * from dept1 where deptno=20;

DEPTNO DNAME LOC
---------- -------------- -------------
20 RESEARCH BEIJING

原文地址:https://www.cnblogs.com/KT-melvin/p/6848902.html