Try the following.
in the SQL statement try using brackets () instead of macro substitution &.
eg
instead of
select &campo1 as codigo, &campo2 as famn1, &campo3 as famn2 ....
try
select (campo1) as codigo, (campo2) as famn1, (campo3) as famn2....
if the above is not working (usually it...