LPS-36179

Now replaces the sql string instead of using customsql.