Home >Database >Mysql Tutorial >pl/sql中操作DML语句

pl/sql中操作DML语句

WBOY
WBOYOriginal
2016-06-07 14:54:001592browse

7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 INSERT DECLARE v_empno emp.empno%TYPE := empno; v_ename emp.ename%TYPE := ename; v_salary emp.sal%TYPE := sal; BEGIN INSERT INTO emp(empno,ename,sal) VALUES(v_empno,v_e

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

INSERT

  

 DECLARE

 v_empno emp.empno%TYPE := &empno;

 v_ename emp.ename%TYPE := ‘&ename’;

 v_salary emp.sal%TYPE := &sal;

 BEGIN

 INSERT INTO emp(empno,ename,sal)

 VALUES(v_empno,v_ename,v_salary);

 COMMIT;

 END;

  

 UPDATE

  

 DECLARE

 v_empno emp.empno%TYPE;

 v_salary emp.sal%TYPE :=&sal;

 BEGIN

 UPDATE emp SET sal=v_salary where empno=1234;

 COMMIT;

 END;

  

 DELETE

  

 DECLARE

 v_empno emp.empno%TYPE :=&eno;

 BEGIN

 DELETE emp WHERE empno=v_empno;

 COMMIT;

 END

  在PL/SQL中& 表示弹出框提示你输入值

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn