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 » format with xs:string

Post new topic  Reply to topic
 format with xs:string « View previous topic :: View next topic » 
Author Message
jcv
PostPosted: Tue Jul 31, 2007 2:31 am    Post subject: format with xs:string Reply with quote

Chevalier

Joined: 07 May 2007
Posts: 411
Location: Zagreb

Is it possible to specify format for casting decimal to string, using xs:string function from Mapping node casts group of functions? Thanks.
Back to top
View user's profile Send private message Visit poster's website
AkankshA
PostPosted: Tue Jul 31, 2007 3:13 am    Post subject: Reply with quote

Grand Master

Joined: 12 Jan 2006
Posts: 1494
Location: Singapore

i would prefer trying it myself .... theory n actuality do differ sometimes...

did u get any error while casting???

http://publib.boulder.ibm.com/infocenter/wmbhelp/v6r0m0/index.jsp?topic=/com.ibm.etools.mft.doc/ac30240_.htm
_________________
Cheers
Back to top
View user's profile Send private message Visit poster's website
jcv
PostPosted: Tue Jul 31, 2007 5:32 am    Post subject: Reply with quote

Chevalier

Joined: 07 May 2007
Posts: 411
Location: Zagreb

Yes. I tried with: xs:string($source/some_source_element,'###,###,##0.00'), toolkit didn't report any error, but when I tried to deploy the bar, it reported following error:

Syntax error : ';'. : BROKER.f9cdf9a0-0f01-0000-0080-929af9708d91: /build/S600_P/src/DataFlowEngine/ImbRdl/ImbRdlRdp.cpp: 3139: SqlParser::castFunction: ComIbmComputeNode: os_flow#FCMComposite_1_1.ComIbmMapping#FCMComposite_1_1

It was a blind attempt anyway, since I haven't found document explaining signature of xs:string function. I know of possibility to cast with ESQL in a compute node, or with Java, but I would like to solve it in a mapping node.
Back to top
View user's profile Send private message Visit poster's website
jefflowrey
PostPosted: Tue Jul 31, 2007 5:37 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

xs:string() is defined at http://www.w3.org/TR/xpath-functions/#casting

You can't specify a pattern to xs:string().

You can call an ESQL routine that will do the conversion for you, instead.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
jcv
PostPosted: Tue Jul 31, 2007 5:54 am    Post subject: Reply with quote

Chevalier

Joined: 07 May 2007
Posts: 411
Location: Zagreb

Thanks again.
Back to top
View user's profile Send private message Visit poster's website
jcv
PostPosted: Tue Jul 31, 2007 9:17 am    Post subject: Reply with quote

Chevalier

Joined: 07 May 2007
Posts: 411
Location: Zagreb

Just to notify you that your suggestions are not in vain.
I have opened new esql file for a flow, created an ESQL function like this:
Code:

CREATE FUNCTION format_thousands(IN val DECIMAL) RETURNS CHAR
   BEGIN
      return CAST(val AS CHAR FORMAT '###,###,##0.00');
   END;


replaced the call

xs:string($source/some_source_element)

with

esql:format_thousands($source/some_source_element)

and got what I expected. One obstacle I have overcame with your help, was to learn the possibility of creating stored ESQL functions intended for use in a mapping node. That was actually two obstacles:
1. I somehow always used to connect ESQL with compute and filter node where esql file is automatically generated when you drag and drop a new node of such types to your flow. Here I have created esql file "manually" by using an adequate option intended for this purpose, and named it after the flow, thus connecting those two files, and all ESQL inserted there was ready to use in that flow.
2. I somehow always wanted to avoid compute (or java) node in favour of mapping node, which is much more consistant to the "spirit" of the tool, where ever is this possible. By that I mean message content transformation without writing code. Knowing this, I will be able to do that even more efficiently, by adding just small portions of ESQL when neccessary. Thanks once again.
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 » format with xs:string
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.