Validating package spec
The following code snippet shows a package specification having a single procedure.
You can have many global variables defined and multiple procedures or functions inside a package.
But be aware that all procedures, variables, and functions referenced in the CREATE PACKAGE command must be present in the CREATE OR REPLACE PACKAGE BODY command, for if you just use the command with a single procedure or function you want altered, that will be the only object left in the body when you are finished.
Perhaps with a future release we will be able to use the package definition as a link list, and this won't be required.
There is also an ALTER PACKAGE BODY command that is used only to recompile the package body. The DEBUG clause has been added to compile and store debugging information for the specified area of the package for the PL/SQL debugger.
# tracking number doesn't have spaces at this point chars = self.tracking_number.chars.to_a check_digit = total = 0 chars.reverse.each_with_index do |c, i| x = c.to_i x *= 3 if i.even?
total = x end check = total % 10 check = 10 - check unless (check.zero?