Previous Topic: Block Statement Parameters

Next Topic: Footer Statement Example

Block Statement Example

This BLOCK statement assumes that an argument will be passed that holds an integer equal to the change order priority. The WHERE clause first checks the number of arguments passed ($#). If one is present, it is used to evaluate the expression to produce the WHERE clause; otherwise a null WHERE clause is substituted (" ").

BLOCK chg (“SELECT priority FROM Change_Request”,
$# > 1 ? “WHERE priority =“ ## $1 :  ““) {}