First, the table
Second, write the stored procedure
1 Create or Replace procedureRaisesalary (aidinch Number)--aid: Yes fix passed in Parameter name in: Yes indicates incoming parameter (and outgoing parameter) Number: is the data type 2 as 3Salaryfirst EMPLOYEE. SALARY%Type--define an original salary, type salary field type in the Employee table 4 begin 5 SelectSALARY intoSalaryfirst fromEMPLOYEEwhereEID=aid;6 UpdateEMPLOYEESetSALARY=SALARY+ - whereEID=aid;7Dbms_output.put_line ('The original is:'||Salaryfirst||'; After:'||(Salaryfirst+ -)); 8 End; 9 /Ten One --Modify to commit a transaction? To! A --However: Transactions are not typically committed and rolled back in stored procedures and functions, but are committed or rolled back in a program that is used outside.
Third, call the stored procedure (I found not to write a commit can also commit a transaction, as for why I do not know now, I should know later.) )
2.PLSQL writing simple stored procedures (incoming parameters, modify + print)