What are main difference between Stored Procedure and
Functions.

Answer Posted / abhirup roy

In The above answers all the major differences have been disclosed, with one wrong information.
We can call a procedure from a function and vice-versa (as long as the function and procedure has same/similar scope).
In order to defend my point I am posting one small code below for reference.
DECLARE
PROCEDURE my_proc;
FUNCTION my_func RETURN NUMBER IS
BEGIN
my_proc;
RETURN -003;
END my_func;

PROCEDURE my_proc IS
BEGIN
DBMS_OUTPUT.PUT_LINE('22');
END my_proc;

BEGIN -- main
DBMS_OUTPUT.PUT_LINE(my_func);
END;

-- IT WILL WORK FOR EVERY OCCURRENCE --

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is a partition in oracle?

762


What is the data type of dual table?

685


Explain what are the advantages of views?

791


What are named parameters?

778


Name the three major set of files on disk that compose a database in Oracle?

811






What privilege is needed for a user to create views in oracle?

778


What are transaction isolation levels supported by oracle?

747


How do we represent comments in oracle?

805


A table t is there.If you perform insert ,update and delete then the trigger will fire.What is the minimum no of trigger required for a table.

4857


How to best split csv strings in oracle 9i?

781


What are the different windows events activated at runtime ?

2582


What are the original export and import utilities?

740


What types of joins are used in writing subqueries?

725


How to create a new table by selecting rows from another table?

804


What is varray?

768