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

Romica Dascalescu Romica.Dascalescu at autodesk.com
Thu Nov 25 10:37:58 EST 2010

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,

More information about the fdo-internals mailing list