Substitution Variables in PL/SQL
Posted on 2006-05-18
I'm trying to add a new department in to my DEPARTMENTS table. I want to have information about the new department (name, manager_id, location) come from substitution variables. But, I'm getting errors for variables not being defined...etc.
How do I use substitution variables correctly to make this code work? What exactly ARE substitution variables?
Here's the code that I'm using (I'm using iSQL* Plus):
SET ECHO OFF
SET VERIFY OFF
SELECT MAX(department_id) + 10
INSERT INTO departments (department_id, department_name, manager_id, location_id)
VALUES (v_max_deptno, '&p_dept_name', '&p_manager_id', '&p_dept_loc');
SET ECHO ON
SET VERIFY ON