Fix missing FROM clause in example
Omit DETAIL when no parameters are present
Fix escaping