static string GetInsertSql(AnyDbConnection cnn, Insert query)
        {
            ISqlOmRenderer renderer = Qb.CreateRenderer(cnn.DatabaseProvider);
            string         sql      = renderer.RenderInsert(query);

            return(sql);
        }
示例#2
0
        public long ExecuteNonQuery(Insert query)
        {
            ISqlOmRenderer render = Qb.CreateRenderer(_anyConnection.DatabaseProvider);

            _dbCommand.CommandText = render.RenderInsert(query);
            _dbCommand.CommandType = CommandType.Text;
            FillParameters(_dbCommand, query.Query.CommandParams, render);
            if (!string.IsNullOrEmpty(query.Query.IdentityField))
            {
                return(Convert.ToInt64(ExecuteScalar()));
            }
            return(ExecuteNonQuery());
        }
示例#3
0
        public string GetSql(Insert query)
        {
            ISqlOmRenderer renderer = Qb.CreateRenderer(AnyDbSetting.DatabaseProvider);

            return(renderer.RenderInsert(query));
        }