VAR

VAR works just like ASK, the only difference is that instead of substituting the value into the SQL, it stores it to a variable name. You can then substitute the variable multiple times in your SQL.

$VAR <varname> [DATE | [ALL]ANIMAL | LITTER | SPECIES | LOCATION | TYPE | NUMBER | STRING] [Message]$
The VAR tag should appear in your SQL before you reference the variable created. The variable is substituted with $@varname$

This example shows a list of animals of a selected species brought in after the given date. The species and broughtinafter variables could be reused as many times as we like.

SELECT

$VAR species SPECIES$

$VAR broughtinafter DATE The date the animals were brought in after$

AnimalName, DateBroughtIn

FROM animal

WHERE SpeciesID=$@species$

AND DateBroughtIn >= '$@broughtinafter$'



http://sheltermanager.sf.net