Oracle Stored Procedures - Create a procedure
(Page 4 of 10 )
The SQL statement CREATE OR REPLACE PROCEDURE creates, compiles and saves a procedure on an Oracle database.
You need the CREATE PROCEDURE system privilege to create a procedure in your own schema.
Open SQL*Plus from Windows and log on to your database.
From SQL*Plus, open your skeleton.sql file.
SQL*Plus loads the contents of your skeleton.sql file into the SQL*Plus buffer or memory area and presents the SQL*Plus command prompt:
1 CREATE OR REPLACE PROCEDURE skeleton
2 IS
3 BEGIN
4 NULL;
5* END;
SQL>
Execute the contents of the SQL*Plus buffer. Type a front slash and press <enter> like this:
SQL> /
SQL*Plus informs you the procedure has been created successfully and presents the SQL command prompt:
Procedure created.
SQL>
Now your procedure is created, compiled and saved on your Oracle database.
We have a procedure now, so let's run it.
Next: Run a procedure >>
More Oracle Articles
More By Mooh the Cow
|
| · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | | |
|