在Oracle SQL中插入文本印刷错误和联系

在Oracle中,插入印刷错误或连接2或更多charater串或一起输出的SQL结果是可能的。 这操作允许您操作SQL询问返回的数据格式。

二坚实垂直杆 || 操作员用于连接2或更多串。 在旁边, Oracle也提供CONCAT字符作用作为选择给垂直杆操作员,万一有情况,控制操作系统或网上应用程序进行的翻译是难或不可能的。 这个作用应该用于将被移动在环境之间与不同的字符集的应用。

Oracle意志自动地熔铸价值入可以被连接的类型。 当Oracle解释零位作为空的(零长度)字符串,它不退回零位,如果操作数是空的,意味连接零长度字符串以另一个操作数总导致另一个操作数,因此零位可能仅起因于二空行的联系。 要连接也许是空的表示,使用NVL作用明确地转换表示成零长度串。

在另一字符串连接二个串结果。 如果两字符串是datatype炭灰,结果有datatype炭灰和被限制到2000个字符。 如果任一串是datatype VARCHAR2,结果有datatype VARCHAR2和被限制到4000个字符。 尾部空白在字符串由联系保存,不管串’ datatypes。

为逐字插入,投入串在单引号`之间在SQL声明。

例子和用法:

精选的`名字是` || 名字从桌;

名字是 whatever_name

选择数字 || `- ` || 描述从桌命令由数字

1 -描述1
2 -描述2

先遣用法:

使用联系和逐字插入自动地引起一套SQL查询语言,特别是当需要进行同样操作对许多桌,即投下很多桌是可能的。 要做此,格式化SQL数据查询语言输出询问结果以合法的SQL格式,并且缠绕SQL询问结果对文件。 然后执行包含SQL声明的文件。

例子:

选择`下落类型` || type_name || `; ’

意志引起:

下落类型type_name

那可以跑在SQL*Plus通过叫文件与@filename。 从第一个SQL声明被挑选从数据库将投下的所有类型。

重要: 这是现状提供,不用保单的机器翻译的页。 Machine translation may be difficult to understand. Please refer to original English article whenever possible.

Share and contribute or get technical support and help at My Digital Life Forums.



One Response to “Insert Text Literal and Concatenation in Oracle SQL”

  1. Arun
    March 2nd, 2007 21:57
    1

    Good article. Got what I was looking for…

Leave a Reply

You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Subscribe without commenting


Custom Search

New Articles

Incoming Search Terms for the Article

oracle concatenation - oracle sql concatenate - concatenation oracle - concatenation in oracle - ORACLE CONCAT - oracle sql concatenation - string concatenation in oracle SQL - oracle sql string concatenation - concat oracle - oracle concatenate - Oracle sql concatenate text - sql literal - sqlplus concat - oracle concatenate text - sql concatenation - literal of at most 4000 characters Insert Oracle - all - concatenation in oracle sql - SQLPLUS concatenate - sqlplus concatenate string - oracle text concatenation - oracle string concat - sql concat string oracle - CONCAT in oracle - oracle query concat - oracle concat string - concatenate in oracle - concat in sql - sql concatenate oracle - oracle concatenate strings - oracle query concatenate - sql select concatenation - oracle concatenate null - oracle string concatenation - oracle concat query - sql string concatenation oracle - concat oracle query - oracle literal - oracle sql select literal - oracle sql concat - oracle literal sql - oracle CONCATENATE WITH NULL - CONCATENATION IN SQL - concat sql oracle - oracle sql literal string - oracle sql string concat - concatenate in sql query - oracle - oracle concat 4000 - concat in oracle query -