zoukankan      html  css  js  c++  java
  • 【Oracle】oracle10g以后利用q-quote特性简化包含单引号后双引号的字符串写法

    The Q-quote delimiter can be any single- or multibyte character except space, tab, and return. If the opening quote delimiter is a [, {, <, or ( character, then the closing quote delimiter must be the corresponding ], }, >, or )character. In all other cases, the opening and closing delimiter must be the identical character.

    oracle10g以后开始引入的一个新特性:q-quote

    使用Q或q开头(如果是national character literals,则是将N或n放在Q或q之前),字符串的前后使用界定符“ ' ” 单引号括起来。

    注:q-quote的界定符可以是除了TAB、空格、回车以外的任何单字节或双字节字符;一般情况下,可以统一使用{} 或[]或 <>或 () 作为界定符。

    使用方法如下:

    select q'[select 'hello' as str from dual]' as q_str from dual;

    查询结果如下:

    或者带双引号的,如下:

    select q'[select 'I say "hello"' as str from dual]' as q_str from dual;

    这样就比每次需要写单引号的时候,用多个单引号括起来要更方便一些。

    --------------------------------------------------------------------------

  • 相关阅读:
    slf4j + log4j 记录日志
    Executors介绍
    Java集合(JDK1.6.0_45)
    Java多线程系列目录(共43篇)
    线程池体系
    FutureTask
    23种设计模式分类
    结构型 之 适配器模式
    信号量Semaphore详解以及应用
    Excel格式转化工具
  • 原文地址:https://www.cnblogs.com/uzipi/p/4203566.html
Copyright © 2011-2022 走看看