Column col = fmd.getColumns()[0];
sql.append(col.getName());
sql.append(" = ");
ExpState state = val.initialize(sel, ctx, 0);
val.calculateValue(sel, ctx, state, null, null);
// append the value with a null for the Select; i
// indicates that the
int length = val.length(sel, ctx, state);
for (int j = 0; j < length; j++)