Package gudusoft.gsqlparser.sqlcmds
Class TSqlCmdsMssql
Object
gudusoft.gsqlparser.sqlcmds.AbstractSqlCmds
gudusoft.gsqlparser.sqlcmds.TSqlCmdsMssql
- All Implemented Interfaces:
ISqlCmds
Microsoft SQL Server-specific SQL command resolver.
Handles T-SQL statement recognition.
- Since:
- 3.1.0.9
-
Field Summary
Fields inherited from class gudusoft.gsqlparser.sqlcmds.AbstractSqlCmds
gnewsqlstatementtype, initialized, initLock, sqlCmdList, vendor -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionFinds SQL command type for yacc parser integration.protected StringgetToken1Str(int token1) Get the string representation for vendor-specific token codes.protected voidInitialize vendor-specific commands.issql(TSourceToken token, EFindSqlStateType state, TCustomSqlStatement currentStatement) Identifies the SQL statement type from a token stream.voidthis method is used to set the vendor.Methods inherited from class gudusoft.gsqlparser.sqlcmds.AbstractSqlCmds
addCmd, addCmd, addCmd, addCmd, addCmd, addCmd, addCmd, ensureInitialized, findcte, finddbcmd, getSqlCmdList, getVendor
-
Constructor Details
-
TSqlCmdsMssql
public TSqlCmdsMssql()
-
-
Method Details
-
setVendor
this method is used to set the vendor. this method is used temporarily due to ODBC use the TSqlCmdsMssql- Parameters:
dbVendor-
-
getToken1Str
Description copied from class:AbstractSqlCmdsGet the string representation for vendor-specific token codes. Subclasses should override this method to provide mappings for vendor-specific reserved words (tokens > TBaseType.rrw_abort).- Overrides:
getToken1Strin classAbstractSqlCmds- Parameters:
token1- Token code- Returns:
- String representation of the token, or null if not applicable
-
initializeCommands
Description copied from class:AbstractSqlCmdsInitialize vendor-specific commands. Subclasses must implement this to populate sqlCmdList.- Specified by:
initializeCommandsin classAbstractSqlCmds
-
getStatementTypeForToken
Description copied from interface:ISqlCmdsFinds SQL command type for yacc parser integration. Used by vendor-specific yacc parsers to identify statement types.- Specified by:
getStatementTypeForTokenin interfaceISqlCmds- Overrides:
getStatementTypeForTokenin classAbstractSqlCmds- Parameters:
token- Token to analyze- Returns:
- SQL statement type, or sstunknown if not recognized
-
issql
public TCustomSqlStatement issql(TSourceToken token, EFindSqlStateType state, TCustomSqlStatement currentStatement) Description copied from interface:ISqlCmdsIdentifies the SQL statement type from a token stream. This method is called repeatedly during parsing to identify statement boundaries and types in complex SQL scripts.- Parameters:
token- Current token being analyzedstate- Current parsing state (start, in body, or in exception)currentStatement- Current statement being built (may be modified)- Returns:
- The identified or modified SQL statement
-