<?xml version='1.0' encoding='UTF-8'?>
<ROWSET tableName='xxx'>
/****************************************************************************/
/* SYSTEM_ID : GE                                                           */
/* VIEW_ZOOM ( FUNCTION )                                                   */
/* Created : 2017/06/02 17:21:59                                            */
/****************************************************************************/
<EXEC_SQL>
CREATE     
FUNCTION VIEW_ZOOM(
	XVAL    IN NUMBER   ,
	XZOOM   IN VARCHAR2 ,
	XBASE   IN NUMBER := 12  )
RETURN NUMBER
IS
    RTN     NUMBER(6);

BEGIN

	IF    XZOOM = &apos;0&apos;  THEN RTN := TRUNC( XVAL * XBASE * 4.0  );
	ELSIF XZOOM = &apos;1&apos;  THEN RTN := TRUNC( XVAL * XBASE * 2.0  );
	ELSIF XZOOM = &apos;2&apos;  THEN RTN := TRUNC( XVAL * XBASE        );
	ELSIF XZOOM = &apos;3&apos;  THEN RTN := TRUNC( XVAL * XBASE / 1.5  );
	ELSIF XZOOM = &apos;4&apos;  THEN RTN := TRUNC( XVAL * XBASE / 3.0  );
	ELSIF XZOOM = &apos;5&apos;  THEN RTN := TRUNC( XVAL * XBASE / 4.0  );
	ELSIF XZOOM = &apos;6&apos;  THEN RTN := TRUNC( XVAL * XBASE / 6.0  );
	ELSIF XZOOM = &apos;7&apos;  THEN RTN := TRUNC( XVAL * XBASE / 12.0 );
	ELSIF XZOOM = &apos;8&apos;  THEN RTN := TRUNC( XVAL * XBASE / 24.0 );
	ELSIF XZOOM = &apos;9&apos;  THEN RTN := TRUNC( XVAL * XBASE / 36.0 );
	ELSIF XZOOM = &apos;10&apos; THEN RTN := TRUNC( XVAL * XBASE / 3.5  );
	ELSIF XZOOM = &apos;20&apos; THEN RTN := TRUNC( XVAL * XBASE * 4.0 /  100.0 );
	ELSIF XZOOM = &apos;21&apos; THEN RTN := TRUNC( XVAL * XBASE * 2.0 /  100.0 );
	ELSIF XZOOM = &apos;22&apos; THEN RTN := TRUNC( XVAL * XBASE * 4.0 /  200.0 );
	ELSIF XZOOM = &apos;23&apos; THEN RTN := TRUNC( XVAL * XBASE * 2.0 /  200.0 );
	ELSIF XZOOM = &apos;24&apos; THEN RTN := TRUNC( XVAL * XBASE * 4.0 /  400.0 );
	ELSIF XZOOM = &apos;25&apos; THEN RTN := TRUNC( XVAL * XBASE * 2.0 /  400.0 );
	ELSIF XZOOM = &apos;26&apos; THEN RTN := TRUNC( XVAL * XBASE * 4.0 /  600.0 );
	ELSIF XZOOM = &apos;27&apos; THEN RTN := TRUNC( XVAL * XBASE * 2.0 /  600.0 );
	ELSIF XZOOM = &apos;28&apos; THEN RTN := TRUNC( XVAL * XBASE * 4.0 /  800.0 );
	ELSIF XZOOM = &apos;29&apos; THEN RTN := TRUNC( XVAL * XBASE * 2.0 /  800.0 );
	ELSIF XZOOM = &apos;30&apos; THEN RTN := TRUNC( XVAL * XBASE * 4.0 / 1200.0 );
	ELSIF XZOOM = &apos;31&apos; THEN RTN := TRUNC( XVAL * XBASE * 2.0 / 1200.0 );
	END IF ;

	RETURN RTN;

END VIEW_ZOOM;

</EXEC_SQL>
</ROWSET>
