-3

I would like to know about difference between stored procedure and function in oracle.As a fresher to oracle,can you all help me to know the differences?

2
  • You should have googled first, my friend. Commented Jul 29, 2015 at 10:55
  • 1
    The documentation is very helpful for this sort of thing. Also see the second paragraph at the top of that page: "Typically, you use a procedure to perform an action and a function to compute and return a value", which is common practice, though not enforced. Commented Jul 29, 2015 at 10:57

1 Answer 1

2

A function generally returns a single value in Oracle (be it a scalar value, or a single defined object/data-table). A procedure on the other hand can return any number of outputs and does not need to actually have any inputs OR any outputs.

If you need to do JOIN-like behaviour then you'll need to use a function to apply the function against individual rows with varying input. Oracle functions are semantically more graceful than functions - but are harder to optimise and see inside of sometimes.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.