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);
        }
Esempio n. 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);
        }
Esempio n. 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);
        }
Esempio n. 5
0
 protected override SqlStatement VisitInsertSelect(InsertSelectStatement statement)
 {
     return(base.VisitInsertSelect(statement));
 }
Esempio n. 6
0
 protected virtual SqlStatement VisitInsertSelect(InsertSelectStatement statement)
 {
     return new InsertSelectStatement(statement.TableName, statement.ColumnNames, statement.QueryExpression);
 }
Esempio n. 7
0
 protected override SqlStatement VisitInsertSelect(InsertSelectStatement statement)
 {
     return base.VisitInsertSelect(statement);
 }
Esempio n. 8
0
 protected virtual SqlStatement VisitInsertSelect(InsertSelectStatement statement)
 {
     return(new InsertSelectStatement(statement.TableName, statement.ColumnNames, statement.QueryExpression));
 }