Monday, May 25, 2009

Oracle Q-Quote

To avoid quoting quotes in string, Oracle 10g offers the Q-Quote technique.

Let’s say yoy want to select the following from dual: I’m into rock’n’roll

This would normally mean you should quote the three quotes, but with the Q-Quote technique it’s much simpler:
SQL> SELECT q'[I'm into rock'n'roll]' FROM dual;

No comments:

Post a Comment