This article will show how to create a table Java UDF, execute it in protected mode, and debug it locally or remotely using Eclipse. The UDF runs under the default operating system user "tdatuser", and can access the system resources for which tdatuser has privileges. Local Debugging means Eclipse and DBS are running on the same machine. Remote Debugging means Eclipse and DBS are running on separate machines.

In this example, the table Java UDF takes in raw data for sales personnel for a sales region and returns a table of sales people based on a region.

5.1. Data Preparation

The table JUDF can be executed in 2 modes, constant mode and variable mode, depending on input arguments.

To run your variable mode table JUDF, you will need a database table with data.

Submit the following SQLs at the bteq prompt to create and populate the raw_sales_people table.

BTEQ -- Enter your SQL request or BTEQ command:

CREATE SET TABLE raw_sales_people, NO FALLBACK, NO BEFORE JOURNAL, NO AFTER JOURNAL, CHECKSUM = DEFAULT ( region INTEGER, pending_data VARCHAR(1024) CHARACTER SET LATIN NOT CASESPECIFIC) PRIMARY INDEX (region);