what is difference between procedure and function,
procedure and trigger?

Answer Posted / gvk

functions and procedures:
1.Functions Returns a value, procedure not return a value.
2.parsed & compiled at runtime, Procedure stored as a
pseudo code in database ie. Compiled form.
3.Cannot effect the state of database,sp effect the state
of database using Commit etc..
4.mainly used to compute the values, sp used to process the
tasks.
5.It can be invoked from sql statement :eg:select, sp can
not invoked.
6.it is not accept more than one argument.sp accept more
than one argument.

Trigger and procedure:

1.It is run Automatically , sp run it manually.
2.With in a trigger u can call the sp, with in a sp u can
not call the trigger.
3.when u r creating the trigger u have to identify event
and action of your trigger. not possible in sp.
4.Trigger not pass the arguments but sp pass the arguments.

Is This Answer Correct ?    1 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to run pl/sql statements in sql*plus?

752


What are the methods of filing?

673


What are the different tcl commands in sql?

810


what is rdbms? : Sql dba

755


Explain scalar functions in sql?

768






Is not null in sql?

723


Is sql a backend language?

839


What is pl/sql table? Why it is used?

725


What is pl sql commands?

728


What is primary key and foreign key with example?

676


Can we join more than 2 tables in sql?

674


How do you clear the screen in sql?

776


Explain the uses of database trigger.

844


What pl/sql package consists of?

831


What is the difference between drop and truncate commands?

694