pl/sql-escape& quotation

escape:

1.使用 ESCAPE 关键字定义转义符。在模式中,当转义符置于通配符之前时,该通配符就解释为普通字符。

2.ESCAPE 'escape_character' 
允许在字符串中搜索通配符而不是将其作为通配符使用。escape_character 是放在通配符前表示此特殊用途的字符。 
select * from a WHERE name LIKE '%/%ab' ESCAPE '/'


结果为: 
name 
---------- 
11%ab 

12%ab 

 

quotation:

Quotation marks can be nested in one of two ways. The first method is to double the quotation marks in the nested string. For example:

NLS_DATE_FORMAT = '''Today is'' MM/DD/YYYY' 

The second method is to alternate single and double quotation marks. For example:

NLS_DATE_FORMAT = '"Today is" MM/DD/YYYY' 

 

 

SQL >   select   ''' Today is ''  MM/DD/YYYY '   from  dual;

''' TODAYIS '' MM/DD/YYYY '
-- ---------------------
' Today is '  MM / DD / YYYY

SQL
>    select   ' "Today is" MM/DD/YYYY '   from  dual;

' "TODAYIS"MM/DD/YYYY '
-- -------------------
"Today  is " MM / DD / YYYY

 


 

你可能感兴趣的:(pl/sql)