Вы находитесь на странице: 1из 1

Difference between Procedure and Function in PL/SQL

Procedure can performs one or more tasks where as function performs a specific t
ask.
we can call functions in select statement where as procedure we can not call.
We can call function within procedure but we can not call procedure within funct
ion.
A Function must be part of an executable statement, as it cannot be executed ind
ependently where as procedure represents an independent executable statement.
Function can be called from SQL statement where as procedure can't be called fro
m the SQL statement.
Function are normally used for computation where as procedure are normally used
for executing business logic.
Stored procedure supports deferred name resolution where as function wont suppor
t.
Stored procedure returns always integer value by default zero. where as function
returns type could be scalar or table or table value.
Stored procedure is pre compiled execution plan where as function are not.
Procedure:
Procedure allow the DML statements without any restrictions
We can store images in stored procedure
Procedure may or may not return value where as function should return one value.
Function:
Function not allow the DML statements (If you need to use we can use pragma)
Function can t store images

Вам также может понравиться