public class TInsertSqlStatement extends TCustomSqlStatement
TCustomSqlStatement.getTargetTable() returns the table or view that receive the data.
getColumnList() returns the list of columns in target table if specified.
getValues().
getInsertSource() before fetch the data source which may various from value clause
to subquery and other forms. Below are some data source types:
INSERT INTO Production.UnitMeasure (Name, UnitMeasureCode,ModifiedDate) VALUES (N'Square Yards', N'Y2', GETDATE());Table name: Production.UnitMeasure. Fetched from
TCustomSqlStatement.getTargetTable() or the first element of TCustomSqlStatement.tables
getColumnList()
getValues()
INSERT INTO dbo.EmployeeSales SELECT 'SELECT', sp.BusinessEntityID, c.LastName, sp.SalesYTD FROM Sales.SalesPerson AS sp INNER JOIN Person.Person AS c ON sp.BusinessEntityID = c.BusinessEntityID WHERE sp.BusinessEntityID LIKE '2%' ORDER BY sp.BusinessEntityID, c.LastName;select query in above insert statement can be fetched from
getSubQuery()TCustomSqlStatement.SqlNormalizationProfiledummytag, fromClause, fromSourceJoin, fromSourceTable, isctequery, isparsed, joins, parser, plsqlparser, relationAttributes, rootNode, semicolonended, sourcetokenlist, sqlstatementtype, stmtScope, tablesdbvendor, doubleLinkedTokenListToString, nodeActionAppend, nodeActionInsert, nodeActionRemove, nodeActionUnknown, nodeActionUpdate, nodeActionUpdateText, nodeChangeEndToken, nodeChangeStartToken| Constructor and Description |
|---|
TInsertSqlStatement(EDbVendor dbvendor) |
| Modifier and Type | Method and Description |
|---|---|
void |
accept(TParseTreeVisitor v)
Accept a visitor
|
void |
acceptChildren(TParseTreeVisitor v)
Accept a visitor to iterate this class and sub-nodes of this class
|
int |
doParseStatement(TCustomSqlStatement psql) |
TObjectNameList |
getColumnList()
columns of the target table.
|
TObjectName |
getDirectoryName()
Hive directory name
|
TPTNodeList<TInsertIntoValue> |
getElseIntoValues()
Oracle, values in else clause
|
TErrorLoggingClause |
getErrorLoggingClause()
Oracle error logging clause
|
TMssqlExecute |
getExecuteStmt()
SQL Server, execute statement used in the insert statement.
|
String |
getFileFormat() |
String |
getFileOptions() |
TFunctionCall |
getFunctionCall()
value clause valid when
getInsertSource() is EInsertSource.values_function. |
EHiveInsertType |
getHiveInsertType()
Hive insert type
|
TSourceToken |
getIgnore()
IGNORE keyword used in the insert statement.
|
TPTNodeList<TInsertCondition> |
getInsertConditions()
Oracle insert condition
|
TPTNodeList<TInsertIntoValue> |
getInsertIntoValues()
Oracle insert into values used after insert all/first clause
|
TObjectName |
getInsertRowAlias()
Get MySQL 8.0.20+ row alias for INSERT ...
|
TObjectNameList |
getInsertRowAliasColumnList()
Get MySQL 8.0.20+ optional column aliases for the row alias.
|
EInsertSource |
getInsertSource()
Type of the source from where the data is coming for this insert statement.
|
TSourceToken |
getInsertToken()
INSERT keyword
|
ArrayList<TInsertSqlStatement> |
getMultiInsertStatements()
Hive, from table insert..., insert ...
|
TOnConflictClause |
getOnConflictClause()
PostgreSQL ON CONFLICT clause (UPSERT).
|
TResultColumnList |
getOnDuplicateKeyUpdate()
MySQL on duplicate key update column list.
|
TSourceToken |
getPriority_delayed()
DELAY, LOW_PRIORITY, HIGH_PRIORITY keyword used in insert statement.
|
TObjectName |
getRecordName()
Oracle PLSQL record name in values clause,
getInsertSource() returns EInsertSource.values_oracle_record |
TResultColumnList |
getSetColumnValues()
set column value clauses in MySQL insert statement.
|
TObjectName |
getSourceValueTable() |
TSelectSqlStatement |
getSubQuery()
value clause valid when
getInsertSource() is EInsertSource.subquery. |
TMultiTargetList |
getValues()
value clause, valid when
getInsertSource() is EInsertSource.values. |
int |
getValueType()
Deprecated.
As of v1.6.4.9, use
getInsertSource() instead. |
boolean |
isInsertAll()
Oracle insert all
|
boolean |
isInsertFirst()
Oracle insert first
|
boolean |
isMultiTableInsert()
Whether this is a multi-table insert,
INSERT ALL or INSERT FIRST: the VALUES of its INTO
clauses read the select list of its subquery. |
void |
setColumnList(TObjectNameList columnList) |
void |
setDirectoryName(TObjectName directoryName) |
void |
setErrorLoggingClause(TErrorLoggingClause errorLoggingClause) |
void |
setExecuteStmt(TMssqlExecute executeStmt) |
void |
setFunctionCall(TFunctionCall functionCall) |
void |
setHiveInsertType(EHiveInsertType hiveInsertType) |
void |
setInsertAll(boolean insertAll) |
void |
setInsertConditions(TPTNodeList<TInsertCondition> insertConditions) |
void |
setInsertFirst(boolean insertFirst) |
void |
setInsertIntoValues(TPTNodeList<TInsertIntoValue> insertIntoValues) |
void |
setInsertSource(EInsertSource insertSource) |
void |
setInsertToken(TSourceToken insertToken) |
void |
setOnDuplicateKeyUpdate(TResultColumnList onDuplicateKeyUpdate) |
void |
setRecordName(TObjectName recordName) |
void |
setSetColumnValues(TResultColumnList setColumnValues) |
void |
setSubQuery(TSelectSqlStatement subQuery) |
void |
setValues(TMultiTargetList values) |
void |
setValueType(int valueType) |
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, getReturningClause, getSqlEnv, getSqlHash, getSqlHash, getStatements, getStmtScope, getSymbolTable, getSyntaxErrors, getSyntaxHints, getTables, getTargetTable, getTokenList, getTopClause, getTopStatement, getUsingVariableList, getVariableStack, getWhereClause, isathenaplsql, isBigQueryplsql, isdatabricksplsql, isGaussDBStoredProcedure, isgreeplumplsql, isMySQLDialect, isMySQLDialect, isnzplsql, isoracleplsql, isOraclePseudoColumnReference, isOracleSequencePseudoColumnReference, 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, setReturningClause, setSqlHash, setStmtScope, setTargetTable, setTopClause, setUsingVariableList, setVariableStack, setWhereClause, size, toNormalizedSql, toScript, unbindCteTarget, VerticaStatementCanBeSeparatedByBeginEndPairaddAllMyTokensToTokenList, addToTokenChain, appendNewNode, calculateTokenCount, commentBlockAfter, commentBlockEndAfter, doAppendNewNode, doParse, fastSetString, getAnchorNode, getColumnNo, getCommentAfterNode, getCommentBeforeNode, getCommentBeforeNode, getCommentBeforeNode, getCompactString, getDummyTag, getEndToken, getEvaluateDatatype, getEvalValue, getGsqlparser, getLineNo, getLocation, getMd5, getNodeStatus, getNodeType, getPlainText, getStartToken, getTokenCount, hasNext, init, init, init, init, 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, toString2clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitforEachRemainingpublic TInsertSqlStatement(EDbVendor dbvendor)
public ArrayList<TInsertSqlStatement> getMultiInsertStatements()
public String getFileFormat()
public String getFileOptions()
public TObjectName getSourceValueTable()
public void setInsertAll(boolean insertAll)
public void setInsertFirst(boolean insertFirst)
public boolean isInsertAll()
public boolean isInsertFirst()
public boolean isMultiTableInsert()
INSERT ALL or INSERT FIRST: the VALUES of its INTO
clauses read the select list of its subquery. The two forms differ only in which WHEN branch receives a
row, so a rule about what a VALUES name reads must test this, not isInsertAll() alone.INSERT ALL and INSERT FIRSTpublic TErrorLoggingClause getErrorLoggingClause()
public EHiveInsertType getHiveInsertType()
public TObjectName getDirectoryName()
public TPTNodeList<TInsertCondition> getInsertConditions()
public TPTNodeList<TInsertIntoValue> getInsertIntoValues()
public void setInsertToken(TSourceToken insertToken)
public TSourceToken getInsertToken()
public TSelectSqlStatement getSubQuery()
getInsertSource() is EInsertSource.subquery.sub-querypublic TFunctionCall getFunctionCall()
getInsertSource() is EInsertSource.values_function.public TObjectName getRecordName()
getInsertSource() returns EInsertSource.values_oracle_recordpublic EInsertSource getInsertSource()
public int getValueType()
getInsertSource() instead.vt_values, getValues()
vt_values_empty, syntax like: value ()
vt_query, getSubQuery()
vt_default_values,
vt_execute,
vt_values_function, getFunctionCall()
public TMultiTargetList getValues()
getInsertSource() is EInsertSource.values.
represents in format like this: ((1,2,3),(4,5),(6,7,8)),
if even value clause is (1,2,3), it will be saved in TMultiTargetList like ((1,2,3))
public TResultColumnList getOnDuplicateKeyUpdate()
public TObjectName getInsertRowAlias()
public TObjectNameList getInsertRowAliasColumnList()
public TOnConflictClause getOnConflictClause()
Provides access to the conflict target (columns or constraint name), the action type (DO NOTHING or DO UPDATE), and the SET/WHERE clauses for DO UPDATE actions.
Example:
INSERT INTO tbl VALUES (1, 2) ON CONFLICT (id) DO UPDATE SET col = EXCLUDED.col;
public TSourceToken getIgnore()
public TSourceToken getPriority_delayed()
public TResultColumnList getSetColumnValues()
public TObjectNameList getColumnList()
public void setValues(TMultiTargetList values)
public void setColumnList(TObjectNameList columnList)
public void setSubQuery(TSelectSqlStatement subQuery)
public TMssqlExecute getExecuteStmt()
getInsertSource() returns EInsertSource.executepublic TPTNodeList<TInsertIntoValue> getElseIntoValues()
public int doParseStatement(TCustomSqlStatement psql)
doParseStatement in class TCustomSqlStatementpublic void accept(TParseTreeVisitor v)
TParseTreeNodeaccept in interface Visitableaccept in class TParseTreeNodev - visitor is a descendant class of TParseTreeVisitorpublic void acceptChildren(TParseTreeVisitor v)
TParseTreeNodeacceptChildren in interface VisitableacceptChildren in class TParseTreeNodev - visitor is a descendant class of TParseTreeVisitorpublic void setErrorLoggingClause(TErrorLoggingClause errorLoggingClause)
public void setHiveInsertType(EHiveInsertType hiveInsertType)
public void setDirectoryName(TObjectName directoryName)
public void setInsertConditions(TPTNodeList<TInsertCondition> insertConditions)
public void setInsertIntoValues(TPTNodeList<TInsertIntoValue> insertIntoValues)
public void setFunctionCall(TFunctionCall functionCall)
public void setExecuteStmt(TMssqlExecute executeStmt)
public void setRecordName(TObjectName recordName)
public void setInsertSource(EInsertSource insertSource)
public void setValueType(int valueType)
public void setSetColumnValues(TResultColumnList setColumnValues)
public void setOnDuplicateKeyUpdate(TResultColumnList onDuplicateKeyUpdate)