Technical Training
Oracle 9i TrainingOracle 9i Procedures and Functions Page - 2
Oracle 9i Procedures and Functions
Functions:
A function is a PL/SQL subprogram, which is used to compute a value. Function is same like a procedure except for the difference that it have RETURN clause.
Syntax for Function

Examples
Function without arguments

Function with arguments. Different ways of executing the function.
Privileges for creation and execution of procedures To create a procedure in current user schema we use the syntax
CREATE OR REPLACE PROCEDURE
(<argslist) IS
To create procedure in any schema we use

-------
-------
CREATE OR REPLACE ANY PROCEDURE (<argslist) IS
-------
-------
To grant EXECUTE privilege to some user on a procedure we write
GRANT EXECUTE ON <procedure-name> TO <user-name>
SQL> SELECT * FROM USER_PROCEDURES;
Lists all the procedures, functions in current user.
SQL> SELECT * FROM USER_PROCEDURES;
Lists all the procedures, functions in all users.
SQL> DROP
PROCEDURE <procedure-name> ;
Drops or Removes a procedure from database.
SQL> DROP
FUNCTION <function-name> ;
Drops or Removes a function from database.
Oracle 9i Training
- Oracle 9i Utilities
- Oracle 9i Packages
- Oracle 9i Database Triggers
- Oracle 9i Procedures and Functions
- Oracle 9i PL/SQL Collections
- Oracle 9i Exception Handling
- Download example SQL Scripts used in Oracle 9i Tutorials
- Oracle 9i Cursors
- Oracle 9i PL/SQL Control Structures
- Building PL/SQL Blocks in Oracle 9i
- Oracle 9i Tables and Constraints
- More Oracle 9i Database Objects
- Introduction to Oracle 9i SQL, PLSQL, and SQL *Plus
- Oracle 9i Software Installation, SQL, PLSQL and SQL *Plus References







