Question : proc and package for simple code

I need to create one proc and add it to a package, and leave room for adding more proc as the application grows.

is the foll syntax ok? what would you recommend different?

thanks
------------------------
CREATE PROCEDURE NAMEOFPROC AS
   BEGIN
INSERT ..............;
DBMS_OUTPUT.put_line ('Rows Inserted ' || SQL%ROWCOUNT);
UPDATE................;
DBMS_OUTPUT.put_line ('Rows Updated ' || SQL%ROWCOUNT);
   END;

CREATE PACKAGE NEW_PACKGE_FOR_PROC AS  
   PROCEDURE NAMEOFPROC;
--New Procedures will be added here later;
END NEW_PACKGE_FOR_PROC;

Answer : proc and package for simple code

the package procedures are part of the package body.
you cannot create a procedure "outside" of the package, unless you make the package body procedures just a wrapper for the external procedures
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
CREATE PACKAGE NEW_PACKGE_FOR_PROC AS  
   PROCEDURE NAMEOFPROC;
--New Procedures will be added here later;
END NEW_PACKGE_FOR_PROC;

CREATE PACKAGE BODY NEW_PACKGE_FOR_PROC AS  
PROCEDURE NAMEOFPROC AS
BEGIN
INSERT ..............;
DBMS_OUTPUT.put_line ('Rows Inserted ' || SQL%ROWCOUNT);
UPDATE................;
DBMS_OUTPUT.put_line ('Rows Updated ' || SQL%ROWCOUNT);
END; -- end procedure
END; -- end package body
Random Solutions  
 
programming4us programming4us