DECODE and CASE statements in Oracle both provide a conditional construct, of this form:
if A = n1 then A1
else if A = n2 then A2
else X
Databases before Oracle 8.1.6 had only the DECODE function. CASE was introduced in Oracle 8.1.6 as a standard, more meaningful and more powerful function.
Everything DECODE can do, CASE can. There is a lot else CASE can do though, which DECODE cannot. We’ll go through detailed examples in this article.
[click to continue…]
A package is a database object that groups together logically related procedures/functions, and other constructs such as variables, constants, cursors, PL/SQL types and exceptions.
One may well ask: when it’s possible to write standalone procedures/functions and define related variables within them, why have packages at all?
[click to continue…]