Posted: Tue Jun 10, 2014 10:05 pm Post subject: Issue while calling java function from ESQL using BLOB data
Novice
Joined: 06 Jun 2008 Posts: 13
Hi,
My java function is this
package com.bnsf.mech.da.cmrs.appservice;
public class ComponentResolverAPI {
public static byte[] improveTrainMatch(byte[] inputMsgBytes) {
return inputMsgBytes;
}
}
I am calling it using esql like this
DECLARE inCCSID, inEncoding INT;
SET inCCSID = CAST(InputRoot.Properties.CodedCharSetId AS INT);
SET inEncoding = CAST(InputRoot.Properties.Encoding AS INT);
DECLARE messageOutBlob BLOB;
DECLARE messageBlob BLOB ;
SET messageBlob = ASBITSTREAM(InputRoot.JSON.Data);
SET messageOutBlob = improveTrainMatch(messageBlob);
CREATE LASTCHILD OF OutputRoot DOMAIN('JSON')
PARSE(messageOutBlob ENCODING inEncoding CCSID inCCSID FORMAT 'JSON' OPTIONS RootBitStream) ;
CREATE FUNCTION improveTrainMatch( IN messageBlobIn BLOB)
RETURNS BLOB
LANGUAGE JAVA
EXTERNAL NAME "com.bnsf.mech.da.cmrs.appservice.ComponentResolverAPI.improveTrainMatch";
Issue is I can see the BLOB getting created from JSON when I use ASBITSTREAM but when I enter the java function, value is blank.
The problem with the table -- when it comes to the OP's problem -- is that it doesn't tell if the the corresponding RETURNS datatatype for BLOB is byte[] or byte[][]... But that should be quite easy to test.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum