欢迎投稿

今日深度:

Oracle PLSQL Demo,

Oracle PLSQL Demo,


--Count the length of string
select lengthb('select * from scott.emp') as countted_by_byte, length('select * from scott.emp') as countted_by_char from dual;

--For some character encoding, the length() and the lengthb() is same in english
--you may use this feature to check whether the string constains the chinese char
declare 
  v_char varchar2(50) := 'hello world你好';
begin
  
  if lengthb(v_char) = length(v_char) then
    dbms_output.put_line('it have not chinese...');
  else 
    dbms_output.put_line('it have chinese...');
  end if;
  
end;

 

www.htsjk.Com true http://www.htsjk.com/teradata/37429.html NewsArticle Oracle PLSQL Demo, -- Count the length of string select lengthb( ' select * from scott.emp ' ) as countted_by_byte, length( ' select * from scott.emp ' ) as countted_by_char from dual; -- For some character encoding, the length() and the...
相关文章
    暂无相关文章
评论暂时关闭