<?xml version='1.0' encoding='UTF-8'?>
<ROWSET tableName='xxx'>
<EXEC_SQL>
CREATE OR REPLACE FUNCTION LPAD2(
	XTEXT       IN VARCHAR2 ,
	XLEN        IN NUMBER   ,
	XVAL        IN VARCHAR2 := ' ' )
RETURN VARCHAR2
AS
    TEMP	VARCHAR2(4000);
BEGIN
	IF LENGTHB(XTEXT) > XLEN THEN
		RETURN SUBSTRB( XTEXT,1,XLEN );
	ELSE
		TEMP := LPAD( XTEXT,XLEN,XVAL );
		RETURN SUBSTRB( TEMP,LENGTHB(TEMP)-XLEN+1, XLEN ) ;
	END IF;
END LPAD2;
</EXEC_SQL>
</ROWSET>
