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 » Replace Function in MB V5.0

Post new topic  Reply to topic
 Replace Function in MB V5.0 « View previous topic :: View next topic » 
Author Message
RocknRambo
PostPosted: Thu Jan 05, 2006 7:48 am    Post subject: Replace Function in MB V5.0 Reply with quote

Partisan

Joined: 24 Sep 2003
Posts: 355

Trying to use the REPLACE function..

Is this chunk of code correct?

Code:
   DECLARE v_InputBLOB BLOB BITSTREAM(InputRoot.XML);
   SET v_InputBLOB = REPLACE(v_InputBLOB, X'1A' );
   
   SET OutputRoot."BLOB"."BLOB" = v_InputBLOB;


the whole input Tree is repeated twice. In other 3KB message of input, 6KB of Ouput

any thoughts are appreciated

Thanks
-RR
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Thu Jan 05, 2006 7:57 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

Don't use BITSTREAM.

Do NOT use BITSTREAM.

Unless you are using version 2.0.

Just don't do it.

Also, Replace takes THREE arguments, not two.

http://publib.boulder.ibm.com/infocenter/wbihelp/v6rxmx/index.jsp?topic=/com.ibm.etools.mft.doc/ak05241_.htm
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
RocknRambo
PostPosted: Thu Jan 05, 2006 8:07 am    Post subject: Reply with quote

Partisan

Joined: 24 Sep 2003
Posts: 355

NOT using BITSTREAM, how do we take whole input as BLOB ?using the CAST ? else how ?

regarding the Replace Function:

I'm pretty sure we can say the replace string as optional, notes from the pdf.

Quote:
If you do not specify the replace string expression, the replace string defaults to an empty string and the behavior of the function is to delete all occurrences of the search string from the result.


Besides, this is what I'm trying to achieve, -

I need to remove a charecter from the input, the charecter is known, what would be best way ?

Thanks
-RR
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Thu Jan 05, 2006 9:06 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

The function you want instead of BITSTREAM is ASBITSTREAM.

Try that, see if that fixes your duplication problem.

If it doesn't, try specifing an empty replace string. The manual also says "If any parameter is NULL, the result is NULL".

If that doesn't fix your problem, then post your entire ESQL.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
elvis_gn
PostPosted: Thu Jan 05, 2006 8:44 pm    Post subject: Reply with quote

Padawan

Joined: 08 Oct 2004
Posts: 1905
Location: Dubai

Hi RocknRambo,

For your problem

Quote:
the whole input Tree is repeated twice. In other 3KB message of input, 6KB of Ouput


Before doing this

Quote:

Quote:

Code:
DECLARE v_InputBLOB BLOB BITSTREAM(InputRoot.XML);
SET v_InputBLOB = REPLACE(v_InputBLOB, X'1A' );

SET OutputRoot."BLOB"."BLOB" = v_InputBLOB;



Did you do this also

Quote:
SET OutputRoot = InputRoot;


If yes, then dont do it.

Regards.
Back to top
View user's profile Send private message Send e-mail
RocknRambo
PostPosted: Fri Jan 06, 2006 6:29 am    Post subject: Reply with quote

Partisan

Joined: 24 Sep 2003
Posts: 355

Thanks elvis_gn !!

thts correct I choose
Code:
SET OutputRoot = InputRoot;
, by removing it .. made it working

and ASBITSTREAM is giving error but BITSTREAM did the job


-RR
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Fri Jan 06, 2006 6:33 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

If ASBITSTREAM is giving an error, it's because you're using it wrong.

I promise you that you want to use ASBITSTREAM and not BITSTREAM.

BITSTREAM does something subtly different than ASBITSTREAM, which is explained in the info center - and BITSTREAM is supposed to be deprecated which means it could go away at any time (although I had hoped it would be gone in v6).
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
RocknRambo
PostPosted: Fri Jan 06, 2006 8:31 am    Post subject: Reply with quote

Partisan

Joined: 24 Sep 2003
Posts: 355

U were right. my mistake, was not using it properly.


bottomline, Yes I'm able to chop off spl char

Thanks

-RR
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 » Replace Function in MB V5.0
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.