『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

posted @ 2017-05-13 14:23  九號栈長  阅读(1191)  评论(0编辑  收藏  举报