Possible Duplicate:
What is the difference between function and procedure in PL/SQL?
Functions always return a value, however when we use 'out' in a procedure that procedure also returns a value so please tell me when should we write a function and when should we write a procedure? What are the criteria on which we decide whether to use a procedure or a function?