Posted: Tue Jan 24, 2006 2:16 pm Post subject: Padding spaces in a multi-record BLOB
Apprentice
Joined: 28 Oct 2001 Posts: 45
I have a single message containing many delimited records.
I am parsing the message as a BLOB and replacing special characters etc.... I don't care about individual fields.
Each record has to become fixed length of 2000 bytes. All the records are written out as a single message.
I am able to do this with a WHILE loop but was wondering if I could accomplish the same thing with the SPACE and OVERLAY function (and compare performance).
SPACE is used instead of creating a huge BLOB variable with multiple x'20' entries.
SET recLen = 2000;
SET spaceStr = SPACE(recLen);
SET outData = OVERLAY(spaceStr PLACING inData FROM 1 FOR inLen);
Of course this creates CAST errors. But anytime I try and CAST one of the variables I receive the following:
Text = String is not of correct form for byte array. Must consist of only 0..9,a..f,A..Z
Catalog = BIPv500
Severity = 3
Number = 2590
Insert =
Type = 5
Text =
Is there a way to CAST this function to work with BLOBs?
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