Try like so: GetStuff: arguments: foo bar SELECT theanswer FROM some_table <!--#sqlgroup where--> some_value=3 <!--#and--> <!--#sqltest foo type=int optional--> <!--#and--> <!--#sqltest bar type=int optional--> <!--#/sqlgroup-->