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

how to make an oracle object

1856


Assuming today is Monday, how would you use the DBMS_JOB package to schedule the execution of a given procedure owned by SCOTT to start Wednesday at 9AM and to run subsequently every other day at 2AM.

1504


What is ceil and floor in oracle?

578


How to define a cusotmer as a supplier in ORACLE R12

1727


Can you tell me how to add new column in existing views?how?How is possible?

939






How i can handle exception in large code like 1000 line without distrubing the code or without exception handler sction?

2730


What do you mean by a database transaction & what all tcl statements are available in oracle?

553


What is data type in oracle?

564


What is dynamic proxy?

554


What is data block in Oracle?

618


How to define a specific record type?

622


What is oracle update statement with inner join ?

583


What are a collation and state the different types of collation sensitivity?

551


How many types of synonyms in Oracle?

600


How to get a create statement for an existing table?

572