Class MergeResultSet
- All Implemented Interfaces:
ResultSet
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate MergeConstantActionprivate NoPutResultSet////////////////////////////////////////////////////////////////////////////////private intprivate ExecRowprivate longprivate BackingStoreHashtableprivate TemporaryRowHolderImpl[]Fields inherited from class NoRowsResultSetImpl
activation, beginExecutionTime, beginTime, endExecutionTime, endTime, lccFields inherited from interface ResultSet
CURRENT_RESULTSET_ONLY, ENTIRE_RESULTSET_TREE, ISAFTERLAST, ISBEFOREFIRST, ISFIRST, ISLAST -
Constructor Summary
ConstructorsConstructorDescriptionMergeResultSet(NoPutResultSet drivingLeftJoin, Activation activation) Construct from a driving left join and an Activation. -
Method Summary
Modifier and TypeMethodDescriptionprivate voidaddSubjectRow(SQLRef subjectRowID) Add another subject row id to the evolving hashtable of affected target rows.voidcleanUp()Tells the system to clean up on an error.voidclose()Clean up resources and call close on data members.(package private) booleanLoop through the rows in the driving left join.private voidCreate a BackingStoreHashtable to hold the ids of subject rows.voidfinish()Tells the system that there will be no more access to any database information via this result set; in particular, no more calls to open().final long////////////////////////////////////////////////////////////////////////////////voidopen()Needs to be called before the result set will do anything.(package private) voidsetup()Set up the result set for use.Methods inherited from class NoRowsResultSetImpl
addWarning, checkRowPosition, clearCurrentRow, close, doesCommit, evaluateGenerationClauses, getAbsoluteRow, getActivation, getAutoGeneratedKeysResultset, getBeginExecutionTimestamp, getCurrentTimeMillis, getCursorName, getEndExecutionTimestamp, getExecuteTime, getFirstRow, getLastRow, getNextRow, getPreviousRow, getQueryPlanText, getRelativeRow, getResultDescription, getRowNumber, getSubqueryTrackingArray, getTimeSpent, getWarnings, isClosed, returnsRows, setAfterLastRow, setBeforeFirstRow, toXML
-
Field Details
-
_drivingLeftJoin
//////////////////////////////////////////////////////////////////////////////// -
_constants
-
_row
-
_rowCount
private long _rowCount -
_thenRows
-
_subjectRowIDs
-
_numOpens
private int _numOpens
-
-
Constructor Details
-
MergeResultSet
MergeResultSet(NoPutResultSet drivingLeftJoin, Activation activation) throws StandardException Construct from a driving left join and an Activation.- Throws:
StandardException
-
-
Method Details
-
modifiedRowCount
public final long modifiedRowCount()////////////////////////////////////////////////////////////////////////////////- Specified by:
modifiedRowCountin interfaceResultSet- Overrides:
modifiedRowCountin classNoRowsResultSetImpl- Returns:
- The number of rows affect by the statement, so far.
-
open
Description copied from interface:ResultSetNeeds to be called before the result set will do anything. Need to call before getNextRow(), or for a result set that doesn't return rows, this is the call that will cause all the work to be done.- Throws:
StandardException- Thrown on failure
-
setup
Description copied from class:NoRowsResultSetImplSet up the result set for use. Should always be called fromopen().- Overrides:
setupin classNoRowsResultSetImpl- Throws:
StandardException- thrown on error
-
close
Clean up resources and call close on data members.- Throws:
StandardException- Thrown on error.
-
cleanUp
Description copied from interface:ResultSetTells the system to clean up on an error.- Throws:
StandardException- Thrown on error.
-
finish
Description copied from interface:ResultSetTells the system that there will be no more access to any database information via this result set; in particular, no more calls to open(). Will close the result set if it is not already closed.- Specified by:
finishin interfaceResultSet- Overrides:
finishin classNoRowsResultSetImpl- Throws:
StandardException- on error
-
collectAffectedRows
Loop through the rows in the driving left join.
- Throws:
StandardException
-
addSubjectRow
Add another subject row id to the evolving hashtable of affected target rows. The concept of a subject row is defined by the 2011 SQL Standard, part 2, section 14.12 (merge statement), general rule 6. A row in the target table is a subject row if it joins to the source table on the main search condition and if the joined row satisfies the matching refinement condition for some WHEN MATCHED clause. A row in the target table may only be a subject row once. That is, a given target row may only qualify for UPDATE or DELETE processing once. If it qualifies for more than one UPDATE or DELETE action, then the Standard requires us to raise a cardinality violation.
- Parameters:
subjectRowID- The location of the subject row.- Throws:
StandardException- A cardinality exception is thrown if we've already added this subject row.
-
createSubjectRowIDhashtable
Create a BackingStoreHashtable to hold the ids of subject rows.
- Throws:
StandardException
-