terça-feira, 15 de fevereiro de 2011

Quoting Mechanism for String Literals

Oracle 10g allows you to define your own string delimiters to remove the need to double up any single quotes. Any character that is not present in the string can be used as the delimeter:

 

SET SERVEROUTPUT ON

BEGIN

  -- Orginal syntax.

  DBMS_OUTPUT.put_line('This is Tim''s string!');

 

  -- New syntax.

  DBMS_OUTPUT.put_line(q'#This is Tim's string!#');

  DBMS_OUTPUT.put_line(q'[This is Tim's string!]');

END;

/

 

This is Tim's string!

This is Tim's string!

This is Tim's string!

 

PL/SQL procedure successfully completed.

Fonte: http://www.oracle-base.com/articles/10g/PlsqlEnhancements10g.php

Nenhum comentário :

Postar um comentário

Related Posts Plugin for WordPress, Blogger...