|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
How to retrieve concanated value of BLOB type column in DB2 |
« View previous topic :: View next topic » |
Author |
Message
|
dev |
Posted: Fri Mar 08, 2002 11:50 am Post subject: |
|
|
Apprentice
Joined: 11 Oct 2001 Posts: 30
|
Hi Board,
I need to retrieve concanated value of BLOB type column in DB2 of more than one records in ESQL.
Let's say
1) There is a table in DB2 named TABLE has column DOC(BLOB).
2) This table has n number of records(in fact storing xml message in BITStream format).
I need to concanate all values for column DOC and return all records value as one single result after concanatation.
please guide me on it.
|
|
Back to top |
|
 |
amigupta1978 |
Posted: Fri Mar 08, 2002 4:01 pm Post subject: |
|
|
Centurion
Joined: 22 Jan 2002 Posts: 132 Location: India
|
You cud use a loop to get all values and then concatenate
Set Environment.VALUES[]=(Select Item T.DOC From Database.Tablename.DOC as T);
DECLARE ILOOP INTEGER;
SET ILOOP=1;
DECLARE BLOBVAL BLOB;
SET BLOBVAL=X'';
WHILE ILOOP<=CARDINALITY(Environment.VALUES[])
SET BLOBVAL=BLOBVAL|| CAST (Environment.VALUES[ILOOP] as Blob);
SET ILOOP=ILOOP + 1;
END WHILE;
Regards
Amit |
|
Back to top |
|
 |
kirani |
Posted: Fri Mar 08, 2002 4:40 pm Post subject: |
|
|
Jedi Knight
Joined: 05 Sep 2001 Posts: 3779 Location: Torrance, CA, USA
|
Environment tree is only available in WMQI 2.1. If you are using lower version of MQSI, you can make use of DestinationList.
You may have performance issues, If you are using CRDINALITY in while a loop. You can avoid it by doing something like this,
DECLARE TCONT INT;
SET TCNT = CARDINALITY(Environment.VALUES[]);
WHILE ILOOP <= TCNT DO
....
END WHILE;
|
|
Back to top |
|
 |
amonj |
Posted: Sun Apr 21, 2002 10:00 pm Post subject: |
|
|
Newbie
Joined: 31 Jan 2002 Posts: 2
|
--------------------------------------------------------------------------------
Hi,
Under WMQI 2.1 I use the following ESQL to select BLOB field from database:
Set Environment.VALUES[]=(Select Item T.Msg From Database.Tablename.Msg as T);
I found Environment.VALUES[] will be NULL if there is BLOB field size beyond 10K bytes. What's wrong? Please give me some advice.
Thanks a lot. |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
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
|
|
|
|