Team Fly |
developers create their own functions to augment what is delivered with the software. Suppose one wants to strip all the vowels out of a name with a function. One passes in a name (for instance, Bellissimo) and gets back the text ''Bllssm" when the function completes its work. Let's look at the get_age function which operates based on the following logic:
given a date of birth (format DD-MON-YYYY) using an SQL function get the months between today's date and the date passed in divide the number of months by 12 truncate the results (giving the span in years between the 2 dates) pass integer back
Packages roll functions and procedures together into a cohesive programming unit. Often, developers like to bundle like functionality together since it makes logical sense to call one larger unit and have it perform a series of tasks. Let's look at the CREATE_EMPLOYEE package in Table 1-4.
Team Fly |