I'm taking a pl/sql class for my last project we were creating object types. I know that oracle creates a default constructor method but I wrote my own. The instructor said that creating my own constructore method was unacceptable as it would be unsupportable with standard methodologies. My code runs fine and produces no errors. I haven't had a chance to talk to him about it, but I would like some input as to what I may have done incorrectly or what I've done to make it unsupportable. Thank You.

CREATE OR REPLACE TYPE cw_department AS OBJECT
(
deptno NUMBER,
dname VARCHAR2(30),
loc VARCHAR2(30),
CONSTRUCTOR FUNCTION cw_department(
deptno NUMBER,
dname VARCHAR2,
loc VARCHAR2)
RETURN SELF AS RESULT,
MEMBER PROCEDURE insert_dept(p_deptno in number, p_dname in varchar2, p_loc in varchar2),
MEMBER PROCEDURE delete_dept(p_deptno in number));
/


CREATE OR REPLACE TYPE BODY cw_department AS
CONSTRUCTOR FUNCTION cw_department(
deptno NUMBER,
dname VARCHAR2,
loc VARCHAR2)
RETURN SELF AS RESULT
IS
BEGIN
SELF.deptno := deptno;
SELF.dname := dname;
SELF.loc := loc;
RETURN;
END cw_department;
MEMBER PROCEDURE insert_dept(p_deptno in number, p_dname in varchar2, p_loc in varchar2) IS
v_deptno NUMBER := p_deptno;
v_dname VARCHAR2(30) := p_dname;
v_loc VARCHAR2(30) := p_loc;
department_exists exception;
BEGIN

BEGIN
SELECT DNAME,
LOC
INTO v_dname,
v_loc
FROM cw_dept_obj_table
WHERE DNAME = v_dname
AND LOC = v_loc;

IF v_dname IS NOT NULL THEN
RAISE department_exists;
END IF;

EXCEPTION
WHEN NO_DATA_FOUND THEN
NULL;
END;

INSERT INTO cw_dept_obj_table
VALUES(v_deptno,v_dname,v_loc);

EXCEPTION
WHEN department_exists THEN
DBMS_OUTPUT.PUT_LINE('Department: '||v_dname||' Location" '||v_loc||' already exists');
WHEN OTHERS THEN
DBMS_OUTPUT.PUT_LINE(SQLERRM(SQLCODE));
END insert_dept;

MEMBER PROCEDURE delete_dept(p_deptno in number) IS
v_deptno number;
BEGIN
SELECT DEPTNO
INTO v_deptno
FROM cw_dept_obj_table
WHERE DEPTNO = p_deptno;

DELETE FROM cw_dept_obj_table
WHERE DEPTNO = p_deptno;
DBMS_OUTPUT.PUT_LINE('Department Number '||p_deptno||' has been deleted');
EXCEPTION
WHEN NO_DATA_FOUND THEN
DBMS_OUTPUT.PUT_LINE('Department Number '||p_deptno||' does not exist');
END delete_dept;
END;
/