I am new to PLSQL and I am slightly confused on how to add to increase decrease a variable value.
I have an employee table where I am trying to increase the commission rate and decrease some of the commission rates. However when ruining the script the changes to the commission rates are not changed on the employees table e.g one employees initial commission rate is 0.2 I want to add an increase by 0.4.

At the moments this is the PLSQL that I wrote:
SET ECHO OFF
SET VERIFY OFF
SET DOCUMENT OFF
SET SERVEROUTPUT OFF
/* Ask for the employee ID number */
PROMPT Please enter the employees id number:
ACCEPT p_emp_id
/* Declarative section */
DECLARE
/* Declare local block variables */
/* Set local v_employee_id to that inputted by the user */
v_employee_id employees.employee_id%TYPE := &p_emp_id;
v_job_id employees.job_id%TYPE;
v_salary employees.salary%TYPE;
v_commission_pct employees.commission_pct%TYPE;
BEGIN
SELECT job_id, salary, COMMISSION_PCT
INTO v_job_id, v_salary, v_commission_pct
FROM employees
WHERE employee_id = v_employee_id;
IF v_job_id = 'SA MANG' AND Salary = 10500
THEN v_commission_pct := v_commission_pct + 0.4
ELSE
IF v_job_id = 'SA MANG' AND v_salary = 10500
THEN v_commission_pct := v_commission_pct + 0.4;
ELSIF v_job_id = 'SA_REP' AND v_salary = 9000
THEN
v_commission_pct := v_commission_pct - 0.25;
END IF;
END IF;
END IF;
/* Update the corresponding row for the employee with
the new commission */
UPDATE employees
SET commission_pct = v_commission_pct
WHERE employee_id = v_employee_id;
/* End anonymous PL/SQL block */
END;
/
/* Display the details of the new employee */
SELECT employee_id, job_id, salary, commission_pct
FROM employees
WHERE employee_id = '&p_emp_id';
SET SERVEROUTPUT ON
SET DOCUMENT ON
SET VERIFY ON
SET ECHO ON
nvl(COMMISSION_PCT, 0), andnull + 0.4is null.COMMIT;at the end of your anonymous block, right before theEND;of the block. Share and enjoy.