Trying to work out the correct specification of parameters to hardcode the locale (shame the text lib cannot taking them directly from the invoking job schedule), with
var textBundle = textAccess.loadBundle("<packagepath","messageBundle","hdbtextbundle","EN");
But this is incorrect, when text.xsjslib is trying to parse the arguments, connection becomes "EN" and obviously fails on the prepareStatement.
Appreciate any suggestions to correct issue.
function _TextBundle(currentFunction, packageName, objectName, objectSuffix, locale, connection) {
var checkInput = function(functionName, inputName, inputValue) {
if (typeof(inputValue) !== "string") {
throw new Error("Function '" + functionName + "': Parameter '" + inputName + "' must be a string");
}
};
checkInput(currentFunction, "package", packageName);
checkInput(currentFunction, "object", objectName);
checkInput(currentFunction, "suffix", objectSuffix);
checkInput(currentFunction, "locale", locale);
if (locale.contains('-')) {
// The Repository uses underscore, while $.request.language (default locale) uses a dash
locale = locale.replace('-', '_');
}
var texts = {};
var statement = connection.prepareStatement("SELECT TEXT_ID, CONTENT FROM _SYS_REPO.TEXT_ACCESSOR(?, ?, ?, ?)");