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 » Inserting Dates into the Database Nearest to the Furthest

Post new topic  Reply to topic
 Inserting Dates into the Database Nearest to the Furthest « View previous topic :: View next topic » 
Author Message
goldym
PostPosted: Thu Jun 30, 2005 6:44 pm    Post subject: Inserting Dates into the Database Nearest to the Furthest Reply with quote

Centurion

Joined: 24 Jun 2005
Posts: 116

I have this requirement, Place Pricing details in order according to event date Date. Nearest to Furthest.

Here is sample XML:

<?xml version="1.0" encoding="UTF-8"?>
<EconomicEvent site="LON" eodgroupname="rates" eventdate="20050609" runid="100981">
<Trade cpacronym="ALLEICGB" legalentity="BOANA0" book="LGBP" product="1" glcategory="1" frontofficenumber="13082689" sourcesystem="ADV">
<ExternalID externaltype="backofficeid" value="1301254"/>
<ExternalID externaltype="groupnum" value="0"/>
<PricingEvent eventtype="totalmtm" amount="-261432.85399047844" currency="GBP" eventdate="11 Oct 2000"/>
<PricingEvent eventtype="unsettleintaccrualliability" amount="70832.19178082192" currency="GBP" eventdate="15 Jun 2005"/>
<PricingEvent eventtype="unsettleintaccrualasset" amount="71494.86301369862" currency="GBP" eventdate="15 Jun 2006"/>
</Trade>
</EconomicEvent>

What is the best way to do it. Do we have any DISTINCT type keywords in E-SQL. What is the best way to handle this scenario ? Please suggest.
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Fri Jul 01, 2005 3:21 am    Post subject: Re: Inserting Dates into the Database Nearest to the Furthes Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

goldym wrote:
What is the best way to do it. Do we have any DISTINCT type keywords in E-SQL. What is the best way to handle this scenario ? Please suggest.


Only you know what is the BEST way to do it.

There is no Select DISTINCT, and there is no ORDER BY or GROUP BY clause in ESQL - despite the glaring need for these since at least 2.1.

So you will have to write code to do this sorting for you.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
goldym
PostPosted: Fri Jul 01, 2005 3:48 am    Post subject: Reply with quote

Centurion

Joined: 24 Jun 2005
Posts: 116

Do you have any suggestions from where to even begin?
Back to top
View user's profile Send private message
PGoodhart
PostPosted: Fri Jul 01, 2005 3:55 am    Post subject: Reply with quote

Master

Joined: 17 Jun 2004
Posts: 278
Location: Harrisburg PA

Here is the real issue, XML and Databases are not designed to be sorted. They are designed to be querried and the results sorted. XML is strickly data, not designed to be human readable, so if you have developed a need to have sorted XML you have made a bad design choice.
_________________
Patrick Goodhart
MQ Admin/Web Developer/Consultant
WebSphere Application Server Admin
Back to top
View user's profile Send private message
goldym
PostPosted: Fri Jul 01, 2005 4:07 am    Post subject: Reply with quote

Centurion

Joined: 24 Jun 2005
Posts: 116

[quote="PGoodhart"]Here is the real issue, XML and Databases are not designed to be sorted. They are designed to be querried and the results sorted. XML is strickly data, not designed to be human readable, so if you have developed a need to have sorted XML you have made a bad design choice.[/quote]

It definetly wasn't my need more so a requirement I was given.
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Fri Jul 01, 2005 4:19 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

There are probably thousands and thousands of web pages that will detail sorting algorithms.

Translating them to ESQL is probably not hard. Just remember that in ESQL trees, you can't access *.[10] before you have created *.[9].

This is a standard loop over the input, copy to the output kind of thing. So use references and while loops.

Also, in a previous discussion of sorting in WMQI, someone else recommended using XSLT.
_________________
I am *not* the model of the modern major general.
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 » Inserting Dates into the Database Nearest to the Furthest
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.