很可能是没存进去!下面是我的总结:
    SQL>comment on table 表 is '表注释';    SQL>comment on table 视图 is '视图注释';  //注意,为视图创建注释!    SQL>comment on column 表.列 is '列注释';    SQL> select * from user_tab_comments where comments is not null;    SQL> select * from user_col_comments where comments is not null;下面是实例:------------------------------------------------SQL> create table 表(列 number);表已创建。
SQL> comment on table 表 is '表注释';注释已创建。SQL> comment on column 表.列 is '列注释';注释已创建。SQL> select * from user_tab_comments where comments is not null;TABLE_NAME                     TABLE_TYPE
------------------------------ -----------
COMMENTS
--------------------------------------------------------------------------------
表                             TABLE
表注释SQL> create view 视图 as select * from 表;视图已建立。SQL> comment on table 视图 is '视图注释';注释已创建。SQL> select * from user_tab_comments where comments is not null;TABLE_NAME                     TABLE_TYPE                     //注意这边的table_type!!!!
------------------------------ -----------
COMMENTS
--------------------------------------------------------------------------------
表                             TABLE
表注释视图                           VIEW
视图注释

解决方案 »

  1.   

    grant select,resource to your_user;
      

  2.   

    BlueskyWide(谈趣者) :你好,grant select,resource to your_user;这样做了还是不行。用Oracle的system、sys连接都不行。    dajian2000(zhj+Oracle):你好,你是教我怎样建注释,其实我的问题是,注释已存在,只是用PB的Database可以看到而在Oracle里查不到。(数据库是从别的机器上用exp/imp倒过来的)
      

  3.   

    在SQL Plus中从user_tab_comments或user_col_comments中均看不到表或字段的Comments   再SQLPLUS 中查询条件里全是大写。
      

  4.   

    我知道是大写,我用select distinct comments from user_tab_comments 就一条记录且是空值,而在PB7.0的Database中是可以看到的!
      

  5.   

    在本人机中的某用户下,查询结果是这样的:
    select count(*) from user_col_comments where comments is not null;
      COUNT(*)
    ----------
             0
    select count(*) from user_col_comments where comments is null
      COUNT(*)
    ----------
          2087
    select count(*) from user_tab_comments where comments is null
      COUNT(*)
    ----------
           243
    select count(*) from user_tab_comments where comments is not null
      COUNT(*)
    ----------
             0这两个均为系统表,pb中你所连接的肯定是这两个表吗?
      

  6.   

    你一定是用pb为表做的注释,他的注释没有存在oracle系统表中,而是存在它自己的表里,(PBCATCOL,PBCATEDT,PBCATFMT,PBCATTBL,PBCATVLD)
      

  7.   

    对了,PB把这几个表(特别是pbcattbl和pbcatcol)放在Oracle里,从PB里查看用的是这几个表,也就是说当时表和字段的注释是在PB里做的。在Oracle或PD里做的注释是放在user_tab_comments、user_col_comments等几个表里。