Код: Выделить всё
create view
var status,linia_filter,grup_filter,format_filter: word;
x:integer;
linia,gruppa,etalon,format,titlenrec:comp;
(Vsego,meash)
as select (Fdec+Sdec+Tdec),kated.abbr,katpodr.name,pptitle.npp,*
from PPKATSTANMC,PPKATSTAN,PPSTATUS,PPLINE,PPTITLE(PPTITLE02),PPSPECIF,//PPSPECIF(PPSPECIF13),
kated,katpodr,groupmc,PPGRFORMAT,ppstatus ps,katmc,ppkatstanmc,katpodr kpodr,x$users,katotped,
ppline pl,groupmc gr(groupmc03),ppgrformat fr
where(( pptitle.atl_nrec==ppspecif.cpptitle
and pptitle.cpodr==katpodr.nrec
and ppspecif.ckated==kated.nrec
and pptitle.cppstatus==ppstatus.atl_nrec
and ppspecif.cppline==ppline.atl_nrec //and (linia=ppspecif.cppline)
and ppspecif.cppkatstan==ppkatstan.atl_nrec
and ppkatstan.cgroupmc==groupmc.nrec
and ppspecif.CPPGRFORMAT==PPGRFORMAT.atl_nrec
and ppkatstan.atl_nrec==ppkatstanmc.cppkatstan
and ppkatstanmc.cmc==katmc.nrec
and ppspecif.cpodr==kpodr.nrec
and pptitle.atl_owner==x$users.atl_nrec
and katmc.nrec==katotped.cmcusl
and 1==katotped.prmc
and 1==katotped.akt))//;
order by ppspecif.npp
bounds b1 = linia ==ppspecif.cppline
and titlenrec==ppspecif.cpptitle
ordered by ppspecif.npp //;//,ppspecif.cpptitle
bounds b2 = gruppa==ppkatstan.cgroupmc
and ppspecif.cppkatstan/==ppkatstan.atl_nrec
and titlenrec==ppspecif.cpptitle
ordered by ppspecif.npp
bounds b3 = format==ppspecif.cppgrformat
and titlenrec==ppspecif.cpptitle
ordered by ppspecif.npp
bounds b4 = gruppa==ppkatstan.cgroupmc
and ppspecif.cppkatstan==ppkatstan.atl_nrec
and linia==ppspecif.cppline//(noIndex)
and titlenrec==ppspecif.cpptitle
ordered by ppspecif.npp
bounds b5 = gruppa==ppkatstan.cgroupmc
and ppspecif.cppkatstan/==ppkatstan.atl_nrec
and format==ppspecif.cppgrformat(noIndex)
and titlenrec==ppspecif.cpptitle
ordered by ppspecif.npp
bounds b6 = linia ==ppspecif.cppline
and format==ppspecif.cppgrformat(noIndex)
and titlenrec==ppspecif.cpptitle
ordered by ppspecif.npp
bounds b7 = gruppa==ppkatstan.cgroupmc
and linia ==ppspecif.cppline(noIndex)
and format==ppspecif.cppgrformat(noIndex)
and ppspecif.cppkatstan/==ppkatstan.atl_nrec
and titlenrec==ppspecif.cpptitle
ordered by ppspecif.npp