on 11-06-2014 2:05 PM
This error occurs when inserting rows into a table which has dependant materialized view in SQLA12 db (see attached image for full details).
Any ideas on why this is happening?
This happens on 1 or 2 databases, the rest (90+) is working great.
This is databases which started out as ASA5.5 db's once upon a time.
Otherwise, everything works as it should.
This is likely related to Engineering Case#756681 which is fixed in 16.0.0 Build 1829 or later and 12.0.1 Build 4071 or later.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Bjarne,
This error should be fixed for the conditions that we had prevoiusly seen it on (as you had described, inserting rows into a table with a dependency to a materialized view) in CR #756681, but it's possible that there is a slightly different way you're seeing it. Would it be possible to provide us with a sample of the operations you're trying against the table and the table/materialized view definition when you see this error on 12.0.1.4142?
Thanks,
Jeff Albion
SAP Active Global Support
Hi Jeff!
This error occurs when we are running simple INSERT or UPDATE statement against one of the tables with dependency to the materialized view in PowerBuilder embedded SQL statement.
There are also triggers on at least one of the tables, so perhaps the combination can be the issue here?
This is the definition for the line-view:
ALTER VIEW "MTS"."WV730PrognoseSalgsLinjer" as
select
w733prognosesalg.klientnr,
w733prognosesalg.uttakstype,
w733prognosesalg.uttaksnr,
w733prognosesalg.vareanr,
cast(0 as decimal(10,3)) as pris,
0 as lagerkvantum,
0 as lagerantall,
sum(totkvant) as prognosekvantum,
sum(antall) as prognoseantall,
sm002vare.hkode,
sm002vare.beskrivelse,
w733prognosesalg.ValPris,
null as TollPr
from
w729salgshode
join w733prognosesalg on w733prognosesalg.klientnr=w729salgshode.klientnr and w733prognosesalg.uttakstype=w729salgshode.uttakstype and w733prognosesalg.uttaksnr=w729salgshode.uttaksnr
join sm002vare on sm002vare.klientnr=w733prognosesalg.klientnr and sm002vare.vareanr=w733prognosesalg.vareanr
where
w729salgshode.status = 0 and
w729salgshode.uttakstype = 'SA' and
w729salgshode.salgstype = 6
group by
w733prognosesalg.klientnr,
w733prognosesalg.uttakstype,
sm002vare.beskrivelse,
sm002vare.hkode,
w733prognosesalg.vareanr,
pris,
w733prognosesalg.uttaksnr,
w733prognosesalg.ValPris
union
select
wmv730salgslinje.klientnr,
wmv730salgslinje.uttakstype,
wmv730salgslinje.uttaksnr,
wmv730salgslinje.vareanr,
wmv730salgslinje.pris,
sum(totkvant) as lagerkvantum,
sum(antall) as lagerantall,
0 as prognosekvantum,
0 as prognoseantall,
sm002vare.hkode,
sm002vare.beskrivelse,
wmv730salgslinje.valpris as ValPris,
wmv730salgslinje.tollpr as TollPr
from
w729salgshode
join wmv730salgslinje on wmv730salgslinje.klientnr=w729salgshode.klientnr and wmv730salgslinje.uttakstype=w729salgshode.uttakstype and wmv730salgslinje.uttaksnr=w729salgshode.uttaksnr
join sm002vare on sm002vare.klientnr=wmv730salgslinje.klientnr and sm002vare.vareanr=wmv730salgslinje.vareanr
where
w729salgshode.status = 0 and
w729salgshode.uttakstype = 'SA' and
w729salgshode.salgstype = 6
group by
wmv730salgslinje.klientnr,
wmv730salgslinje.uttakstype,
sm002vare.beskrivelse,
sm002vare.hkode,
wmv730salgslinje.vareanr,
wmv730salgslinje.pris,
wmv730salgslinje.uttaksnr,
wmv730salgslinje.valpris,
wmv730salgslinje.tollpr
union
select
w770uttaksbestilling.klientnr,
w770uttaksbestilling.uttakstype,
w770uttaksbestilling.uttaksnr,
w770uttaksbestilling.vareanr,
cast(0 as decimal(10,3)) as pris,
0 as lagerkvantum,
0 as lagerantall,
sum(kvantum) as prognosekvantum,
sum(antall) as prognoseantall,
sm002vare.hkode,
sm002vare.beskrivelse,
null as ValPris,
null as TollPr
from
W729Salgshode
join w770uttaksbestilling on w770uttaksbestilling.klientnr=w729salgshode.klientnr and w770uttaksbestilling.uttakstype=w729salgshode.uttakstype and w770uttaksbestilling.uttaksnr=w729salgshode.uttaksnr
join sm002vare on sm002vare.klientnr=w770uttaksbestilling.klientnr and sm002vare.vareanr=w770uttaksbestilling.vareanr
where
w729salgshode.status = 0 and
w729salgshode.uttakstype = 'SA' and
w729salgshode.salgstype = 6 and
not exists(select 1 from W733PrognoseSalg as x where x.KlientNr=w770uttaksbestilling.KlientNr and x.UttaksType=w770uttaksbestilling.UttaksType and x.UttaksNr=w770uttaksbestilling.UttaksNr)
group by
w770uttaksbestilling.klientnr,
w770uttaksbestilling.uttakstype,
sm002vare.beskrivelse,
sm002vare.hkode,
w770uttaksbestilling.vareanr,
pris,
w770uttaksbestilling.uttaksnr;
And this is the definition for the other view which is referred:
CREATE MATERIALIZED VIEW "MTS"."WMV730SalgsLinje"
AS
select
w730salgslinje.klientnr,
w730salgslinje.uttakstype,
w730salgslinje.uttaksnr,
w730salgslinje.w730lnr,
w730salgslinje.vareanr,
w730salgslinje.pris,
w730salgslinje.totkvant,
w730salgslinje.antall,
0 as prognosekvantum,
0 as prognoseantall,
sm002vare.hkode,
sm002vare.beskrivelse,
w730salgslinje.valpris as ValPris,
w730salgslinje.tollpr as TollPr
from
w729salgshode
join w730salgslinje on w730salgslinje.klientnr=w729salgshode.klientnr and w730salgslinje.uttakstype=w729salgshode.uttakstype and w730salgslinje.uttaksnr=w729salgshode.uttaksnr
join sm002vare on sm002vare.klientnr=w730salgslinje.klientnr and sm002vare.vareanr=w730salgslinje.vareanr
where
w729salgshode.status = 0 and
w729salgshode.uttakstype = 'SA' and
w729salgshode.salgstype = 6;
The weird thing is that all these views are in use for all of our installations, but fails only on 1 database. All other databases acts normal.
I think I can provide the database if that's needed.
Regards,
Bjarne Anker
Maritech Systems AS
Norway
Hi Bjarne,
This is quite a complicated definition that seems to involve many other corresponding tables. I think it might make more sense if you could upload a sample database file with the problem. If not, at least making the database schema available to us should help with the reproducible.
---
If you have a support plan with SAP, now would be an excellent time to open an incident and provide us the details for this problem over the support website so we can work with you directly to figure out what the best resolution will be. See: http://support.sap.com/
Otherwise, if you would like to just file a 'bug report' with us, I have created a shared space where you can upload files to on SAP Mobile Documents. Please e-mail ( firstname.lastname@sap.com ) or private message myself directly over SCN for the password to upload to the share area.
Thanks,
Jeff Albion
SAP Active Global Support
User | Count |
---|---|
86 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.