I have a query string that I am creating programmatically, based on some user inputs. The user might search on 5 fields, or 8 fields, or no fields.
In my sql statment, some of these fields require parameters in the %Execute statement.
if user picks lastname, sql = "select * from person where lastname = ?"
if user also picks age, sql = "select * from person where lastname=? and age > ?"
I then have these lines of code to create my result set:
set statement = %SQL.Statement