The problem is that Netezza does not allow variables to be used outside of stored procedures.
If you use Aginity Workbench to query your database, you can use "parameter substitution" as a workaround. This is basically a find-and-replace that Workbench implements before running the SQL. The syntax is $ParamName
.