Trying to get to grips with user-defined exceptions by working through this example. It looks fine to me yet I keep getting
Error at Line 7:
ORA-06550: Encountered the symbol "INTO" when expecting one of the following: .,@;for<an identifier>
DECLARE
my_empid employee.empid%TYPE := 39334;
my_emp_record employee%ROWTYPE;
my_salary_null EXCEPTION;
BEGIN
SELECT * FROM employee
INTO my_emp_record
WHERE empid = my_empid;
IF my_emp_record.salary IS NULL THEN
RAISE my_salary_null;
END IF;
EXCEPTION
WHEN my_salary_null THEN
DBMS_OUTPUT.PUT_LINE ('Salary column was null for employee');
END;
Scratching my head --All help gratefully received
Error at Line 7:
ORA-06550: Encountered the symbol "INTO" when expecting one of the following: .,@;for<an identifier>
DECLARE
my_empid employee.empid%TYPE := 39334;
my_emp_record employee%ROWTYPE;
my_salary_null EXCEPTION;
BEGIN
SELECT * FROM employee
INTO my_emp_record
WHERE empid = my_empid;
IF my_emp_record.salary IS NULL THEN
RAISE my_salary_null;
END IF;
EXCEPTION
WHEN my_salary_null THEN
DBMS_OUTPUT.PUT_LINE ('Salary column was null for employee');
END;
Scratching my head --All help gratefully received