I have strange problem that I can't fix.
I'm trying to delete all rows that them timestamp is older than 1 hour.
SQL :
DELETE FROM TABLE WHERE TIMESTAMP <= SYSTIMESTAMP - 1/24
Whole code work perfect in SQL Developer but when i try do same in iBatis.net i got timeouts.
<statements>
<delete id="DeleteRows" parameterClass="int">
<![CDATA[
DELETE FROM TABLE WHERE TIMESTAMP <= SYSTIMESTAMP - #VALUE#/24
<!--THIS DON'T WORK-->
]]>
</delete>
</statements>
Another strange thing is that problem don't exist when i hange less-than operator to 'equal-to' e.g
<statements>
<delete id="DeleteRows" parameterClass="int">
<![CDATA[
DELETE FROM TABLE WHERE TIMESTAMP = SYSTIMESTAMP - #VALUE#/24
<!--THIS WORK-->
]]>
</delete>
</statements>
Timeouts i gen only with Les-than and grater-than operators and only in iBatis.net. Does any body know why ?
Funny fact. When i query DELETE FROM TABLE WHERE TIMESTAMP < '07-AUG-11'
it work. Also when i try to query DELETE FROM TABLE WHERE TIMESTAMP BETWEEN '07-AUG-11' AND SYSTIMESTAMP
it works too. It seems to be problem ony with <
and >
combine with SYSTIMESTAMP
Is there other way to delete rows older than one hour without using those operators ?
Thanks