Original works, from the "Blue Blog" blog, Welcome to reprint, please be sure to indicate the following sources, otherwise, the legal responsibility to pursue copyright.
Deep Blue Blog: http://blog.csdn.net/huangyanlong/article/details/43938953
Start the experiment:
(1), query the original data, use the Scott user to conduct the experiment
sql> Select t.*, T.rowid from EMP T
(2), write the stored procedure and execute, as follows:
Create or Replace procedure p_delete_empno (empid in number) is
Begin
Delete from emp where emp.empno=empid;
commit;
End P_delete_empno;
-- parameter Description
--p_delete_empno represents the name of the Create stored procedure
--empid in number represents a parameter in a stored procedure, defined here as Number type
--begin , End keywords that start and end for a stored procedure
(3), test the stored procedure
sql> Select * from EMP;
-- query data, employee number is 7902 the employee information exists as follows
Perform the following actions in the command window:
Sql> Execute P_delete_empno (7902);
sql> Select * from EMP;
-- start the query again, the employee number is 7902 employee information no longer exists.
At this point, a simple stored procedure that deletes employee information based on the employee number has been demonstrated.
Original works, from the "Blue Blog" blog, Welcome to reprint, please be sure to indicate the following sources, otherwise, the legal responsibility to pursue copyright.
Deep Blue Blog: http://blog.csdn.net/huangyanlong/article/details/43938953
Sql_ writing a simple stored procedure to delete employee information