1. 程式人生 > >oracle中length()與lengthb()區別

oracle中length()與lengthb()區別

CREATE OR REPLACE FUNCTION fun_ifcn (
V_col in varchar2
)
RETURN NUMBER IS
V_yn  number;
/******************************************************************************
  This function is to judge the V_col is cn or not!
  Note:
         0:not
         1:yes
  Author:Rolland
  Date : 2009-01-15 18:16
******************************************************************************/
BEGIN
     IF length(V_col)=lengthb(V_col) THEN
         V_yn:=0;
     ELSE
         V_yn:=1;
     END IF;  
     RETURN V_yn;
    
   EXCEPTION
     WHEN NO_DATA_FOUND THEN
       NULL;
     WHEN OTHERS THEN
       -- Consider logging the error and then re-raise
       RAISE;
END fun_ifcn;