Ejemplo n.º 1
0
        public alldatatypetableInsert CreateInsertStoredProcedure(Record record)
        {
            var sp = new alldatatypetableInsert();

            ((IDatabaseContext)sp).TransactionKey = this.TransactionKey;
            if (record == null)
            {
                return(sp);
            }
            sp.PrimaryKeyColumn               = record.PrimaryKeyColumn;
            sp.TimestampColumn                = record.TimestampColumn;
            sp.CharColumn                     = record.CharColumn;
            sp.VarCharColumn                  = record.VarCharColumn;
            sp.BitColumn                      = record.BitColumn;
            sp.TinyIntColumn                  = record.TinyIntColumn;
            sp.SmallIntColumn                 = record.SmallIntColumn;
            sp.MediumIntColumn                = record.MediumIntColumn;
            sp.IntColumn                      = record.IntColumn;
            sp.BigIntColumn                   = record.BigIntColumn;
            sp.TinyIntUnsignedColumn          = record.TinyIntUnsignedColumn;
            sp.SmallIntUnsignedColumn         = record.SmallIntUnsignedColumn;
            sp.MediumIntUnsignedColumn        = record.MediumIntUnsignedColumn;
            sp.IntUnsignedColumn              = record.IntUnsignedColumn;
            sp.BigIntUnsignedColumn           = record.BigIntUnsignedColumn;
            sp.FloatColumn                    = record.FloatColumn;
            sp.DoubleColumn                   = record.DoubleColumn;
            sp.DecimalColumn                  = record.DecimalColumn;
            sp.NumericColumn                  = record.NumericColumn;
            sp.DateColumn                     = record.DateColumn;
            sp.DateTimeColumn                 = record.DateTimeColumn;
            sp.TimeColumn                     = record.TimeColumn;
            sp.YearColumn                     = record.YearColumn;
            sp.BinaryColumn                   = record.BinaryColumn;
            sp.VarBinaryColumn                = record.VarBinaryColumn;
            sp.TinyBlobColumn                 = record.TinyBlobColumn;
            sp.MediumBlobColumn               = record.MediumBlobColumn;
            sp.BlobColumn                     = record.BlobColumn;
            sp.LongBlobColumn                 = record.LongBlobColumn;
            sp.TinyTextColumn                 = record.TinyTextColumn;
            sp.MediumTextColumn               = record.MediumTextColumn;
            sp.TextColumn                     = record.TextColumn;
            sp.LongTextColumn                 = record.LongTextColumn;
            sp.GeometryColumn                 = record.GeometryColumn;
            sp.EnumColumn                     = record.EnumColumn;
            sp.SetColumn                      = record.SetColumn;
            sp.NotNullCharColumn              = record.NotNullCharColumn;
            sp.NotNullVarCharColumn           = record.NotNullVarCharColumn;
            sp.NotNullBitColumn               = record.NotNullBitColumn;
            sp.NotNullTinyIntColumn           = record.NotNullTinyIntColumn;
            sp.NotNullSmallIntColumn          = record.NotNullSmallIntColumn;
            sp.NotNullMediumIntColumn         = record.NotNullMediumIntColumn;
            sp.NotNullIntColumn               = record.NotNullIntColumn;
            sp.NotNullBigIntColumn            = record.NotNullBigIntColumn;
            sp.NotNullTinyIntUnsignedColumn   = record.NotNullTinyIntUnsignedColumn;
            sp.NotNullSmallIntUnsignedColumn  = record.NotNullSmallIntUnsignedColumn;
            sp.NotNullMediumIntUnsignedColumn = record.NotNullMediumIntUnsignedColumn;
            sp.NotNullIntUnsignedColumn       = record.NotNullIntUnsignedColumn;
            sp.NotNullBigIntUnsignedColumn    = record.NotNullBigIntUnsignedColumn;
            sp.NotNullFloatColumn             = record.NotNullFloatColumn;
            sp.NotNullDoubleColumn            = record.NotNullDoubleColumn;
            sp.NotNullDecimalColumn           = record.NotNullDecimalColumn;
            sp.NotNullNumericColumn           = record.NotNullNumericColumn;
            sp.NotNullDateColumn              = record.NotNullDateColumn;
            sp.NotNullDateTimeColumn          = record.NotNullDateTimeColumn;
            sp.NotNullTimeColumn              = record.NotNullTimeColumn;
            sp.NotNullYearColumn              = record.NotNullYearColumn;
            sp.NotNullBinaryColumn            = record.NotNullBinaryColumn;
            sp.NotNullVarBinaryColumn         = record.NotNullVarBinaryColumn;
            sp.NotNullTinyBlobColumn          = record.NotNullTinyBlobColumn;
            sp.NotNullTinyTextColumn          = record.NotNullTinyTextColumn;
            sp.NotNullBlobColumn              = record.NotNullBlobColumn;
            sp.NotNullTextColumn              = record.NotNullTextColumn;
            sp.NotNullMediumBlobColumn        = record.NotNullMediumBlobColumn;
            sp.NotNullMediumTextColumn        = record.NotNullMediumTextColumn;
            sp.NotNullLongBlobColumn          = record.NotNullLongBlobColumn;
            sp.NotNullLongTextColumn          = record.NotNullLongTextColumn;
            sp.NotNullGeometryColumn          = record.NotNullGeometryColumn;
            sp.NotNullEnumColumn              = record.NotNullEnumColumn;
            sp.NotNullSetColumn               = record.NotNullSetColumn;
            return(sp);
        }
Ejemplo n.º 2
0
        private static Int32 InsertRecord(Int32 primaryKeyColumnValue)
        {
            var sp = new alldatatypetableInsert();

            sp.PrimaryKeyColumn = primaryKeyColumnValue;
            sp.TimestampColumn  = new DateTime(2000, 1, 1);

            sp.CharColumn              = "Char";
            sp.VarCharColumn           = "VarChar";
            sp.BitColumn               = true;
            sp.TinyIntColumn           = -12;
            sp.SmallIntColumn          = -3456;
            sp.MediumIntColumn         = -12345;
            sp.IntColumn               = -123456;
            sp.BigIntColumn            = -1234567890;
            sp.TinyIntUnsignedColumn   = 12;
            sp.SmallIntUnsignedColumn  = 3456;
            sp.MediumIntUnsignedColumn = 12345;
            sp.IntUnsignedColumn       = 123456;
            sp.BigIntUnsignedColumn    = 1234567890;
            sp.FloatColumn             = 12.345f;
            sp.DoubleColumn            = 1234.56;
            sp.DecimalColumn           = 1234.56m;
            sp.NumericColumn           = 123.45m;
            sp.DateColumn              = new DateTime(2014, 4, 4);
            sp.DateTimeColumn          = new DateTime(2014, 4, 4);
            sp.TimeColumn              = new TimeSpan(2, 30, 40);
            sp.YearColumn              = 2020;
            sp.BinaryColumn            = CreateBytes(1);
            sp.VarBinaryColumn         = CreateBytes(10);
            sp.TinyBlobColumn          = CreateBytes(123);
            sp.MediumBlobColumn        = CreateBytes(123);
            sp.BlobColumn              = CreateBytes(1234);
            sp.LongBlobColumn          = CreateBytes(12345);
            sp.TinyTextColumn          = "TinyText";
            sp.MediumTextColumn        = "MediumText";
            sp.TextColumn              = "Text";
            sp.LongTextColumn          = "LongText";
            sp.GeometryColumn          = new MySqlGeometry(137, 42, 4320);
            sp.EnumColumn              = MyEnum.Value1;
            sp.SetColumn               = MySet.Value0;

            sp.NotNullCharColumn              = "Char";
            sp.NotNullVarCharColumn           = "VarChar";
            sp.NotNullBitColumn               = true;
            sp.NotNullTinyIntColumn           = -12;
            sp.NotNullSmallIntColumn          = -3456;
            sp.NotNullMediumIntColumn         = -12345;
            sp.NotNullIntColumn               = -123456;
            sp.NotNullBigIntColumn            = -1234567890;
            sp.NotNullTinyIntUnsignedColumn   = 12;
            sp.NotNullSmallIntUnsignedColumn  = 3456;
            sp.NotNullMediumIntUnsignedColumn = 12345;
            sp.NotNullIntUnsignedColumn       = 123456;
            sp.NotNullBigIntUnsignedColumn    = 1234567890;
            sp.NotNullFloatColumn             = 12.345f;
            sp.NotNullDoubleColumn            = 1234.56;
            sp.NotNullDecimalColumn           = 1234.56m;
            sp.NotNullNumericColumn           = 123.456m;
            sp.NotNullDateColumn              = new DateTime(2014, 4, 4);
            sp.NotNullDateTimeColumn          = new DateTime(2014, 4, 4);
            sp.NotNullTimeColumn              = new TimeSpan(2, 30, 40);
            sp.NotNullYearColumn              = 2020;
            sp.NotNullBinaryColumn            = CreateBytes(1);
            sp.NotNullVarBinaryColumn         = CreateBytes(10);
            sp.NotNullTinyBlobColumn          = CreateBytes(123);
            sp.NotNullMediumBlobColumn        = CreateBytes(123);
            sp.NotNullBlobColumn              = CreateBytes(1234);
            sp.NotNullLongBlobColumn          = CreateBytes(12345);
            sp.NotNullTinyTextColumn          = "TinyText";
            sp.NotNullMediumTextColumn        = "MediumText";
            sp.NotNullTextColumn              = "Text";
            sp.NotNullLongTextColumn          = "LongText";
            sp.NotNullGeometryColumn          = new MySqlGeometry(137, 42, 4320);
            sp.NotNullEnumColumn              = MyEnum.Value1;
            sp.NotNullSetColumn               = MySet.Value0;

            var x = sp.ExecuteNonQuery();

            return(x);
        }