Static SQL
Static SQL works well in many situations. In fact, it can be used in any
application for which the data access can be determined at program design time. For
example, an order entry program always uses the same statement to insert a new
order and an airline reservation system always uses the same statement to
change the status of a seat from available to reserved. Each of these statements
would be generalized through the use of host variables; different values can be
inserted in a sales order and different seats can be reserved. Because such
statements can be hard-coded in the program, such programs have the advantage that
the statements need to be parsed, validated, and optimized only once, at compile
time. This results in relatively fast code.