14. The computer readable medium of claim 13 , wherein the template-tokens include embedded commands associated with transforming the query template into the database query.
13. A non-transitory computer readable medium encoding a database query template comprising: a plurality of query language keywords; a plurality of template-tokens each determining a string substitution; and a plurality of variables, each associated with a respective template-token, wherein each of the plurality of template-tokens determines a string substitution based on the variable associated with the respective template-token, and configured to be transformed into a database query based on the template-tokens and one or more received values each associated with a respective variable, wherein the plurality of template tokens includes an optional-section-token defining a query-template-section and associated with one or more of the plurality of variables; and wherein each of said plurality of template-tokens is processed, said processing including; determining whether the template-token being processed is an optional-section token; in response to a determination that the template-token being processed is not an optional-section-token, as part of the transformation of the database query template into the database query, replacing the token with a portion of a database query; in response to a determination that the template-token being processed is an optional-section token, determining whether all of said plurality of variables associated with the query-template section are associated with a null value; as part of the transformation of the database query template into the database query, replacing the token with a portion of a database query based on a value of one or more variables from among said plurality of variables associated with the query-template section in response to determining that not all of said plurality of variables associated with the query-template section are associated with a null value; and omitting, as part of the transformation of the database query template into the database query, the query-template section from the database query in response to determining that none of the received values are associated with the one or more of the plurality of variables associated with the optional section-token.