Oracle基本函数-大小写转换函数

UPPER():所有字母转换为大写
LOWER():所有字母转换为小写
INITCAP():所有单词首字母与转换为大写

declare
v_namelower varchar2(50) := 'kongfu panda like kongfu and panda';
v_nameupper varchar(50) := 'i think so definitely';
begin
  DBMS_OUTPUT.put_line(UPPER(v_namelower));--所有字母转换为大写
  DBMS_OUTPUT.put_line(lower(v_namelower));--所有字母转换为小写
  DBMS_OUTPUT.put_line(initcap(v_namelower));--所有单词首字母大写
  DBMS_OUTPUT.put_line(UPPER(v_nameupper));--大写
  DBMS_OUTPUT.put_line(lower(v_nameupper));--小写
  DBMS_OUTPUT.put_line(initcap(v_nameupper));--首字母大写
  end;

执行结果:
KONGFU PANDA LIKE KONGFU AND PANDA
kongfu panda like kongfu and panda
Kongfu Panda Like Kongfu And Panda
I THINK SO DEFINITELY
i think so definitely
I Think So Definitely

你可能感兴趣的:(Oracle基本函数-大小写转换函数)