我有一张表,按“单位编号”分别给特定用户设置不同的数据访问权限(包括增删改查),是否还可以限制哪些字段可编辑?
是不是用视图可以啊?好像ORACLE可以更新视图大家给个方案?

解决方案 »

  1.   


    --既然你将表的增删改查权限都授予了用户,
    --那何不如将表的所有权限授予用户,这样用户就可以修改字段了
    Connected as scottSQL> create table t(
      2  x number(2),
      3  y date,
      4  z varchar2(10))
      5  /
    Table createdSQL> grant all on t to yeexun;
    Grant succeededSQL> commit;
    Commit complete
    --------------------
    Connected as yeexun
    SQL> desc scott.t;
    Name Type         Nullable Default Comments 
    ---- ------------ -------- ------- -------- 
    X    NUMBER(2)    Y                         
    Y    DATE         Y                         
    Z    VARCHAR2(10) Y                         SQL> insert into scott.t(x,y,z)
      2  values(10,to_date('2011-01-01','yyyy-mm-dd'),'addfdfd');
    1 row insertedSQL> insert into scott.t(x,y,z)
      2  values(9,to_date('2010-01-01','yyyy-mm-dd'),'川菜好吃');
    1 row insertedSQL> select * from scott.t;
      X Y           Z
    --- ----------- ----------
     10 2011-1-1    addfdfd
      9 2010-1-1    川菜好吃SQL> alter table scott.t rename column x to a;
    Table alteredSQL> desc scott.t;
    Name Type         Nullable Default Comments 
    ---- ------------ -------- ------- -------- 
    A    NUMBER(2)    Y                         
    Y    DATE         Y                         
    Z    VARCHAR2(10) Y --为了安全性,你最好把对表的列的修改权限谨慎的授予特定的用户!
    --上面的实例仅供参考