public void WithNoColumns()
        {
            var tableName = ObjectName.Parse("APP.test_table");
            var query = (SqlQueryExpression)SqlExpression.Parse("SELECT 3, 'Antonello', 'Provenzano', NULL, NULL");

            var statement = new InsertSelectStatement(tableName, query);

            Query.ExecuteStatement(statement);

            var table = Query.GetTable(tableName);

            Assert.AreEqual(1, table.RowCount);
        }
Example #2
0
        public void WithNoColumns()
        {
            var tableName = ObjectName.Parse("APP.test_table");
            var query     = (SqlQueryExpression)SqlExpression.Parse("SELECT 3, 'Antonello', 'Provenzano', NULL, NULL");

            var statement = new InsertSelectStatement(tableName, query);

            Query.ExecuteStatement(statement);

            var table = Query.GetTable(tableName);

            Assert.AreEqual(1, table.RowCount);
        }
        public void WithColumns()
        {
            var tableName = ObjectName.Parse("APP.test_table");
            var query = (SqlQueryExpression) SqlExpression.Parse("SELECT 'Antonello', 'Provenzano', NULL, NULL");
            var columns = new[] {"first_name", "last_name", "birth_date", "active"};

            var statement = new InsertSelectStatement(tableName, columns, query);

            Query.ExecuteStatement(statement);

            var table = Query.GetTable(tableName);

            Assert.AreEqual(1, table.RowCount);
        }
Example #4
0
        public void WithColumns()
        {
            var tableName = ObjectName.Parse("APP.test_table");
            var query     = (SqlQueryExpression)SqlExpression.Parse("SELECT 'Antonello', 'Provenzano', NULL, NULL");
            var columns   = new[] { "first_name", "last_name", "birth_date", "active" };

            var statement = new InsertSelectStatement(tableName, columns, query);

            Query.ExecuteStatement(statement);

            var table = Query.GetTable(tableName);

            Assert.AreEqual(1, table.RowCount);
        }
Example #5
0
 protected override SqlStatement VisitInsertSelect(InsertSelectStatement statement)
 {
     return(base.VisitInsertSelect(statement));
 }
Example #6
0
 protected virtual SqlStatement VisitInsertSelect(InsertSelectStatement statement)
 {
     return new InsertSelectStatement(statement.TableName, statement.ColumnNames, statement.QueryExpression);
 }
 protected override SqlStatement VisitInsertSelect(InsertSelectStatement statement)
 {
     return base.VisitInsertSelect(statement);
 }
Example #8
0
 protected virtual SqlStatement VisitInsertSelect(InsertSelectStatement statement)
 {
     return(new InsertSelectStatement(statement.TableName, statement.ColumnNames, statement.QueryExpression));
 }