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
if i write the procedure.. and other person make the changes in that code then where i find who is changing my procedure
How many segment are present in Oracle Manufacturing
default triggers available for reports
what are all the conversion and interfaces in GL,AP,AR,HRMS with example? otherwise send send link for these
while creating requisitions i am unable to see the list of organisation can anyone help me out ?
What is the difference between recovery and restoring of the oracle database?
What is the difference between oracle media recovery and crash recovery?
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
i am pursuing mca and i want to do oracle apps technical in hydrabad, plz guide me tne best institue in hydrabad those have excellent knowledge in oracle apps.
How would you go about increasing the buffer cache hit ratio?
What is the importance of batch source set up in ar? : oracle accounts receivable
how to replace not in with not exist?
What is the Difference between the Person_Type_id column in the per_all_people_f and per_person_type_usages_f
I would like to study certification course in Data base adminidtrator then where would i go to study this course?
i want to know about the javaBean.what is its purpose and how it can use in Forms.