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 » esql - Overlay

Post new topic  Reply to topic
 esql - Overlay « View previous topic :: View next topic » 
Author Message
anvanzyl
PostPosted: Mon Oct 16, 2006 9:51 pm    Post subject: esql - Overlay Reply with quote

Novice

Joined: 03 Jan 2005
Posts: 19
Location: Melbourne, Australia

Hi,

Please have a look at the following esql code:

declare V1 char '0123456789';
declare pad_V1 char '00000';
set V1 = overlay(pad_V1 placing V1 from 1 for 5);

from this I expected the result to be V1 = '01234', however the result is V1 = '0123456789'. If this is not a bug of some sorts, then can someone please explain the purpose of the "...for 5" clause since in this case it does not seem to have any effect?

(If I change the initial value of V1 to e.g. '012' then it correctly results in V1 = '00012')
_________________
Regards

Andre
IBM Certified System Administrator -- WMQ V5.3
IBM Certified Solution Designer -- WBIMB V5
Back to top
View user's profile Send private message
elvis_gn
PostPosted: Mon Oct 16, 2006 10:38 pm    Post subject: Reply with quote

Padawan

Joined: 08 Oct 2004
Posts: 1905
Location: Dubai

Hi anvanzyl,

I think Overlay is working as it is supposed to...
This is from the esql.pdf
Quote:
For example:
OVERLAY (’ABCDEFGHIJ’ PLACING ’1234’ FROM 4 FOR 3)
returns the string ’ABC1234GHIJ’
If you notice the FROM was from position 4(D in source) FOR 3(F in source)...in other words only three alphabets DEF were replaced...BUT replaced by four numbers....i.e FOR 3 stands for the length in the source...

I hope you got the concept.

I think you require a substring and not an overlay.

Regards.
Back to top
View user's profile Send private message Send e-mail
anvanzyl
PostPosted: Mon Oct 16, 2006 11:32 pm    Post subject: Reply with quote

Novice

Joined: 03 Jan 2005
Posts: 19
Location: Melbourne, Australia

Thanks! Makes perfect sense now.
_________________
Regards

Andre
IBM Certified System Administrator -- WMQ V5.3
IBM Certified Solution Designer -- WBIMB V5
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 » esql - Overlay
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.