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

what is the difference between ereg_replace() and eregi_replace()? : Sql dba

552


how to enter binary numbers in sql statements? : Sql dba

487


What is scope of pl sql developer in future?

589


What is indexing in sql and its types?

541


what is the difference between blob and text? : Sql dba

523






Why stored procedure is better than query?

505


what is myisam? : Sql dba

574


How does stored procedure reduce network traffic?

542


Are subqueries better than joins?

527


Which sorts rows in sql?

585


First round ------------------- - Procedure - Packages - Views - Virtual tables - Can we use dcl with in function? - Joins and few scenarios - Triggers and its type - Pragma, type and its functionality - How to create db link in oracle - Materialized view - How to find duplicate values from table? - Cursor and its functionality - Write a script to display friday and its date from a entire year. - Exception Handling Second round ------------------------ Gave a scenario like. Need to write a function to perform. When user try to change a password. It must not be last five password and a given password can be combination of characters, symbols, upper and lower case.

1136


Enlist the data types that can be used in pl/sql?

570


What types of commands can be executed in sql*plus?

547


how to escape special characters in sql statements? : Sql dba

508


How do I partition in sql?

536