-
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.
Last edited by sankar6254; 03-21-2005 at 07:25 PM.
Sankar B. Mandalika
-
There is no command to add a procedure or function, you just replace the existing package and body definitions with "create or replace package ..." and "create or replace package body ..."
-
Thanks you very much for the detailed explanation. It worked great.
Sankar B. Mandalika
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|