Adding Procedures/Functions to an existing Oracle Package
Hi All,
I would like to know if I can add a function to an existing package. For example, here is how my package is defined:
CREATE OR REPLACE PACKAGE BODY cpack AS
PROCEDURE AddStudent (p_id in students.id%TYPE) IS
BEGIN
INSERT INTO students (id) values (p_id);
COMMIT;
END AddStudent;
END cpack;
The above package has already been created in the database.
I would like to add another procedure to the above package:
create or replace procedure DropStudent (p_id IN students.id%TYPE)
AS
BEGIN
DELETE from students WHERE id = p_id;
COMMIT;
END DropStudent;
Questions:
1. Is it possible to add this procedure to the existing package?
2. Is it any different when we add functions to an existing package?
3. Any syntax you can provide in doing so would be greatly appreciated.
Thanks,
Sankar.