* @return the result of executing the statement
*/
Result getResult(Session session) {
Result resultOut = null;
RowSetNavigator generatedNavigator = null;
PersistentStore store = baseTable.getRowStore(session);
int count;
if (generatedIndexes != null) {
resultOut = Result.newUpdateCountResult(generatedResultMetaData,
0);
generatedNavigator = resultOut.getChainedResult().getNavigator();
}
if (isSimpleInsert) {
Type[] colTypes = baseTable.getColumnTypes();
Object[] data = getInsertData(session, colTypes,
insertExpression.nodes[0].nodes);
return insertSingleRow(session, store, data);
}
RowSetNavigator newDataNavigator = queryExpression == null
? getInsertValuesNavigator(session)
: getInsertSelectNavigator(session);
count = newDataNavigator.getSize();
if (count > 0) {
insertRowSet(session, generatedNavigator, newDataNavigator);
}