If you receive the following error message, you need some permissions on your SQLJ database in your Teradata RDBMS:
“User does not have permission to access SQLJ on the current database”
This simply means that the user that is creating the JUDF needs “EXECUTE PROCEDURE” access on the “SQLJ” database within Teradata. A statement such as the following will fix this for you:
GRANT EXECUTE PROCEDURE ON SQLJ TO <username>;
By default, only the DBC user has permission to do this, so as good practice you should first use DBC to grant permission to your DBC/super-user account, rather than having to use DBC every time:
GRANT ALL ON SQLJ TO <super-user> WITH GRANT OPTION;
This information was based on a Teradata 14.0 system.