Hi All,
Following is my code and i'm getting this error :
Error(38,1): PLS-00103: Encountered the symbol "EXCEPTION" when expecting one of the following: begin case declare end exit for goto if loop mod null pragma raise return select update while with << close current delete fetch lock insert open rollback savepoint set sql execute commit forall merge pipe


create or replace
FUNCTION FN_get_FLag (i_soeid IN VARCHAR2) RETURN VARCHAR2 IS
temp_crdt_flag varchar2(1) := 'N';
temp_finc_flag varchar2(1) := 'N';
--flag varchar2(1);
v_rec_count number:=0;

CURSOR role_list_curr IS
select u.role_id,r.APP_FUNC_CODE from user_role_map u,role_master r
where
u.role_id between 4 and 15 and u.actv_flag='Y' and u.soe_id=i_soeid
and u.role_id=r.role_id;


BEGIN
FOR curr_rec IN role_list_curr
LOOP
IF(CURR_REC.APP_FUNC_CODE like '%Credit%' ) THEN
temp_crdt_flag := 'Y';
temp_finc_flag := 'N';
END IF;
IF(CURR_REC.APP_FUNC_CODE like '%Finance%' ) THEN
temp_finc_flag := 'Y';
temp_crdt_flag := 'N';
END IF;
END LOOP;



IF(temp_crdt_flag = 'Y' AND temp_finc_flag = 'N') then
RETURN 'C';
ELSE IF (temp_crdt_flag = 'N' AND temp_finc_flag = 'Y') then
RETURN 'F';
ELSE IF (temp_crdt_flag='Y' AND temp_finc_flag = 'Y') then
RETURN 'B';
END IF;

EXCEPTION WHEN OTHERS THEN
RETURN NULL;

end;