SQL Modules
A module can be thought of as an object library that is linked to the
application code. However, exactly how the procedures and the rest of the application
are linked is implementation-dependent. For example, the procedures could be
compiled into object code and linked directly to the application code, they could
be compiled and stored on the DBMS and calls to access plan identifiers placed
in the application code, or they could be interpreted at runtime.
The main advantage of modules is that they cleanly separate SQL statements
from the programming language. In theory, it should be possible to change one
without changing the other and simply relink them.