📜  PLSQL |组合函数

📅  最后修改于: 2022-05-13 01:55:28.449000             🧑  作者: Mango

PLSQL |组合函数

PL/SQL 中的字符串实际上是一个带有可选大小规范的字符序列。
字符可以是数字、字母、空白、特殊字符或所有字符的组合。
PLSQL 中的 Compose函数用于返回 Unicode字符串。

可以在 compose函数中与其他字符组合的 unistring 值是:

  1. unistr('\0300') – 重音符 ( ` )
  2. unistr('\0301') –重音 ( ´ )
  3. unistr('\0302') – 扬抑符( ^ )
  4. unistr('\0303') -波浪号 ( ~ )
  5. unistr('\0308') –元音变音 (¨ )

句法:

COMPOSE( string )

使用的参数:

字符串 –用于指定需要创建其 Unicode字符串的输入值。

支持的 Oracle/PLSQL 版本:

  1. 甲骨文 12c
  2. 甲骨文 11g
  3. 甲骨文 10g
  4. 甲骨文 9i

例子:

DECLARE 
   Test_Char char := 'a';
   Test_Char2 char := 'e';
   
BEGIN 
   dbms_output.put_line(COMPOSE(Test_Char || unistr('\0308' ))); 
   dbms_output.put_line(COMPOSE(Test_Char || unistr('\0301' )));
   dbms_output.put_line(COMPOSE(Test_Char || unistr('\0303' ))); 
   dbms_output.put_line(COMPOSE(Test_Char2 || unistr('\0302' ))); 
   
END;  

输出:

ä
á
ã
ê