| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> c.d.o.misc -> view & database link
I have a view that does a union across a database link. It compiles fine,
but errors out on execution;
With the following;
SQL> select * from vm_clist
2 where
3 INVOICE_DATE >= to_date('07/01/1999','mm/dd/yyyy')
4 AND INVOICE_DATE < to_date('08/01/1999','mm/dd/yyyy')
5
AND INVOICE_DATE < to_date('08/01/1999','mm/dd/yyyy')
*
ERROR at line 4:
If I break the view apart and run it separately as two views where the union is it works fine.
Anybody have any suggestions?
Thanks,
create or replace view vm_clist
as
select distributor_branch_seq,
jde_distributor_seq,
to_date(to_char(1900000 + sdivd),'yyyyddd') invoice_date,
sdlitm product_number,
sdapum uom,
sdsoqs quantity,
sdlnty type,
sdlttr cancel
from
scor.m_distributor_branch,
proddta.f42119_at_jde.ores.ps.net,
proddta.f0101_at_jde.ores.ps.net
where abac04 = 'C' and
jde_distributor_seq = aban8 and
sdivd <> 0 and
union
select distributor_branch_seq,
jde_distributor_seq,
to_date(to_char(1900000 + sdivd),'yyyyddd') invoice_date,
sdlitm product_number,
sdapum uom,
sdsoqs quantity,
sdlnty type,
sdlttr cancel
from
scor.m_distributor_branch,
jde_distributor_seq = aban8 and sdivd <> 0 and
sdlttr not in ('980', '984') and
sdlnty = 'D' and
create or replace view vm_clist1
as
select distributor_branch_seq,
jde_distributor_seq,
to_date(to_char(1900000 + sdivd),'yyyyddd') invoice_date,
sdlitm product_number,
sdapum uom,
sdsoqs quantity,
sdlnty type,
sdlttr cancel
from
scor.m_distributor_branch,
jde_distributor_seq = aban8 and sdivd <> 0 and
sdlttr not in ('980', '984') and
sdlnty in ('C','S') and
create or replace view vm_clist2
as
select distributor_branch_seq,
jde_distributor_seq,
to_date(to_char(1900000 + sdivd),'yyyyddd') invoice_date,
sdlitm product_number,
sdapum uom,
sdsoqs quantity,
sdlnty type,
sdlttr cancel
from
scor.m_distributor_branch,
jde_distributor_seq = aban8 and sdivd <> 0 and
sdlttr not in ('980', '984') and
sdlnty = 'D' and
![]() |
![]() |