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 » not understanding way asbitstream is working

Post new topic  Reply to topic
 not understanding way asbitstream is working « View previous topic :: View next topic » 
Author Message
klabran
PostPosted: Thu Mar 18, 2004 3:51 pm    Post subject: not understanding way asbitstream is working Reply with quote

Master

Joined: 19 Feb 2004
Posts: 259
Location: Flagstaff AZ

IF I do below...

DECLARE INMSG CHAR;
SET INMSG = substring(asbitstream(OutputRoot.XML,,437) FROM 1 FOR 8000);
insert into Database.tblCitationInAudit (sdata)
values (INMSG);

I get a byte string....

If I do below...

insert into Database.tblCitationInAudit (sdata)
values ( substring(asbitstream(OutputRoot.XML,,437) FROM 1 FOR 8000));

I get the string data which is what I want.

Why is the first code snippet not returning the string data?

Kevin
Back to top
View user's profile Send private message Visit poster's website
mgk
PostPosted: Thu Mar 18, 2004 4:13 pm    Post subject: Reply with quote

Padawan

Joined: 31 Jul 2003
Posts: 1642

This has nothing to do with ASBITSTREAM, it is always returning a BLOB.

This happens because assignment of a BLOB to an ESQL CHAR variable involved an implicit cast of the BLOB to the CHAR before asignment takes place. This results in X' ... ' around the string as no CCSID can be supplied to the CAST operation. In the second case you are assigning a BLOB to a VARCHAR (I assume) DB Column which means we give the raw BLOB to the DB without an assignment to an ESQL CHAR type (no implicit CAST takes place), so we never add the X' ... ' to the string.

To verify this, if you wrap a CAST with a CCSID clause around your first substring I think the results should then be the same. However the second will be more efficient as less steps are involved.

Cheers,
_________________
MGK
The postings I make on this site are my own and don't necessarily represent IBM's positions, strategies or opinions.
Back to top
View user's profile Send private message
klabran
PostPosted: Thu Mar 18, 2004 5:28 pm    Post subject: Reply with quote

Master

Joined: 19 Feb 2004
Posts: 259
Location: Flagstaff AZ

Thanks for the pointer. It works great now!

Kevin
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » not understanding way asbitstream is working
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.