使用分层查询和 ANSI 连接创建物化视图

问题描述

我无法创建物化视图并收到 <textarea [innerHTML]="getInnerHTML(name)" cols="" rows=""></textarea> and in .ts file getInnerHTML(val){ return val.replace(/(<([^>]+)>)/ig,''); } 错误。这看起来像 Bug 17551261 ,但这应该已经修复了。我在 Oracle 12.2、19 和 21 上对其进行了测试。

在视图中,我使用了 connect by 语句和 ANSI 连接。 当我将 ANSI 连接重写为 Oracle 连接时,错误消失了。

为了重现错误,我创建了这些示例表:

ORA-904

使用 ANSI 连接:

create table example_type( id number(10) primary key,name varchar2(100 byte));

create table example( id number(10) primary key,name varchar2(100 byte),father_id number(10) references example(id),example_type_id  number(10) not null references example_type(id) );

错误

ORA-12018:在“sqlLIVE”的代码生成过程中遇到以下错误。“EXAMPLE_LIST_ANSI_JOIN”

ORA-00904: "from$_subquery$_013"."FATHER_ID_2": 无效标识符

12018.0000 -“在为“%s生成代码时遇到以下错误。“%s””

*原因:由于错误,无法重新生成指示的物化视图的刷新操作。

*操作:更正以下错误消息中指出的问题并重复操作。

使用 Oracle 加入:

create materialized view example_list_ansi_join( example_id,root_example_type,example_path)
  refresh on demand
as
  select e.id                                  example_id,connect_by_root(et.name)              root_example_type,sys_connect_by_path( e.name,' > ')   example_path
    from example e
   inner join example_type et on et.id = e.example_type_id 
 connect by prior e.id = e.father_id
   start with father_id is null;

没有错误

已创建实体化视图EXAMPLE_LIST_ORACLE_JOIN。

这仍然是一个错误吗?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)