Replace with SQL92 type casting.

To make it work for H2 and Oracle as well