FromSubquery viewSubquery;
try {
viewSubquery = viewdef.copySubquery(fromBaseTable.getParserContext());
}
catch (StandardException ex) {
throw new ViewHasBadSubqueryException(origName.toString(),
ex.getMessage());
}
if (fromBaseTable.getCorrelationName() != null)
tableName = fromBaseTable.getCorrelationName();
viewSubquery.setCorrelationName(tableName);