lcStatusList = 'AFTHEW' >>SELECT* ; >>FROM mytable ; >>WHERE mytable.status $ ?lcStatusList>>
SELECT* ; >>FROM mytable ; >>WHERE mytable.status = 'A' OR ; >> mytable.status = 'F' OR ; >> mytable.status = 'T' OR ; >> mytable.status = 'H' OR ; >> mytable.status = 'E' OR ; >> mytable.status = 'W'>
SELECT ; > * ; > FROM MyTable ; > WHERE MyTable.Status IN ("AFTHEW")>
lcWhereClause = GetWhereClause("AFTHEW") >* above sets lcWhereClause to "myTable.status = 'A' OR ..." > >* Then, >SELECT ; > * ; > FROM MyTable ; > WHERE &lcWhereClauseUsing macro substitution like this basically costs nothing, it's called only once during parsing of the SELECT - SQL and not during its actual execution.