The document describes a stored procedure called EmployeeTransaction that is used to update employee account balances. It executes the stored procedure multiple times with different employee IDs and transaction amounts, resulting in one employee's balance decreasing due to a negative transaction amount, while another employee's balance increases from positive transaction amounts. The stored procedure is used to demonstrate how transaction amounts can impact employee account balances.
The document describes a stored procedure called EmployeeTransaction that is used to update employee account balances. It executes the stored procedure multiple times with different employee IDs and transaction amounts, resulting in one employee's balance decreasing due to a negative transaction amount, while another employee's balance increases from positive transaction amounts. The stored procedure is used to demonstrate how transaction amounts can impact employee account balances.
The document describes a stored procedure called EmployeeTransaction that is used to update employee account balances. It executes the stored procedure multiple times with different employee IDs and transaction amounts, resulting in one employee's balance decreasing due to a negative transaction amount, while another employee's balance increases from positive transaction amounts. The stored procedure is used to demonstrate how transaction amounts can impact employee account balances.
a. CALL EmployeeTransaction(1,200,2); b. CALL EmployeeTransaction(2,300,3); c. CALL EmployeeTransaction(3,400,4);
4. Execute the Stored Procedure CALL EmployeeTransaction(1,-75,2);
What happen to the account of employee#1? Why?
- As 'dAmount' now has a value of -75, every transaction that has been given to the procedure will result in a -75 deduction from Employee#1's current balance. 5. Execute the Stored Procedure CALL EmployeeTransaction(2,500,2);
What happen to the account of employee#2? Why?
- For each transaction that has been given to procedure, the new value for "dAmount" is 500 and it is not negative, therefore it will increase Employee#2's current balance.