What is the difference between function and procedure in PL/SQL ?
A procedure does not have a return value, whereas a function has.
Example:
CREATE OR REPLACE PROCEDURE my_proc
(p_name IN VARCHAR2 := 'John') as begin ... end
CREATE OR REPLACE FUNCTION my_func
(p_name IN VARCHAR2 := 'John') return varchar2 as begin ... end
Notice how the function has a return clause between the parameter list and the "as" keyword. This means that it is expected to have the last statement inside the body of the function read something like:
return(my_varchar2_local_variable);
Where my_varchar2_local_variable is some varchar2 that should be returned by that function.