public override IEnumerable <string> SplitScriptIntoCommands(string scriptContents) { var commandSplitter = new OracleCommandSplitter(); var scriptStatements = commandSplitter.SplitScriptIntoCommands(scriptContents); return(scriptStatements); }
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); }