did you try if the %% here lead to the parameter being evaluated and its not inserting a literal string with % signs?