private void CreateBindVariable(string bindVariableName) { var bindVariable = new BindVariableConfiguration { Name = bindVariableName }; var literalTerminal = _literalTerminals[0]; switch (literalTerminal.Id) { case Terminals.NumberLiteral: bindVariable.Value = literalTerminal.Token.Value; break; case Terminals.StringLiteral: bindVariable.Value = literalTerminal.Token.Value.ToPlainString(); break; } switch (_requiredPrecedingTerminalId) { case Terminals.Date: bindVariable.DataType = TerminalValues.Date; break; case Terminals.Timestamp: bindVariable.DataType = TerminalValues.Timestamp; break; case null: if (String.Equals(literalTerminal.Id, Terminals.NumberLiteral)) { bindVariable.DataType = TerminalValues.Number; } else { bindVariable.DataType = literalTerminal.Token.Value[0].In('n', 'N') ? TerminalValues.NVarchar2 : TerminalValues.Varchar2; } break; } var configuration = WorkDocumentCollection.GetProviderConfiguration(SemanticModel.DatabaseModel.ConnectionString.ProviderName); configuration.SetBindVariable(bindVariable); }
private BindVariableLiteralConversionCommand(ActionExecutionContext executionContext, BindVariableConfiguration bindVariable, bool allOccurences) : base(executionContext) { _bindVariable = bindVariable; _allOccurences = allOccurences; }
private void CreateBindVariable(string bindVariableName) { var bindVariable = new BindVariableConfiguration { Name = bindVariableName }; var literalTerminal = _literalTerminals[0]; switch (literalTerminal.Id) { case Terminals.NumberLiteral: bindVariable.Value = literalTerminal.Token.Value; break; case Terminals.StringLiteral: bindVariable.Value = literalTerminal.Token.Value.ToPlainString(); break; } switch (_requiredPrecedingTerminalId) { case Terminals.Date: bindVariable.DataType = TerminalValues.Date; break; case Terminals.Timestamp: bindVariable.DataType = TerminalValues.Timestamp; break; case null: if (String.Equals(literalTerminal.Id, Terminals.NumberLiteral)) { bindVariable.DataType = TerminalValues.Number; } else { bindVariable.DataType = literalTerminal.Token.Value[0].In('n', 'N') ? TerminalValues.NVarchar2 : TerminalValues.Varchar2; } break; } var configuration = WorkDocumentCollection.GetProviderConfiguration(SemanticModel.DatabaseModel.ConnectionString.ProviderName); configuration.SetBindVariable(bindVariable); }
private BindVariableLiteralConversionCommand(ActionExecutionContext executionContext, BindVariableConfiguration bindVariable, bool allOccurences) : base(executionContext) { _bindVariable = bindVariable; _allOccurences = allOccurences; }