ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » How to retrieve concanated value of BLOB type column in DB2

Post new topic  Reply to topic
 How to retrieve concanated value of BLOB type column in DB2 « View previous topic :: View next topic » 
Author Message
dev
PostPosted: Fri Mar 08, 2002 11:50 am    Post subject: Reply with quote

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
View user's profile Send private message
amigupta1978
PostPosted: Fri Mar 08, 2002 4:01 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Yahoo Messenger
kirani
PostPosted: Fri Mar 08, 2002 4:40 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
amonj
PostPosted: Sun Apr 21, 2002 10:00 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » How to retrieve concanated value of BLOB type column in DB2
Jump to:  



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
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.