Server Changes

Previously, the ESP server calculated the difference between two date, timestamp, or bigdatetime datatypes as date or time values.

For example, when calculating the difference between the two dates 2010-03-27 00:00:00 and 2010-03-01 00:00:00, the value returned was the date 1970-01-26 00:00:00. In Event Stream Processor 5.1 SP02, the server has been modified to calculate the difference between two date, timestamp, or bigdatetime datatypes as interval values. For example, when calculating the difference between the two dates 2010-03-27 00:00:00 and 2010-03-01 00:00:00, the value returned is 26 days.

If you have existing projects from previous versions that calculate differences between date, timestamp, or bigdatetime values, your CCL files may produce different results or may fail to compile.

The following sample code illustrates how you can now produce an interval value directly when subtracting two bigdatetime datatypes:
CREATE INPUT STREAM NEWSTREAM SCHEMA (Column1 bigdatetime, Column2 bigdatetime);
CREATE OUTPUT STREAM S2 SCHEMA (Column1 interval) as
    select NEWSTREAM.Column1 - NEWSTREAM.Column2 as Column1
    from NEWSTREAM;