ValueNode whereClause = null;
TableName tableName = new TableName();
tableName.init(schemaName , targetTableName);
NodeFactory nodeFactory = getNodeFactory();
FromList fromList = (FromList) nodeFactory.getNode(C_NodeTypes.FROM_LIST, getContextManager());
FromTable fromTable = (FromTable) nodeFactory.getNode(
C_NodeTypes.FROM_BASE_TABLE,
tableName,
null,
ReuseFactory.getInteger(FromBaseTable.DELETE),
null,
getContextManager());
//we would like to use references index & table scan instead of
//what optimizer says for the dependent table scan.
Properties targetProperties = new FormatableProperties();
targetProperties.put("index", "null");
((FromBaseTable) fromTable).setTableProperties(targetProperties);
fromList.addFromTable(fromTable);
SelectNode resultSet = (SelectNode) nodeFactory.getNode(
C_NodeTypes.SELECT_NODE,
getSetClause(tableName, cdl),
null, /* AGGREGATE list */
fromList, /* FROM list */
whereClause, /* WHERE clause */
null, /* GROUP BY list */
null, /* having clause */
getContextManager());
return (StatementNode) nodeFactory.getNode(
C_NodeTypes.UPDATE_NODE,
tableName,
resultSet,
getContextManager());