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

Explain the difference between $ORACLE_HOME and $ORACLE_BASE.

6736


What is the importance of batch source set up in ar? : oracle accounts receivable

716


What do you mean by hz_ in customer tables? : oracle accounts receivable

642


IS IT POSSIBLE TO CREATE REPORTS FROM DIFFERENT UNIVERSES IN ONE DOCUMENT?

1622


Hi, I want to know basic information about Oracle HRMS and the institutes in hyderabad or the best faculty as i want to make my career in it.And also want to know may a person from non technical background be able to do this course. Regards, Swetha

1957






What do you mean by Oracle MEDIA RECOVERY?

725


where the dff data will be stored

1803


What is the use of lockboxes? : oracle accounts receivable

655


what are basic modules required to implement oracle application in any oraganisation?

1700


what are all the conversion and interfaces in GL,AP,AR,HRMS with example? otherwise send send link for these

1831


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

617


Explain about party and customer in ar : oracle accounts receivable

726


what are all the conversion and interfaces in GL,AP,AR,HRMS with example? otherwise send send link for these

1630


how to write customizations in po

1197


TILL WHAT LEVEL OF SECURITY BO SUPPORTS?

2829