Nesting Quotes in SQL

Recently, I came across one of those situations where you need to get some data from a Production instance and transform it in some way. The catch is that you only have read access on the database in question. All of the usual methods of extracting data are blocked by either an extremely long and tedious battle to get the required access or are prohibited by various security policies.
I will need to do this quite regularly, so it looks like I’ll have to write some slave SQL to extract the data and then load it into a non-production database, where I have more privileges.
Once again, I’m going to have to struggle to remember the new Oracle Q quote syntax.

But before all that, a brief history of quotes.

In the beginning, there was the escape character. In SQL*Plus, this happens to be a single quote … Continue reading


Escaping quotes without ruining your eyesight

Whether it be dynamically changing the where clause on a Forms block, building a string to run in an EXECUTE IMMEDIATE statement, or generating a bit of slave SQL, sooner or later you’ll come across a situation where you need to build a literal string with embedded quotes. Continue reading