<?xml version='1.0' encoding='UTF-8'?>
<ROWSET tableName='xxx'>
<EXEC_SQL>
create or replace function ERR_CODE(
	in_errcode       in varchar2  )
return varchar2
is
	indx     NUMBER ;
    errcode  NUMBER ;
begin
	indx := INSTR(in_errcode,'-');

	IF indx &gt; 0 THEN errcode := TO_NUMBER(SUBSTR( in_errcode,indx )); 
	ELSE errcode := -TO_NUMBER(in_errcode);
	END IF;

	return sqlerrm(errcode);

end ERR_CODE;
</EXEC_SQL>
</ROWSET>
