create or replace function f_henry_GetStringLength(pv_String in varchar2) return integer is Result integer; i number; begin Result:=0; if length(pv_String)=0 then return(Result); end if; for i in 1 .. length(pv_String) loop if ascii(substr(pv_String,i,1))<256 then Result:=Result+1; else Result:=Result+2; end if; end loop; return(Result); end f_henry_GetStringLength;