コード例 #1
0
        public override IEnumerable <string> SplitScriptIntoCommands(string scriptContents)
        {
            var commandSplitter  = new OracleCommandSplitter();
            var scriptStatements = commandSplitter.SplitScriptIntoCommands(scriptContents);

            return(scriptStatements);
        }
コード例 #2
0
        public override IEnumerable <string> SplitScriptIntoCommands(string scriptContents)
        {
            var commandSplitter  = new OracleCommandSplitter();
            var scriptStatements = commandSplitter.SplitScriptIntoCommands(scriptContents);
            var commands         = new List <string>();

            foreach (var statement in scriptStatements)
            {
                var lowerStatement = statement.ToLower().Trim();
                if (lowerStatement.Contains("begin") || !lowerStatement.Contains(";"))
                {
                    commands.Add(statement);
                }
                else
                {
                    var subStatements = statement.Split(';').Select(x => x.Trim()).Where(x => !string.IsNullOrWhiteSpace(x));
                    commands.AddRange(subStatements);
                }
            }
            return(commands);
        }