1. Version: smartGWT Power Edition 4.1-p20150224
2. all Browsers
3. Problem definition: Bug in WhereClause of Server side
The velocity Variables are not set Correctly in whereClause:
The velocity Variable are set as String in the whereClause. They are not converted tho the correct time format or to the correct local time.
a. The whereClause is this
<whereClause>
<![CDATA[
ARC_ALARM.VARIABLE_NAME = ARC_ALARM_VAR.VARIABLENAME
AND (
ARC_ALARM.TSBEGIN
BETWEEN $advancedCriteria.TSFROM AND $advancedCriteria.TSTO
OR
ARC_ALARM.TSEND
BETWEEN
$advancedCriteria.TSFROM AND $advancedCriteria.TSTO
OR (ARC_ALARM.TSBEGIN < $advancedCriteria.TSFROM AND ARC_ALARM.TSEND > $advancedCriteria.TSTO ))
AND ARC_ALARM.ACTIVE=0
AND ($defaultWhereClause)
]]>
</whereClause>
b. it send following Query to the database and Cause Sql Error due to wrong date Format:
WHERE
(
ARC_ALARM.VARIABLE_NAME = ARC_ALARM_VAR.VARIABLENAME
AND (
ARC_ALARM.TSBEGIN
BETWEEN '2015-08-06T10:59:00.000' AND '2015-08-11T10:59:14.574'
OR
ARC_ALARM.TSEND
BETWEEN
'2015-08-06T10:59:00.000' AND '2015-08-11T10:59:14.574'
OR (ARC_ALARM.TSBEGIN > '2015-08-06T10:59:00.000' AND ARC_ALARM.TSEND < '2015-08-11T10:59:14.574')
)
AND ARC_ALARM.ACTIVE=0
)
AND (((ARC_ALARM_VAR.MESSAGEGROUP = 'FM' AND ARC_ALARM_VAR.MESSAGEGROUP IS NOT NULL)))
c. The Date should be normaly like this and its work every where else in the Query but not in the WhereClause
TO_DATE('2015-08-06 12:59:00', 'YYYY-MM-DD HH24:MI:SS')
d. on the client side work everythings correct. I need the part in Server side to create PDF Report using "Jsasper Report"
f. here is the Datasource
<DataSource
ID="alarm_top_ten_range"
serverType="sql"
tableName="ARC_ALARM"
qualifyColumnNames="false">
<!-- requiresAuthentication="true" -->
<fields>
<field name="CNT" type="integer" customSelectExpression="count(*)" />
<field name="SUM" type="text" customSelectExpression="regexp_substr(numtodsinterval(sum((sysdate + (TSEND - TSBEGIN)) - sysdate),'day'), '\d{3} \d{2}:\d{2}:\d{2}\')" />
<field name="AVG" type="text" customSelectExpression="regexp_substr(numtodsinterval(avg(($currentDate + (TSEND - TSBEGIN)) - $currentDate),'day'), '\d{3} \d{2}:\d{2}:\d{2}\')" />
<field name="MIN" type="text" customSelectExpression="regexp_substr(numtodsinterval(min(($currentDate + (TSEND - TSBEGIN)) - $currentDate),'day'), '\d{3} \d{2}:\d{2}:\d{2}\')" />
<field name="MAX" type="text" customSelectExpression="regexp_substr(numtodsinterval(max(($currentDate + (TSEND - TSBEGIN)) - $currentDate),'day'), '\d{3} \d{2}:\d{2}:\d{2}\')" />
<field name="TEXT" type="text" tableName="DIC_TRANSLATIONS_MT" customSelectExpression="REPLACE(DIC_TRANSLATIONS_MT.TEXT,'%f1',P1)" nativeName="TEXT"/>
<field name="MESSAGETYPE" type="text" tableName="ARC_ALARM_VAR" />
<field name="ISWARNING" type="integer" tableName="ARC_ALARM_VAR" />
<field name="MESSAGEGROUP" type="text" tableName="ARC_ALARM_VAR" />
<field name="PAD" type="text" tableName="ARC_ALARM_VAR" />
<field name="PADNAME" type="text" tableName="DIC_TRANSLATIONS_PAD" nativeName="DIC_TRANSLATIONS_PAD.TEXT" />
<field name="ESTOPAREA" type="text" tableName="ARC_ALARM_VAR" />
<field name="PANELAREA" type="text" tableName="ARC_ALARM_VAR" />
<field name="CONSOLEAREA" type="text" tableName="ARC_ALARM_VAR" />
<field name="FUNCTIONGROUP" type="text" tableName="ARC_ALARM_VAR" />
<field name="FUNCTIONGROUPDESCRIPTION" type="text" tableName="DIC_TRANSLATIONS_FGD" nativeName="DIC_TRANSLATIONS_FGD.TEXT"/>
<field name="DEVICE" type="text" tableName="ARC_ALARM_VAR" />
<field name="DEVICEDESCRIPTION" type="text" tableName="DIC_TRANSLATIONS_DD" nativeName="DIC_TRANSLATIONS_DD.TEXT"/>
<field name="VARIABLE_NAME" type="text" tableName="ARC_ALARM"/>
<field name="ADDRESS" type="text" tableName="ARC_ALARM_VAR" />
<field name="INTERVALBEGIN_ID" type="integer" customSelectExpression="min(INTERVALBEGIN_ID)"/>
<field name="INTERVALEND_ID" type="integer" customSelectExpression="max(INTERVALEND_ID)"/>
<field name="TSFIRSTBEGIN" type="datetime" customSelectExpression="min(TSBEGIN)" />
<field name="TSLASTEND" type="datetime" customSelectExpression="max(TSEND)" />
<field name="TSFROM" type="datetime" customSQL="true" />
<field name="TSTO" type="datetime" customSQL="true" />
</fields>
<operationBindings>
<operationBinding operationType="fetch">
<tableClause>
ARC_ALARM, ARC_ALARM_VAR
LEFT JOIN (SELECT * FROM DIC_TRANSLATIONS WHERE DIC_TRANSLATIONS.LANGUAGE = ($session.locale.language)) DIC_TRANSLATIONS_MT
ON (ARC_ALARM_VAR.MESSAGETEXT_GROUPID = DIC_TRANSLATIONS_MT.GROUPID AND ARC_ALARM_VAR.MESSAGETEXT = DIC_TRANSLATIONS_MT.TEXTID)
LEFT JOIN (SELECT * FROM DIC_TRANSLATIONS WHERE DIC_TRANSLATIONS.LANGUAGE = ($session.locale.language)) DIC_TRANSLATIONS_FGD
ON (ARC_ALARM_VAR.FGDESCRIPTION_GROUPID = DIC_TRANSLATIONS_FGD.GROUPID AND ARC_ALARM_VAR.FUNCTIONGROUPDESCRIPTION = DIC_TRANSLATIONS_FGD.TEXTID)
LEFT JOIN (SELECT * FROM DIC_TRANSLATIONS WHERE DIC_TRANSLATIONS.LANGUAGE = ($session.locale.language)) DIC_TRANSLATIONS_PAD
ON (ARC_ALARM_VAR.PADNAME_GROUPID = DIC_TRANSLATIONS_PAD.GROUPID AND ARC_ALARM_VAR.PADNAME = DIC_TRANSLATIONS_PAD.TEXTID)
LEFT JOIN (SELECT * FROM DIC_TRANSLATIONS WHERE DIC_TRANSLATIONS.LANGUAGE = ($session.locale.language)) DIC_TRANSLATIONS_DD
ON (ARC_ALARM_VAR.DEVICEDESCRIPTIONGROUPID = DIC_TRANSLATIONS_DD.GROUPID AND ARC_ALARM_VAR.DEVICEDESCRIPTION = DIC_TRANSLATIONS_DD.TEXTID)
</tableClause>
<whereClause>
<![CDATA[
ARC_ALARM.VARIABLE_NAME = ARC_ALARM_VAR.VARIABLENAME AND (ARC_ALARM.TSBEGIN BETWEEN $advancedCriteria.TSFROM AND $advancedCriteria.TSTO OR ARC_ALARM.TSEND BETWEEN $advancedCriteria.TSFROM AND $advancedCriteria.TSTO OR (ARC_ALARM.TSBEGIN < $advancedCriteria.TSFROM AND ARC_ALARM.TSEND > $advancedCriteria.TSTO )) AND ARC_ALARM.ACTIVE=0 AND ($defaultWhereClause)
]]>
</whereClause>
<groupClause>
REPLACE(DIC_TRANSLATIONS_MT.TEXT,'%f1',P1), MESSAGETEXT, MESSAGETYPE, ISWARNING, MESSAGEGROUP, PAD, DIC_TRANSLATIONS_PAD.TEXT, ESTOPAREA, PANELAREA, CONSOLEAREA, FUNCTIONGROUP, DIC_TRANSLATIONS_FGD.TEXT, DEVICE, DIC_TRANSLATIONS_DD.TEXT, ARC_ALARM.VARIABLE_NAME, ADDRESS
</groupClause>
</operationBinding>
</operationBindings>
</DataSource>
6. here the sql send to databse causing Oracle Error due to wrong Date Format
SELECT count(*) AS CNT, regexp_substr(numtodsinterval(sum((sysdate + (TSEND - TSBEGIN)) - sysdate),'day'), '\d{3} \d{2}:\d{2}:\d{2}\') AS SUM, regexp_substr(numtodsinterval(avg((TO_DATE('2015-08-11 12:59:30','YYYY-MM-DD HH24:MI:SS') + (TSEND - TSBEGIN)) - TO_DATE('2015-08-11 12:59:30','YYYY-MM-DD HH24:MI:SS')),'day'), '\d{3} \d{2}:\d{2}:\d{2}\') AS AVG, regexp_substr(numtodsinterval(min((TO_DATE('2015-08-11 12:59:30','YYYY-MM-DD HH24:MI:SS') + (TSEND - TSBEGIN)) - TO_DATE('2015-08-11 12:59:30','YYYY-MM-DD HH24:MI:SS')),'day'), '\d{3} \d{2}:\d{2}:\d{2}\') AS MIN, regexp_substr(numtodsinterval(max((TO_DATE('2015-08-11 12:59:30','YYYY-MM-DD HH24:MI:SS') + (TSEND - TSBEGIN)) - TO_DATE('2015-08-11 12:59:30','YYYY-MM-DD HH24:MI:SS')),'day'), '\d{3} \d{2}:\d{2}:\d{2}\') AS MAX, REPLACE(DIC_TRANSLATIONS_MT.TEXT,'%f1',P1) AS TEXT, MESSAGETYPE, , DIC_TRANSLATIONS_FGD.TEXT AS FUNCTIONGROUPDESCRIPTION, DEVICE, DIC_TRANSLATIONS_DD.TEXT AS DEVICEDESCRIPTION, VARIABLE_NAME, ADDRESS, min(INTERVALBEGIN_ID) AS INTERVALBEGIN_ID, max(INTERVALEND_ID) AS INTERVALEND_ID, min(TSBEGIN) AS TSFIRSTBEGIN, max(TSEND) AS TSLASTEND FROM
ARC_ALARM, ARC_ALARM_VAR
LEFT JOIN (SELECT * FROM DIC_TRANSLATIONS WHERE DIC_TRANSLATIONS.LANGUAGE = ('de')) DIC_TRANSLATIONS_MT
ON (ARC_ALARM_VAR.MESSAGETEXT_GROUPID = DIC_TRANSLATIONS_MT.GROUPID AND ARC_ALARM_VAR.MESSAGETEXT = DIC_TRANSLATIONS_MT.TEXTID)
LEFT JOIN (SELECT * FROM DIC_TRANSLATIONS WHERE DIC_TRANSLATIONS.LANGUAGE = ('de')) DIC_TRANSLATIONS_FGD
ON (ARC_ALARM_VAR.FGDESCRIPTION_GROUPID = DIC_TRANSLATIONS_FGD.GROUPID AND ARC_ALARM_VAR.FUNCTIONGROUPDESCRIPTION = DIC_TRANSLATIONS_FGD.TEXTID)
LEFT JOIN (SELECT * FROM DIC_TRANSLATIONS WHERE DIC_TRANSLATIONS.LANGUAGE = ('de')) DIC_TRANSLATIONS_PAD
ON (ARC_ALARM_VAR.PADNAME_GROUPID = DIC_TRANSLATIONS_PAD.GROUPID AND ARC_ALARM_VAR.PADNAME = DIC_TRANSLATIONS_PAD.TEXTID)
LEFT JOIN (SELECT * FROM DIC_TRANSLATIONS WHERE DIC_TRANSLATIONS.LANGUAGE = ('de')) DIC_TRANSLATIONS_DD
ON (ARC_ALARM_VAR.DEVICEDESCRIPTIONGROUPID = DIC_TRANSLATIONS_DD.GROUPID AND ARC_ALARM_VAR.DEVICEDESCRIPTION = DIC_TRANSLATIONS_DD.TEXTID)
WHERE
(
ARC_ALARM.VARIABLE_NAME = ARC_ALARM_VAR.VARIABLENAME
AND (
ARC_ALARM.TSBEGIN
BETWEEN '2015-08-06T10:59:00.000' AND '2015-08-11T10:59:14.574'
OR
ARC_ALARM.TSEND
BETWEEN
'2015-08-06T10:59:00.000' AND '2015-08-11T10:59:14.574'
OR (ARC_ALARM.TSBEGIN > '2015-08-06T10:59:00.000' AND ARC_ALARM.TSEND < '2015-08-11T10:59:14.574')
)
AND ARC_ALARM.ACTIVE=0
)
AND (((ARC_ALARM_VAR.MESSAGEGROUP = 'FM' AND ARC_ALARM_VAR.MESSAGEGROUP IS NOT NULL)))
2. all Browsers
3. Problem definition: Bug in WhereClause of Server side
The velocity Variables are not set Correctly in whereClause:
The velocity Variable are set as String in the whereClause. They are not converted tho the correct time format or to the correct local time.
a. The whereClause is this
<whereClause>
<![CDATA[
ARC_ALARM.VARIABLE_NAME = ARC_ALARM_VAR.VARIABLENAME
AND (
ARC_ALARM.TSBEGIN
BETWEEN $advancedCriteria.TSFROM AND $advancedCriteria.TSTO
OR
ARC_ALARM.TSEND
BETWEEN
$advancedCriteria.TSFROM AND $advancedCriteria.TSTO
OR (ARC_ALARM.TSBEGIN < $advancedCriteria.TSFROM AND ARC_ALARM.TSEND > $advancedCriteria.TSTO ))
AND ARC_ALARM.ACTIVE=0
AND ($defaultWhereClause)
]]>
</whereClause>
b. it send following Query to the database and Cause Sql Error due to wrong date Format:
WHERE
(
ARC_ALARM.VARIABLE_NAME = ARC_ALARM_VAR.VARIABLENAME
AND (
ARC_ALARM.TSBEGIN
BETWEEN '2015-08-06T10:59:00.000' AND '2015-08-11T10:59:14.574'
OR
ARC_ALARM.TSEND
BETWEEN
'2015-08-06T10:59:00.000' AND '2015-08-11T10:59:14.574'
OR (ARC_ALARM.TSBEGIN > '2015-08-06T10:59:00.000' AND ARC_ALARM.TSEND < '2015-08-11T10:59:14.574')
)
AND ARC_ALARM.ACTIVE=0
)
AND (((ARC_ALARM_VAR.MESSAGEGROUP = 'FM' AND ARC_ALARM_VAR.MESSAGEGROUP IS NOT NULL)))
c. The Date should be normaly like this and its work every where else in the Query but not in the WhereClause
TO_DATE('2015-08-06 12:59:00', 'YYYY-MM-DD HH24:MI:SS')
d. on the client side work everythings correct. I need the part in Server side to create PDF Report using "Jsasper Report"
f. here is the Datasource
<DataSource
ID="alarm_top_ten_range"
serverType="sql"
tableName="ARC_ALARM"
qualifyColumnNames="false">
<!-- requiresAuthentication="true" -->
<fields>
<field name="CNT" type="integer" customSelectExpression="count(*)" />
<field name="SUM" type="text" customSelectExpression="regexp_substr(numtodsinterval(sum((sysdate + (TSEND - TSBEGIN)) - sysdate),'day'), '\d{3} \d{2}:\d{2}:\d{2}\')" />
<field name="AVG" type="text" customSelectExpression="regexp_substr(numtodsinterval(avg(($currentDate + (TSEND - TSBEGIN)) - $currentDate),'day'), '\d{3} \d{2}:\d{2}:\d{2}\')" />
<field name="MIN" type="text" customSelectExpression="regexp_substr(numtodsinterval(min(($currentDate + (TSEND - TSBEGIN)) - $currentDate),'day'), '\d{3} \d{2}:\d{2}:\d{2}\')" />
<field name="MAX" type="text" customSelectExpression="regexp_substr(numtodsinterval(max(($currentDate + (TSEND - TSBEGIN)) - $currentDate),'day'), '\d{3} \d{2}:\d{2}:\d{2}\')" />
<field name="TEXT" type="text" tableName="DIC_TRANSLATIONS_MT" customSelectExpression="REPLACE(DIC_TRANSLATIONS_MT.TEXT,'%f1',P1)" nativeName="TEXT"/>
<field name="MESSAGETYPE" type="text" tableName="ARC_ALARM_VAR" />
<field name="ISWARNING" type="integer" tableName="ARC_ALARM_VAR" />
<field name="MESSAGEGROUP" type="text" tableName="ARC_ALARM_VAR" />
<field name="PAD" type="text" tableName="ARC_ALARM_VAR" />
<field name="PADNAME" type="text" tableName="DIC_TRANSLATIONS_PAD" nativeName="DIC_TRANSLATIONS_PAD.TEXT" />
<field name="ESTOPAREA" type="text" tableName="ARC_ALARM_VAR" />
<field name="PANELAREA" type="text" tableName="ARC_ALARM_VAR" />
<field name="CONSOLEAREA" type="text" tableName="ARC_ALARM_VAR" />
<field name="FUNCTIONGROUP" type="text" tableName="ARC_ALARM_VAR" />
<field name="FUNCTIONGROUPDESCRIPTION" type="text" tableName="DIC_TRANSLATIONS_FGD" nativeName="DIC_TRANSLATIONS_FGD.TEXT"/>
<field name="DEVICE" type="text" tableName="ARC_ALARM_VAR" />
<field name="DEVICEDESCRIPTION" type="text" tableName="DIC_TRANSLATIONS_DD" nativeName="DIC_TRANSLATIONS_DD.TEXT"/>
<field name="VARIABLE_NAME" type="text" tableName="ARC_ALARM"/>
<field name="ADDRESS" type="text" tableName="ARC_ALARM_VAR" />
<field name="INTERVALBEGIN_ID" type="integer" customSelectExpression="min(INTERVALBEGIN_ID)"/>
<field name="INTERVALEND_ID" type="integer" customSelectExpression="max(INTERVALEND_ID)"/>
<field name="TSFIRSTBEGIN" type="datetime" customSelectExpression="min(TSBEGIN)" />
<field name="TSLASTEND" type="datetime" customSelectExpression="max(TSEND)" />
<field name="TSFROM" type="datetime" customSQL="true" />
<field name="TSTO" type="datetime" customSQL="true" />
</fields>
<operationBindings>
<operationBinding operationType="fetch">
<tableClause>
ARC_ALARM, ARC_ALARM_VAR
LEFT JOIN (SELECT * FROM DIC_TRANSLATIONS WHERE DIC_TRANSLATIONS.LANGUAGE = ($session.locale.language)) DIC_TRANSLATIONS_MT
ON (ARC_ALARM_VAR.MESSAGETEXT_GROUPID = DIC_TRANSLATIONS_MT.GROUPID AND ARC_ALARM_VAR.MESSAGETEXT = DIC_TRANSLATIONS_MT.TEXTID)
LEFT JOIN (SELECT * FROM DIC_TRANSLATIONS WHERE DIC_TRANSLATIONS.LANGUAGE = ($session.locale.language)) DIC_TRANSLATIONS_FGD
ON (ARC_ALARM_VAR.FGDESCRIPTION_GROUPID = DIC_TRANSLATIONS_FGD.GROUPID AND ARC_ALARM_VAR.FUNCTIONGROUPDESCRIPTION = DIC_TRANSLATIONS_FGD.TEXTID)
LEFT JOIN (SELECT * FROM DIC_TRANSLATIONS WHERE DIC_TRANSLATIONS.LANGUAGE = ($session.locale.language)) DIC_TRANSLATIONS_PAD
ON (ARC_ALARM_VAR.PADNAME_GROUPID = DIC_TRANSLATIONS_PAD.GROUPID AND ARC_ALARM_VAR.PADNAME = DIC_TRANSLATIONS_PAD.TEXTID)
LEFT JOIN (SELECT * FROM DIC_TRANSLATIONS WHERE DIC_TRANSLATIONS.LANGUAGE = ($session.locale.language)) DIC_TRANSLATIONS_DD
ON (ARC_ALARM_VAR.DEVICEDESCRIPTIONGROUPID = DIC_TRANSLATIONS_DD.GROUPID AND ARC_ALARM_VAR.DEVICEDESCRIPTION = DIC_TRANSLATIONS_DD.TEXTID)
</tableClause>
<whereClause>
<![CDATA[
ARC_ALARM.VARIABLE_NAME = ARC_ALARM_VAR.VARIABLENAME AND (ARC_ALARM.TSBEGIN BETWEEN $advancedCriteria.TSFROM AND $advancedCriteria.TSTO OR ARC_ALARM.TSEND BETWEEN $advancedCriteria.TSFROM AND $advancedCriteria.TSTO OR (ARC_ALARM.TSBEGIN < $advancedCriteria.TSFROM AND ARC_ALARM.TSEND > $advancedCriteria.TSTO )) AND ARC_ALARM.ACTIVE=0 AND ($defaultWhereClause)
]]>
</whereClause>
<groupClause>
REPLACE(DIC_TRANSLATIONS_MT.TEXT,'%f1',P1), MESSAGETEXT, MESSAGETYPE, ISWARNING, MESSAGEGROUP, PAD, DIC_TRANSLATIONS_PAD.TEXT, ESTOPAREA, PANELAREA, CONSOLEAREA, FUNCTIONGROUP, DIC_TRANSLATIONS_FGD.TEXT, DEVICE, DIC_TRANSLATIONS_DD.TEXT, ARC_ALARM.VARIABLE_NAME, ADDRESS
</groupClause>
</operationBinding>
</operationBindings>
</DataSource>
6. here the sql send to databse causing Oracle Error due to wrong Date Format
SELECT count(*) AS CNT, regexp_substr(numtodsinterval(sum((sysdate + (TSEND - TSBEGIN)) - sysdate),'day'), '\d{3} \d{2}:\d{2}:\d{2}\') AS SUM, regexp_substr(numtodsinterval(avg((TO_DATE('2015-08-11 12:59:30','YYYY-MM-DD HH24:MI:SS') + (TSEND - TSBEGIN)) - TO_DATE('2015-08-11 12:59:30','YYYY-MM-DD HH24:MI:SS')),'day'), '\d{3} \d{2}:\d{2}:\d{2}\') AS AVG, regexp_substr(numtodsinterval(min((TO_DATE('2015-08-11 12:59:30','YYYY-MM-DD HH24:MI:SS') + (TSEND - TSBEGIN)) - TO_DATE('2015-08-11 12:59:30','YYYY-MM-DD HH24:MI:SS')),'day'), '\d{3} \d{2}:\d{2}:\d{2}\') AS MIN, regexp_substr(numtodsinterval(max((TO_DATE('2015-08-11 12:59:30','YYYY-MM-DD HH24:MI:SS') + (TSEND - TSBEGIN)) - TO_DATE('2015-08-11 12:59:30','YYYY-MM-DD HH24:MI:SS')),'day'), '\d{3} \d{2}:\d{2}:\d{2}\') AS MAX, REPLACE(DIC_TRANSLATIONS_MT.TEXT,'%f1',P1) AS TEXT, MESSAGETYPE, , DIC_TRANSLATIONS_FGD.TEXT AS FUNCTIONGROUPDESCRIPTION, DEVICE, DIC_TRANSLATIONS_DD.TEXT AS DEVICEDESCRIPTION, VARIABLE_NAME, ADDRESS, min(INTERVALBEGIN_ID) AS INTERVALBEGIN_ID, max(INTERVALEND_ID) AS INTERVALEND_ID, min(TSBEGIN) AS TSFIRSTBEGIN, max(TSEND) AS TSLASTEND FROM
ARC_ALARM, ARC_ALARM_VAR
LEFT JOIN (SELECT * FROM DIC_TRANSLATIONS WHERE DIC_TRANSLATIONS.LANGUAGE = ('de')) DIC_TRANSLATIONS_MT
ON (ARC_ALARM_VAR.MESSAGETEXT_GROUPID = DIC_TRANSLATIONS_MT.GROUPID AND ARC_ALARM_VAR.MESSAGETEXT = DIC_TRANSLATIONS_MT.TEXTID)
LEFT JOIN (SELECT * FROM DIC_TRANSLATIONS WHERE DIC_TRANSLATIONS.LANGUAGE = ('de')) DIC_TRANSLATIONS_FGD
ON (ARC_ALARM_VAR.FGDESCRIPTION_GROUPID = DIC_TRANSLATIONS_FGD.GROUPID AND ARC_ALARM_VAR.FUNCTIONGROUPDESCRIPTION = DIC_TRANSLATIONS_FGD.TEXTID)
LEFT JOIN (SELECT * FROM DIC_TRANSLATIONS WHERE DIC_TRANSLATIONS.LANGUAGE = ('de')) DIC_TRANSLATIONS_PAD
ON (ARC_ALARM_VAR.PADNAME_GROUPID = DIC_TRANSLATIONS_PAD.GROUPID AND ARC_ALARM_VAR.PADNAME = DIC_TRANSLATIONS_PAD.TEXTID)
LEFT JOIN (SELECT * FROM DIC_TRANSLATIONS WHERE DIC_TRANSLATIONS.LANGUAGE = ('de')) DIC_TRANSLATIONS_DD
ON (ARC_ALARM_VAR.DEVICEDESCRIPTIONGROUPID = DIC_TRANSLATIONS_DD.GROUPID AND ARC_ALARM_VAR.DEVICEDESCRIPTION = DIC_TRANSLATIONS_DD.TEXTID)
WHERE
(
ARC_ALARM.VARIABLE_NAME = ARC_ALARM_VAR.VARIABLENAME
AND (
ARC_ALARM.TSBEGIN
BETWEEN '2015-08-06T10:59:00.000' AND '2015-08-11T10:59:14.574'
OR
ARC_ALARM.TSEND
BETWEEN
'2015-08-06T10:59:00.000' AND '2015-08-11T10:59:14.574'
OR (ARC_ALARM.TSBEGIN > '2015-08-06T10:59:00.000' AND ARC_ALARM.TSEND < '2015-08-11T10:59:14.574')
)
AND ARC_ALARM.ACTIVE=0
)
AND (((ARC_ALARM_VAR.MESSAGEGROUP = 'FM' AND ARC_ALARM_VAR.MESSAGEGROUP IS NOT NULL)))
Comment