I'm wondering that if someone tell me that When should I go for the
FUNCTION?.. I did research and I think if we have to perform some sequence of statements then we use procedure and if we need to perform some calculation then we create function. In addition, When we need to assign function return value into variable. Appreciate you valuable suggestion... Many Thanks
From the Glossary
A schema object that consists of a set of SQL statements and other PL/SQL constructs, grouped together, stored in the database, and run as a unit to solve a specific problem or perform a set of related tasks.
A schema object, similar to a PL/SQL procedure, that always returns a single value.
One important distinction is that only functions can be called from SQL statements.
Som restrictions apply. If a function is called from a SQL statement, that function must not perform any DML (such as INSERT), or call any other function or procedure that does. If a function is called from a SQL statement, it must not have any OUT or IN OUT arguments.
How do you plan to use the procedure or function? Give some specific examples of things you might want to do in PL/SQL, and then people can give you specific answers.