Oracle Quoted Strings

Oracle 10g instroduced a new way to quote strings to prevent ​those strings with single apostrophes from causing errors. For example:

insert into myaddress (name, address) values ('Jim O'Brien', '10 Elm St.');

would fail because of the single apostrophe in O'Brien.

Using Oracle 10g or later, you can change the quoted string to be:

insert into myaddress (name, address) values (q'#Jim O'Brien#', q'#10 Elm St.#');
 
Simply start the quote of the string with the letter q followed by a single apostrophe and then another character of your choosing. This third character can be any character found on the keyboard such as !@#%^&* or any alpha. To end string, use the character you used in the third spot followed by a single quote.
 
I've tested sql statements processed with mdlDB_addRowWithMslink and mdlDB_processSQL which performed without issue. I also tested mdlDB_writeColumn and received error -1765 "quoted string not properly terminated".
Parents Comment Children
No Data