Skip to content

A Custom Event's variable is automatically populated from the changed record's data (e.g. NEW:DESCRIPTION), but if that value happens to contain a single quote, the event action fails with a SQL syntax error, since the substituted value breaks out of the surrounding quoted string literal.

Answer

Declare the variable using Oracle's alternative quoting mechanism instead of plain single quotes — for example VARCHAR2(32000) := q'[&NEW:DESCRIPTION]'; — rather than := '&NEW:DESCRIPTION';. The q'[...]' syntax treats everything between the brackets as a literal string, so an embedded single quote in the substituted value no longer breaks out of the string and causes a syntax error.

← Browse Developer Studio, deployment, and upgrades questions