difference between procedures and function?

Answers were Sorted based on User's Feedback



difference between procedures and function?..

Answer / nageswararao.k

procedures and functions are subprograms but triggre is not
a subprogram.
procedure:--once we create a procedure we can use that
procedure from any pl/sql block and any front end
application like java,.net applications.no need to execute
every time.
function:----using function ,we can reuse the code and
passed values though perameteres from calling function to
declared function.

Is This Answer Correct ?    5 Yes 1 No

difference between procedures and function?..

Answer / nageswararao.k

procedure and functions both are subprogrames.but trigger
is not a subprogram
procedure:--a procedure is created to perform one or more
DML operations.if we create procedure,then we can call the
procedure from any frontend application and any pl/sql
block.
procedures may or may not return a value .
we can not call procedure from select statement.
in procedure the out perameter return a value.


function:-the functions are created to do calculatiions and
computations.
function access some input and perform a task and must
return a value.the value return by return statement.
we can call the function from select statement.

Is This Answer Correct ?    3 Yes 0 No

difference between procedures and function?..

Answer / brahma412

i think procedure does not return any values.
but fuction returns value

Is This Answer Correct ?    4 Yes 3 No

difference between procedures and function?..

Answer / harika

we can insert images through procedures

but function may not

Is This Answer Correct ?    2 Yes 2 No

difference between procedures and function?..

Answer / quesanswer

1. Functions must return a value(scalar,inline table or
multi statement table) whereas stored proc may or may not
retun a value.
2.Functions can return a table whereas stored procs can
create a table but can't return table.
3. Stored procs can be called independently using exec
keyword whereas function are called using select statements.
4. Stored procs can be used to change server
configuration(in terms of security-i.e. setting granular
permissions of user rights) whereas function can't be used
for this
5. XML and output parameters can't be passed to functions
whereas it can be with sp's.
6.transaction related statement can be handled in sp whereas
it can't be in function.
7. stored procedures can call a funtion or another sstored
proc similarly a function can call another function and a
stored proc.The catch with function is that no user defined
stored proc can be called.Only extended/system defined procs
can be called.

Is This Answer Correct ?    0 Yes 0 No

difference between procedures and function?..

Answer / s.ramadevi

procedure,function both are subprograms.But procedure dont
return the value,function only return the datatype.

Is This Answer Correct ?    0 Yes 0 No

difference between procedures and function?..

Answer / mk

Function:-
A function is a predefined action which can consumed so that
retrieve the information from table in various scenario .
Procedure :-
procedure are SQl and PL/SQL code compile and stored in the
database.

Difference
Procedure

It may or may Not return a value
It can return multiple value also
It has both Input & output parameter
Doesn’t uses return statement for returning a value
Output Parameter will be specify using Output Clause
This allow select as well as DML operation
It support Transaction mgmt and error-handling using TRY and
Catch Block
They can call another procedure and function for Execution

Function
Function

It Must return a value
It can return only single value
It has both Input parameter
Uses return statement for returning a value
Output Parameter will be specify using Return Clause
This allow select as statement
Doesn’t support Transaction mgmt and error-handling using
TRY and Catch Block
They can call only another function for Execution



When will use :-

We will use procedure to perform complex business Logic as
well as we use function while performing simple
mathematical calculation.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Oracle General Interview Questions

What is the relation of a user account and a schema in oracle?

0 Answers  


How to Identify the previously inserted/updated records in already populated table.

0 Answers  


What is a table in oracle?

0 Answers  


what is Single Byte Overhead...?

0 Answers  


Please help me how to write a Query to change the primary key constraint from 1 attribute to another attribute in a table

3 Answers  






1.What is inline function in oracle and its purpose? 2.What is the equivalent operator for "different from pattern" in oracle? 3. If you define a variable in oracle, how it will be available? [a. Until database shut down b. Until table deleted c. until session get expired]

2 Answers  


What is Water Mark in Oracle?

7 Answers   Oracle,


What is the exact use of Collections?

0 Answers  


Table Has C1 And C2 Column If Exits any record in c1 then Update c2 record Otherwise insert new record in the C1 And C2 (Using Procedure)

4 Answers   Thermotech,


How many types of tables are there in oracle?

0 Answers  


How to connect to the server with user account: sys?

0 Answers  


Can multiple columns be used in group by in oracle?

0 Answers  


Categories
  • Oracle General Interview Questions Oracle General (1808)
  • Oracle DBA (Database Administration) Interview Questions Oracle DBA (Database Administration) (261)
  • Oracle Call Interface (OCI) Interview Questions Oracle Call Interface (OCI) (10)
  • Oracle Architecture Interview Questions Oracle Architecture (90)
  • Oracle Security Interview Questions Oracle Security (38)
  • Oracle Forms Reports Interview Questions Oracle Forms Reports (510)
  • Oracle Data Integrator (ODI) Interview Questions Oracle Data Integrator (ODI) (120)
  • Oracle ETL Interview Questions Oracle ETL (15)
  • Oracle RAC Interview Questions Oracle RAC (93)
  • Oracle D2K Interview Questions Oracle D2K (72)
  • Oracle AllOther Interview Questions Oracle AllOther (241)