Explain the difference between a FUNCTION, PROCEDURE and
PACKAGE.

Answer Posted / aleena

PROCEDURE:

cannot return a value

SYNTAX:
CREATE PROCEDURE procedure_name [argument datatype]
AS
BEGIN
sql statements
END;
/

FUNCTION:

returns a value

SYNTAX:

CREATE FUNCTION function_name [argument[IN] datatype]
RETURN datatype
AS
BEGIN
sql statements
END;
/


PACKAGES

Pakages are groups of functions,procedures,sql blocks
goruped together in a single unit.

there are two parts to creating a PACKAGE --1>CREATE
PACKAGE & 2> CREATE PACKAGE BODY

SYNTAX :
CREATE PACKAGE :

CREATE PACKAGE package_name
AS

FUNCTION function_name(datatype);
PROCEDURE procedure_name (datatype);
.......
.......(sql/plsql statements )
........
END;

CREATE PACKAGE BODY :

CREATE PACKAGE BODY packagebody_name
AS
FUNCTION function_name (datatype)
RETURN datatype
AS
.....
.....
.....
END function_name;
PROCEDURE procedure_name (datatype)
AS
......
.....
.....
END procedure_name
END PACKAGE;



Is This Answer Correct ?    46 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

i want to know about the javaBean.what is its purpose and how it can use in Forms.

1837


HOW TO SPOT AHIERARCHY?

1851


PURCHASE ORDER TO PAYABLES WHAT ENTREIS WILL HAVE

1705


Explain the use of table functions.

1807


can we use lexical perameter in oracle plsql if yes how

1828






Explain accounting for invoice in advance and arrears. : oracle accounts receivable

628


What is the Difference between the Person_Type_id column in the per_all_people_f and per_person_type_usages_f

3994


Hey i want to join oracle apps so will you pls tell me that which institute is best in hyderabad.

1853


What Are Cross Validation & Adi?

699


1.In a table Gender is a column in that male and female are the two data.In a single statement i have to modify all male to female and all female to male vice versa. 2.In a single query i need the count of male data,count of female and total count

16386


can u pls share responsibilities for production how to environment in odi?and how to generate report ?

1912


Difference between negative and positive adjustments : oracle accounts receivable

628


as a technical developer in oracle applications which type errors feced in your experience sofar

1913


Explain how to close periods in ar. : oracle accounts receivable

715


What is db_recovery_file_dest in oracle? When do you need to set this value?

655