Exemple #1
0
        private static int InsertIntoTable(IMutableTable table, ICursor cursor)
        {
            int  addedd   = 0;
            bool verified = false;

            foreach (var row in cursor)
            {
                if (!verified)
                {
                    if (AreCompatible(table.TableInfo, cursor.Source.TableInfo))
                    {
                        throw new StatementException("The source cursor is not compatible to the destination table.");
                    }

                    verified = true;
                }

                var newRow = table.NewRow();
                for (int i = 0; i < row.ColumnCount; i++)
                {
                    newRow.SetValue(i, row.GetValue(i));
                }

                table.AddRow(newRow);
                addedd++;
            }

            return(addedd);
        }
        private void InsertIntoTable(IMutableTable table)
        {
            var row = table.NewRow();
            row.SetValue(0,  "Antonello Provenzano");
            row.SetValue(1, 33);
            row.SetValue(2, 0);
            table.AddRow(row);

            row = table.NewRow();
            row.SetValue(0, "Maart Roosmaa");
            row.SetValue(1, 28);
            row.SetValue(2, 5);
            table.AddRow(row);

            row = table.NewRow();
            row.SetValue(0, "Rezaul Horaque");
            row.SetValue(1, 27);
            row.SetValue(2, 2);
            table.AddRow(row);
        }
        private void InsertIntoTable(IMutableTable table)
        {
            var row = table.NewRow();

            row.SetValue(0, "Antonello Provenzano");
            row.SetValue(1, 33);
            row.SetValue(2, 0);
            table.AddRow(row);

            row = table.NewRow();
            row.SetValue(0, "Maart Roosmaa");
            row.SetValue(1, 28);
            row.SetValue(2, 5);
            table.AddRow(row);

            row = table.NewRow();
            row.SetValue(0, "Rezaul Horaque");
            row.SetValue(1, 27);
            row.SetValue(2, 2);
            table.AddRow(row);
        }
Exemple #4
0
        private static void UpdateGrants(IQuery queryContext, IMutableTable grantTable, DbObjectType objectType, ObjectName objectName,
                                         string granter, string grantee, Privileges privileges, bool withOption)
        {
            RevokeAllGrants(queryContext, grantTable, objectType, objectName, granter, grantee, withOption);

            if (privileges != Privileges.None)
            {
                // Add the grant to the grants table.
                var row = grantTable.NewRow();
                row.SetValue(0, (int)privileges);
                row.SetValue(1, (int)objectType);
                row.SetValue(2, objectName.FullName);
                row.SetValue(3, grantee);
                row.SetValue(4, withOption);
                row.SetValue(5, granter);
                grantTable.AddRow(row);
            }
        }
            private void SelectIntoTable(IMutableTable table, ITable result)
            {
                if (!AreCompatible(table.TableInfo, result.TableInfo))
                {
                    throw new InvalidOperationException();
                }


                for (int i = 0; i < result.RowCount; i++)
                {
                    var newRow = table.NewRow();

                    for (int j = 0; j < result.ColumnCount(); j++)
                    {
                        var value = result.GetValue(i, j);
                        newRow.SetValue(j, value);
                    }

                    table.AddRow(newRow);
                }
            }
            private void SelectIntoTable(IMutableTable table, ITable result)
            {
                if (!AreCompatible(table.TableInfo, result.TableInfo))
                    throw new InvalidOperationException();

                for (int i = 0; i < result.RowCount; i++) {
                    var newRow = table.NewRow();

                    for (int j = 0; j < result.ColumnCount(); j++) {
                        var value = result.GetValue(i, j);
                        newRow.SetValue(j, value);
                    }

                    table.AddRow(newRow);
                }
            }
        private static int InsertIntoTable(IMutableTable table, ICursor cursor)
        {
            int addedd = 0;
            bool verified = false;
            foreach (var row in cursor) {
                if (!verified) {
                    if (AreCompatible(table.TableInfo, cursor.Source.TableInfo))
                        throw new StatementException("The source cursor is not compatible to the destination table.");

                    verified = true;
                }

                var newRow = table.NewRow();
                for (int i = 0; i < row.ColumnCount; i++) {
                    newRow.SetValue(i, row.GetValue(i));
                }

                table.AddRow(newRow);
                addedd++;
            }

            return addedd;
        }
Exemple #8
0
        private static void UpdateGrants(IQuery queryContext, IMutableTable grantTable, DbObjectType objectType,
			ObjectName objectName,
			string granter, string grantee, Privileges privileges, bool withOption)
        {
            RevokeAllGrants(queryContext, grantTable, objectType, objectName, granter, grantee, withOption);

            if (privileges != Privileges.None) {
                // Add the grant to the grants table.
                var row = grantTable.NewRow();
                row.SetValue(0, (int) privileges);
                row.SetValue(1, (int) objectType);
                row.SetValue(2, objectName.FullName);
                row.SetValue(3, grantee);
                row.SetValue(4, withOption);
                row.SetValue(5, granter);
                grantTable.AddRow(row);
            }
        }