Oracle procedure and package - August 11,
2008 at 15:00 PM by Amit Satpute
Explain IN, OUT and INOUT in procedures.
Answer
IN, OUT and INOUT are the arguments that are passed to the procedures.
-
IN is a 'read only' argument and must be initialised.
-
OUT is an uninitialised argument which must be initialized by a function.
-
INOUT - A combination of the two above. That is, an initialised argument which
can be written to.
What are the rules of writing package?
Answer
Packeges are PL/SQl constructs that allow related data to be stored together. A
package has two parts: specification and a body.
The syntax of writing a package is:
CREATE [OR REPLACE] PACKAGE pkg_name {IS | AS}
procedure_specification |
function_specification |
variable_declaration |
type_definition |
exception_declaration |
cursor_declaration
END [pkg_name];
Thus the rules of writing a package would be:
-
A package should have a name,
-
The elements within the package should be the same as they are in the
declarative section of an anonymous block.
-
The same syntax rules apply to the package header as the declarative section,
except for the procedures and the functions declarations.
|