Multi-value Variables

With the default <sqlcp arrayconvert> and metamorphstrlstmode settings (on and equivlist, respectively), a string variable with multiple values becomes a parenthetical comma-separated list when used as a SQL parameter, so that any of the values match with the Metamorph like operator. For example, the following query:

The capitals are:
<$states = "AL" "MS" "GA" "FL">
<SQL "select capital from State where state like $states">
  $capital
</SQL>

would match any of the given states, because the $states parameter becomes "(AL,MS,GA,FL)".


Copyright © Thunderstone Software     Last updated: Oct 24 2023
Copyright © 2024 Thunderstone Software LLC. All rights reserved.