I have a hierarchical query in Oracle 10 SQL that worked. However, I deleted the materialized view on which it was based, and now I can’t get it to exit normally, even leaving that opinion at all.
The initial request looked like this:
select oh.name, oh.description
, sys_connect_by_path(groupname, ':') "Groups"
, (select count(*)
from ml.lastobsmv
where lastobsmv.hdid = oh.hdid) as obscount
from ml.obshead oh
join ml.hiergrps hg on oh.groupid = hg.groupid
connect by prior hg.groupid = hg.parentid
I assume it still works, but without lastobsmv submission, I cannot test it.
If I cut it to
select oh.name, oh.description
from ml.obshead oh
join ml.hiergrps hg on oh.groupid = hg.groupid
it still works returning 41K records. However, when I use the connect by clause, it gets out of control by returning millions of records (usually I need to cancel it before I get the exact amount).
select oh.name, oh.description
, sys_connect_by_path(groupname, ':') "Groups"
from ml.obshead oh
join ml.hiergrps hg on oh.groupid = hg.groupid
connect by prior hg.groupid = hg.parentid
Am I missing something really egregious here, or am I not understanding how this should work? Thank.
Vadim
, . ,
Obshead:
# CYCLE DAYS, number of days in menstrual cycle, 100
HierGrps:
100, 50, Gynecology
50, 10, Tx
10, 0, Basic
# CYCLE DAYS, number of days in menstrual cycle, :Basic:Tx:Gynecology
( , obs- , ).