Welcome to my blog which contains anything and everything I feel is worthwhile sharing......

Wednesday, June 20, 2012

Single Quotes in Oracle/ PL SQL

SELECT 'single quotes' from dual;

output :
single quotes

SELECT '''single quotes''' from dual;

output:
'single quotes'

When using a variable :
 The following script

DECLARE
VAR_ VARCHAR2(20):='Single Quotes';
BEGIN
   dbms_output.put_line(''''||VAR_||'''');
END;

will produce this output :
'Single Quotes'