public void CanParseMultilineScript()
        {
            var multiCommand = "create table FOO (myid INT NOT NULL)/";

            multiCommand += Environment.NewLine;
            multiCommand += "create table BAR (myid INT NOT NULL)";

            var connectionManager = new OracleConnectionManager("connectionstring", new OracleCommandSplitter('/'));
            var result            = connectionManager.SplitScriptIntoCommands(multiCommand);

            result.Count().ShouldBe(2);
        }
Ejemplo n.º 2
0
        public void CanParseMultilineProcedureScriptWithDivideByOperator()
        {
            var multiCommand = "create or replace procedure divide_two_numbers(p_first_number  in number, ";

            multiCommand += Environment.NewLine;
            multiCommand += "p_second_number in number, ";
            multiCommand += Environment.NewLine;
            multiCommand += "p_result out number) is ";
            multiCommand += Environment.NewLine;
            multiCommand += "begin";
            multiCommand += Environment.NewLine;
            multiCommand += "p_result := p_first_number / p_second_number;";
            multiCommand += Environment.NewLine;
            multiCommand += "end;";
            multiCommand += Environment.NewLine;
            multiCommand += "/";

            var connectionManager = new OracleConnectionManager("connectionstring");
            var result            = connectionManager.SplitScriptIntoCommands(multiCommand);

            result.Count().ShouldBe(1);
        }