UDF in Java
Return a new salary based on input job title and original salary.
Steps for compiling:
Compile:
javac UDFjsrv.java
Copy to DB2 function path:
UDFjsrv.class to $(DB2PATH)\function
Create UDF function:
db2 -td@ -vf UDFjCreate.sql
Test:
SELECT firstnme, lastname, job, salary,
CAST( scalarUDF (job, salary) AS DECIMAL(8,2) ) FROM employee