thenElseList.setParameterDescriptor(dts);
}
/* The then and else expressions must be type compatible */
ClassInspector cu = getClassFactory().getClassInspector();
/*
** If it is comparable, then we are ok. Note that we
** could in fact allow any expressions that are convertible()
** since we are going to generate a cast node, but that might
** be confusing to users...
*/
// RESOLVE DJDOI - this looks wrong, why should the then expression
// be comparable to the then expression ??
if (! thenExpression.getTypeServices().
comparable(elseExpression.getTypeServices(), false, getClassFactory()) &&
! cu.assignableTo(thenExpression.getTypeId().getCorrespondingJavaTypeName(),
elseExpression.getTypeId().getCorrespondingJavaTypeName()) &&
! cu.assignableTo(elseExpression.getTypeId().getCorrespondingJavaTypeName(),
thenExpression.getTypeId().getCorrespondingJavaTypeName()))
{
throw StandardException.newException(SQLState.LANG_NOT_TYPE_COMPATIBLE,
thenExpression.getTypeId().getSQLTypeName(),
elseExpression.getTypeId().getSQLTypeName()