What are main difference between Stored Procedure and
Functions.
Answer Posted / hemanth
1) functions are used for computations where as procedures
can be used for performing business logic
2) functions MUST return a value, procedures need not be.
3) you can have DML(insert, update, delete) statements in a
function. But, you cannot call such a function in a SQL query..
eg: suppose, if u have a function that is updating a table..
you can't call that function in any sql query.
- select myFunction(field) from sometable;
will throw error.
4)We can call a function from a procedure, but it is not
possible to call a procedure from a function
Is This Answer Correct ? | 6 Yes | 4 No |
Post New Answer View All Answers
What are the restrictions on external table columns?
How many memory layers are in the oracle shared pool?
Why use resource manager in Oracle?
What do you understand by database schema and what does it hold?
How will you write a query to get a 5th rank student from a table student_report?
How to retrieve data from an cursor to a record?
What is oracle in java?
How to rebuild an index in oracle?
How to create a temporary table in oracle?
Explain drop constraint oracle?
> CREATE OR REPLACE FUNCTION FACTORIAL_1(factstr varchar2 ) 2 RETURN NUMBER AS 3 new_str VARCHAR2(4000) := factstr||'*' ; 4 fact number := 1 ; 5 BEGIN 6 7 WHILE new_str IS NOT NULL 8 LOOP 9 fact := fact * TO_NUMBER(SUBSTR(new_str,1,INSTR(new_str,'*')-1)); 10 new_str := substr( new_str,INSTR(new_str,'*')+1); 11 END LOOP; 12 13 RETURN fact; 14 15 END; explanation Above program?
Give the different types of rollback segments.
What is translate in oracle?
What are the system predefined user roles?
22. Display the order number, number of lines in the order, total number of items and total value for all orders that have a total value greater than $100