NewRow() public method

public NewRow ( ) : int
return int
Beispiel #1
0
        static TemporaryTable()
        {
            var table = new TemporaryTable(new ObjectName("SINGLE_ROW_TABLE"), new ColumnInfo[0]);

            table.NewRow();
            SingleRow = table;
        }
Beispiel #2
0
        public static async Task SetRowValues()
        {
            var tableInfo = new TableInfo(new ObjectName("table1"));

            tableInfo.Columns.Add(new ColumnInfo("a", PrimitiveTypes.Integer()));
            tableInfo.Columns.Add(new ColumnInfo("b", PrimitiveTypes.VarChar(22)));

            var table = new TemporaryTable(tableInfo);

            var row = table.NewRow();

            table.SetValue(row, 0, SqlObject.Integer(45));
            table.SetValue(row, 1, SqlObject.String(new SqlString("992")));

            Assert.Equal(1, table.RowCount);

            var value1 = await table.GetValueAsync(0, 0);

            Assert.Equal(SqlObject.Integer(45), value1);
        }
Beispiel #3
0
        private void ReadAll()
        {
            if (Result.Type == StatementResultType.CursorRef) {
                var tableInfo = Result.Cursor.Source.TableInfo;
                localTable = new TemporaryTable("##LOCAL##", tableInfo);

                foreach (var row in Result.Cursor) {
                    var rowIndex = localTable.NewRow();
                    for (int i = 0; i < row.ColumnCount; i++) {
                        localTable.SetValue(rowIndex, i, row.GetValue(i));
                    }
                }
            }
        }