Author |
Message
|
goldym |
Posted: Thu Jun 30, 2005 6:44 pm Post subject: Inserting Dates into the Database Nearest to the Furthest |
|
|
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 |
|
 |
jefflowrey |
Posted: Fri Jul 01, 2005 3:21 am Post subject: Re: Inserting Dates into the Database Nearest to the Furthes |
|
|
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 |
|
 |
goldym |
Posted: Fri Jul 01, 2005 3:48 am Post subject: |
|
|
Centurion
Joined: 24 Jun 2005 Posts: 116
|
Do you have any suggestions from where to even begin? |
|
Back to top |
|
 |
PGoodhart |
Posted: Fri Jul 01, 2005 3:55 am Post subject: |
|
|
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 |
|
 |
goldym |
Posted: Fri Jul 01, 2005 4:07 am Post subject: |
|
|
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 |
|
 |
jefflowrey |
Posted: Fri Jul 01, 2005 4:19 am Post subject: |
|
|
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 |
|
 |
|