首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >以物化视图直接格式添加注释

以物化视图直接格式添加注释
EN

Stack Overflow用户
提问于 2021-04-06 02:37:42
回答 2查看 209关注 0票数 2

我想知道是否可以将注释直接放在物化视图定义的列中。

(例如:注释‘(1)xxxxxxx’

(例:(2)对test33.o_rowid列的评论是“是我的观点专栏评论”)

我看到,在表格的情况下,如果可以直接发表评论的话。

代码语言:javascript
运行
复制
    create MATERIALIZED view prueba34
as
select 
   o.rowid o_rowid comment '(1)xxxxxxx', -- Error  ,
   c.rowid c_rowid,
   e.rowid e_rowid,
   f.rowid f_rowid,
      nvl(o.estado ||'-'||c.vdescricion,'') as ddesc,
  o.segmento ||'-'|| e.vdescricion as Clase,
   f.vdescricion as v2descripcion
from detalle_ordenes o, tabla_hija c, tabla_hija e,tabla_hija f
where
   ( o.estado=c.vvalor(+) and c.tipo_filtro=1 )
   and
   ( o.segmento=e.vvalor(+) and e.tipo_filtro=2) 
   and 
   ( o.column1=f.vvalor(+) and f.tipo_filtro=3)
   
   (2)comment on column prueba33.o_rowid is 'is my view column comment';
EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2021-04-06 03:20:35

不幸的是,我不知道你所说的“我在表格中看到了,如果可以直接发表评论”是什么意思?

据我所知,评论总是一个单独的命令,即:

代码语言:javascript
运行
复制
comment on table XXX is '....';
comment on column XXX.YYY is '....';
票数 1
EN

Stack Overflow用户

发布于 2021-04-06 06:24:29

可以将注释添加到物化视图的查询定义中:

代码语言:javascript
运行
复制
CREATE TABLE detalle_ordenes (
  col1 NUMBER
);

CREATE MATERIALIZED VIEW prueba34
AS 
SELECT o.rowid AS o_rowid -- example comment in the mview
  FROM detalle_ordenes o;

它们将存储在数据库中,并在USER_MVIEWS的列查询中可见。

此外,还可以使用COMMENT ON ...以通常的方式向容器表中添加注释,正如您和Connor所描述的那样。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/66962043

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档