[fdo-internals] RE: CurrentDate and ExtractToInt for King.Oracle

Trevor Wekel trevor_wekel at otxsystems.com
Thu Nov 25 12:16:00 EST 2010

Thanks Romy,

I tried it both ways - with and without the quotes.  I suspect the key issue is that King.Oracle is not using the expression engine.  Just out of curiosity, which providers make use of the expression engine for filters?

Maybe we can change code in MapGuide to use the expression engine for filters as well.  The difference between tooltip and filter functionality is "weird" from a user perspective.  And date comparisons with King.Oracle are very problematic.  Since the King.Oracle provider does not provide string parsing functions, I think "date in a filter" is unusable.


-----Original Message-----
From: fdo-internals-bounces at lists.osgeo.org [mailto:fdo-internals-bounces at lists.osgeo.org] On Behalf Of Romica Dascalescu
Sent: November 25, 2010 8:38 AM
To: FDO Internals Mail List
Subject: [fdo-internals] RE: CurrentDate and ExtractToInt for King.Oracle

Hi Trevor,

I think this use case is in Map Guide where the content of tooltips is evaluated using the Expression Engine, having all functions available and that's why you see the value.

Now, each provider can use Expression Engine to support more functions or not (provide own implementation or not implement it at all).
Expression Engine is a module offering ways to evaluate filters and expressions (paying a price on performance) but this do not come for free, the provider owner/developer needs to add some code in order to use Expression Engine. So, Expression Engine is not enforced to all providers or in places where a function is not supported (e.g. SQLite provider do not use at all Expression Engine).

When provider evaluates filters the filter go against the provider directly and the provider needs to be aware of the functions passed in the filter in order to be able to evaluate them.
Looking at KingOracle provider expression capability I can see only a few functions are supported: CEIL, FLOOR, SUM, COUNT, MIN, AVG, MAX, LOWER, UPPER, CONCAT, SPATIALEXTENTS and that's why you filter did not work.
More than that your filter is invalid since function ExtractToInt() will return an integer which you compare it with a string :)
So your filter should be: ExtractToInt('YEAR', CurrentDate()) = 2010


-----Original Message-----
From: fdo-internals-bounces at lists.osgeo.org [mailto:fdo-internals-bounces at lists.osgeo.org] On Behalf Of Trevor Wekel
Sent: Wednesday, November 24, 2010 4:34 PM
To: FDO Internals Mail List
Subject: [fdo-internals] CurrentDate and ExtractToInt for King.Oracle

Hello Fdo wizards,

I am seeing an interesting quirk with the King.Oracle provider.  If ExtractToInt('YEAR', CurrentDate()) is used in a tooltip, I get "2010" back.  If the same statement is used in a filter, ExtractToInt('YEAR', CurrentDate()) = '2010' then it does not work.  The GetCapabilities document for King.Oracle does not include the ExtractToInt() or CurrentDate() functions.  However, I thought these function were implemented by the expression engine and were common to all providers.

Can anyone provide some enlightenment on this behaviour?

Thank you,

fdo-internals mailing list
fdo-internals at lists.osgeo.org

More information about the fdo-internals mailing list