Becausequote_literalis labelledSTRICT, it will always return null when called with a null argument. In the above example, ifnewvalueorkeyvaluewere null, the entire dynamic query string would become null, leading to an error fromEXECUTE. You can avoid this problem by using thequote_nullablefunction, which works the same asquote_literalexcept that when called with a null argument it returns the stringNULL. For example,