You can use convert to change the expression datatype in these ways:
Convert Java types where the Java datatype is a Java object type to the SQL datatype shown in “Datatype mapping between Java and SQL”. The action of the convert function is the mapping implied by the Java-SQL mapping.
Convert SQL datatypes to Java types shown in “Datatype mapping between Java and SQL”. The action of the convert function is the mapping implied by the SQL-Java mapping.
Convert any Java-SQL class installed in the SQL system to any other Java-SQL class installed in the SQL system if the compile-time datatype of the expression (source class) is a subclass or superclass of the target class. Otherwise, an exception is raised.
The result of the conversion is associated with the current database.
See “Using the SQL convert function for Java subtypes,” for a discussion of the use of the convert function for Java subtypes.