Make sure your variable parameter is on the right side of the equation of the operation.
For example use this
select * from temp_table where temp_1 = @arg1;
instead of this
select * from temp_table where @arg1 = temp1;
The second or bottom select statement will produce the @p0 error in the program environment, however, if running in ISQL and replacing the @arg1 with an actual value, it will work just fine.