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

What is Tax Categories?

1622


What view would you use to determine free space in a tablespace?

1769


Explain the use of table functions.

1787


What is auto invoicing? Explain : oracle accounts receivable

605


PURCHASE ORDER TO PAYABLES WHAT ENTREIS WILL HAVE

1694






What is autocashrule set? : oracle accounts receivable

720


What are different types of transactions in ar? : oracle accounts receivable

732


What is an Oracle database Full Backup?

624


what are the types of LIST REPORTS in cognos8BI? and what is the mean and use of METRIC STUDIO in Cognos 8.3BI?

1797


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

3980


Explain the difference between $ORACLE_HOME and $ORACLE_BASE.

6720


Are These Dff's Flexible?

728


How to move the data from one flatfile to multiple staging tables?give me some examples? for example in po interface one flat file is there and multiple staging tables are there how can move it?please give me answer for this question?

1913


Tell me about entire study of finacle software as soon as possible? give me the idea about questions which coulb be asked in interview of pnb it officers?

7432


What is auto accounting what are the steps for setting up auto accounting? : oracle accounts receivable

706