Package gudusoft.gsqlparser.stmt
Class TMergeSqlStatement
Object
gudusoft.gsqlparser.nodes.TParseTreeNode
gudusoft.gsqlparser.TCustomSqlStatement
gudusoft.gsqlparser.stmt.TMergeSqlStatement
- All Implemented Interfaces:
IRelation,Visitable,Iterator<TSourceToken>
Merge SQL statement.
TCustomSqlStatement.getTargetTable() returns the target table.
getUsingTable() returns the source table in the using clause.
getCondition() returns the merge search condition.
getWhenClauses() returns when MATCHED/NOT MATCHED clauses.
merge into target_table [column_list]
using source_table|subquery
on merge_search_condition
[when matched [and search_conditions ] then update set {col_name = expression} | delete]
[when not matched [and search_conditions ] then insert [(column_list)] values (value_list)]
call TCustomSqlStatement.getTargetTable() to return a value for target_table.
column_list can be fetched from getColumnList() if any.
source_table in using clause can be fetched via getUsingTable(),
subquery treated as a table as well.
call getCondition() to return merge_search_condition.
when [not] matched clause is available by calling getWhenClauses()
which is a list of type TMergeWhenClause.
-
Nested Class Summary
Nested classes/interfaces inherited from class gudusoft.gsqlparser.TCustomSqlStatement
TCustomSqlStatement.SqlNormalizationProfile -
Field Summary
Fields inherited from class gudusoft.gsqlparser.TCustomSqlStatement
dummytag, fromClause, fromSourceJoin, fromSourceTable, isctequery, isparsed, joins, parser, plsqlparser, relationAttributes, rootNode, semicolonended, sourcetokenlist, sqlstatementtype, stmtScope, tablesFields inherited from class gudusoft.gsqlparser.nodes.TParseTreeNode
dbvendor, doubleLinkedTokenListToString, nodeActionAppend, nodeActionInsert, nodeActionRemove, nodeActionUnknown, nodeActionUpdate, nodeActionUpdateText, nodeChangeEndToken, nodeChangeStartToken -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAccept a visitorvoidAccept a visitor to iterate this class and sub-nodes of this classintColumns in target table.merge search condition.Oracle error logging clause.This method is not used, usegetWhenClauses()instead.Couchbase, limit clause.This method is not used, usegetCondition()instead.This method is not used, usegetCondition()instead.sql server option clauseCouchbase, returning clause.This method is not used, usegetWhenClauses()instead.Source table in the using clause.when matched/not matched clauses.voidsetColumnList(TObjectNameList columnList) voidsetCondition(TExpression condition) voidsetErrorLoggingClause(TErrorLoggingClause errorLoggingClause) voidsetInsertClause(TMergeInsertClause insertClause) voidsetLimitClause(TLimitClause limitClause) voidsetMatchedSearchCondition(TExpression matchedSearchCondition) voidsetNotMatchedSearchCondition(TExpression notMatchedSearchCondition) voidsetOptionClause(TOptionClause optionClause) voidsetReturningClause(TReturningClause returningClause) voidsetUpdateClause(TMergeUpdateClause updateClause) voidsetUsingTable(TTable usingTable) voidsetWhenClauses(TPTNodeList<TMergeWhenClause> whenClauses) Methods inherited from class gudusoft.gsqlparser.TCustomSqlStatement
addToTables, addWhereClause, analyzeFromTable, analyzeFromTable, analyzeJoin, analyzeTablename, analyzeTableOrJoin, asCanonical, checkNonQualifiedColumnReferenceInSubQueryOfUplevelStmt, clearError, computeSqlHash, dochecksyntax, findTable, fireOnMetaDatabaseTableColumn, getAncestorStmt, getAttributes, getColumnsInTable, getColumnsInTable, getCteIncludeThisStmt, getCteList, getDaxFunctionStack, getEndlabelName, getErrorCount, getErrormessage, getExpandedResultColumns, getFirstPhysicalTable, getFrameStack, getFromClause, getFromSourceJoin, getFromSourceTable, getGlobalScope, getIndexColumns, getJoins, getLabelName, getOrphanColumns, getOutputClause, getParentObjectName, getParentStmt, getQueryId, getRelationName, getRelations, getResultColumnList, getSqlEnv, getSqlHash, getSqlHash, getStatements, getStmtScope, getSymbolTable, getSyntaxErrors, getSyntaxHints, getTables, getTargetTable, getTokenList, getTopClause, getTopStatement, getUsingVariableList, getVariableStack, getWhereClause, isathenaplsql, isBigQueryplsql, isdatabricksplsql, isGaussDBStoredProcedure, isgreeplumplsql, isnzplsql, isoracleplsql, ispgplsql, isprestoplsql, issnowflakeplsql, isTableACTE, isverticaplsql, linkColumnReferenceToTable, linkColumnToTable, linkToFirstTable, locateVariableOrParameter, locateVariableOrParameter, OracleStatementCanBeSeparatedByBeginEndPair, parseerrormessagehandle, parsestatement, parsestatement, searchCTEList, searchDaxVariableInStack, searchFunctionInSQLEnv, setAlreadyAddToParent, setCteIncludeThisStmt, setCteList, setEndlabelName, setFrameStack, setFromClause, setLabelName, setOutputClause, setParentStmt, setParentStmtToNull, setQueryId, setResultColumnList, setSqlHash, setStmtScope, setTargetTable, setTopClause, setUsingVariableList, setVariableStack, setWhereClause, size, toNormalizedSql, toScript, VerticaStatementCanBeSeparatedByBeginEndPairMethods inherited from class gudusoft.gsqlparser.nodes.TParseTreeNode
addAllMyTokensToTokenList, addToTokenChain, appendNewNode, calculateTokenCount, doAppendNewNode, doParse, fastSetString, getAnchorNode, getColumnNo, getCommentAfterNode, getCommentBeforeNode, getCompactString, getDummyTag, getEndToken, getEvaluateDatatype, getEvalValue, getGsqlparser, getLineNo, getLocation, getMd5, getNodeStatus, getNodeType, getPlainText, getStartToken, getTokenCount, hasNext, init, init, init, init, init, init, insertAfterAToken, insertNewNodeBeforeMe, isChanged, isTokensInChain, next, refreshAllNodesTokenCount, remove, removeAllMyTokensFromTokenList, removeTokens, removeTokensBetweenNodes, removeTokensBetweenToken, replaceWithNewNode, resetIterator, setAnchorNode, setChanged, setDummyTag, setEndToken, setEndToken, setEndToken, setEndToken, setEndToken, setEndTokenDirectly, setEvaluateDatatype, setEvalValue, setGsqlparser, setIncludingComment, setLocation, setNewSubNode, setNodeStatus, setNodeType, setParent, setPlainText, setStartToken, setStartToken, setStartToken, setStartToken, setStartTokenDirectly, setString, setString2, subNodeInNode, toString, toString2Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Iterator
forEachRemaining
-
Constructor Details
-
TMergeSqlStatement
-
-
Method Details
-
getErrorLoggingClause
Oracle error logging clause.- Returns:
- Oracle error logging clause.
-
getOptionClause
sql server option clause- Returns:
- option clause
- See Also:
-
getColumnList
Columns in target table.- Returns:
- Columns in target table.
-
getMatchedSearchCondition
This method is not used, usegetCondition()instead.- Returns:
- not used
-
getNotMatchedSearchCondition
This method is not used, usegetCondition()instead.- Returns:
- not used
-
getUsingTable
Source table in the using clause.- Returns:
- Source table in the using clause.
-
getCondition
merge search condition.- Returns:
- merge search condition.
-
getUpdateClause
This method is not used, usegetWhenClauses()instead.- Returns:
-
getInsertClause
This method is not used, usegetWhenClauses()instead.- Returns:
-
getWhenClauses
when matched/not matched clauses.- Returns:
- when matched/not matched clauses.
-
doParseStatement
- Overrides:
doParseStatementin classTCustomSqlStatement
-
accept
Description copied from class:TParseTreeNodeAccept a visitor- Specified by:
acceptin interfaceVisitable- Overrides:
acceptin classTParseTreeNode- Parameters:
v- visitor is a descendant class ofTParseTreeVisitor
-
acceptChildren
Description copied from class:TParseTreeNodeAccept a visitor to iterate this class and sub-nodes of this class- Specified by:
acceptChildrenin interfaceVisitable- Overrides:
acceptChildrenin classTParseTreeNode- Parameters:
v- visitor is a descendant class ofTParseTreeVisitor
-
setErrorLoggingClause
-
setOptionClause
-
setMatchedSearchCondition
-
setNotMatchedSearchCondition
-
setColumnList
-
setUsingTable
-
setCondition
-
setUpdateClause
-
setInsertClause
-
setWhenClauses
-
setLimitClause
-
getLimitClause
Couchbase, limit clause.- Returns:
- Couchbase, limit clause.
-
setReturningClause
- Overrides:
setReturningClausein classTCustomSqlStatement
-
getReturningClause
Couchbase, returning clause.- Overrides:
getReturningClausein classTCustomSqlStatement- Returns:
- Couchbase, returning clause.
-