0

I have a BITSTREAM from XML message. An I want to break in to multiple parts of equal size depending upon of the length of stream using ESQL i.e. if my bitstream 1000 characters I want to break it in to 200character equal sets. And late I want to pass this parts to a store procedure to insert or update the table. I have BITSREAM Something like this DECLARE vBlobMsgBody BLOB;

        DECLARE refIn               REFERENCE TO    Environment.OriginalXML;
        DECLARE vEncoding           INT             InputRoot.Properties.Encoding;
        DECLARE vCCSID              INT             InputRoot.Properties.CodedCharSetId;

        DECLARE vMsgBitStream BLOB ASBITSTREAM(refIn,1208);

How I will be to do that?

WENzER
  • 205
  • 1
  • 5
  • 15

1 Answers1

0

You can use the same function of CHARACTER variables.
SO you can use functions like:

DECLARE BLOB_LENGTH INTEGER LENGTH(vMsgBitStream);
DECLARE FIRST_PART BLOB SUBSTRING(vMsgBitStream FROM 1 FOR 200);