public void compatible(ValueNode leftOperand) throws StandardException
{
int size = size();
TypeId leftType;
ValueNode valueNode;
TypeCompiler leftTC;
leftType = leftOperand.getTypeId();
leftTC = leftOperand.getTypeCompiler();
for (int index = 0; index < size; index++)
{
valueNode = (ValueNode) elementAt(index);
if (valueNode.requiresTypeFromContext())
continue;
/*
** Are the types compatible to each other? If not, throw an exception.
*/
if (! leftTC.compatible(valueNode.getTypeId()))
{
throw StandardException.newException(SQLState.LANG_DB2_COALESCE_DATATYPE_MISMATCH,
leftType.getSQLTypeName(),
valueNode.getTypeId().getSQLTypeName()
);