HRA: sql pour récupérer des éléments d'une page Web
Par AMO
Ce SQL n’est pas de moi, mais d’un bon consultant, qui a fait son chemin, Hakim Harroul. Le SQL extraie les informations, au sens HR Access, d’une page. Et plus…
--REQUETE 4 : PAGES - SOUS PAGES - INFORMATIONS - RUBRIQUE - CARTOUCHE
select * from (
(SELECT DISTINCT
--ARBRE
A1.CDENTI ARBRE_FONCT,A4.LILONG "Libellé de l'arbre"
--NOEUD
,A1.CDENRF NOEUD_NAVIG,A5.LILONG "Libellé du noeud"
--PAGES WEB et SOUS-PAGES
,AA.CDENTI PAGE_WEB,F.LILONG LIBELLE_PAGE,AA.CDENRF SOUS_PAGES,G.LILONG LIBELLE_SOUSPAGE
--INFORMATIONS
, A.CDENRF INFORMATION, B.LILONG "Libéllé de l'information"
--RUBRIQUES
, A.CDCPNT RUBRIQUES_PAGE, C.LILONG "Libellé de la rubrique"
--,W.
,W.LGRUBE "Longueur Rubrique", W.TYFORM "Type de la rubrique",W.NBDECI "Nombre décimale", E.TYPRES "TYPE DE PRESENCE"
, E.VACONT "Valeur rubrique", E.CDSCCO "Controle réglementaire"
FROM
RC50 AA,RC56 A, DI41 B, DI61 C, DI80 E, WF21 F, RC50 A1, RC50 A2, RC50 A3 , WT11 A4 , WT21 A5, WF21 A6,WF21 G , DI60 W
WHERE
B.CDSTDO||B.CDINFO=A.CDENRF AND SUBSTR(A.CDCPNT,1,6)=C.CDRUBR AND C.CDSTDO||C.CDINFO=A.CDENRF
AND C.CDSTDO=E.CDSTDO(+) AND C.CDINFO=E.CDINFO(+) AND C.CDRUBR=E.CDRUBR(+)
AND AA.CDENRF=A.CDENTI
AND AA.CDENTI=F.GPECRA||F.CDECRA
AND A.CDENTI=G.GPECRA||G.CDECRA
--dosiier individuel
AND AA.CDENTI='JAW00703'
--Affectation
--AND AA.CDENTI='JAW00024'
AND A.TYENRF='IN'AND A.CDENRF LIKE 'ZY%'
AND B.CDLANG ='F' AND C.CDLANG='F' AND F.CDLANG='F' AND G.CDLANG='F'
AND A1.TYENRF = A2.TYENTI AND A2.TYENTI=A3.TYENRF
AND A1.CDENRF = A2.CDENTI AND A2.CDENTI=A3.CDENRF
AND A1.CDENTI = A4.CDTREE AND A4.CDLANG='F'
AND A2.CDENTI = A5.CDTREE||A5.CDNODE AND A5.CDLANG='F'
AND A2.CDENRF = A6.GPECRA||A6.CDECRA AND A6.CDLANG='F'
AND A1.TYENTI='AN' AND A2.TYENTI='NN' AND A2.TYENRF='WF'
--AND A1.CDENTI='AU2'
--AND SUBSTR(A1.CDENRF,4,5)='1100J'
--AND SUBSTR(A1.CDENRF,4,5)='2400J'
AND AA.CDENTI=A2.CDENRF
AND C.CDSTDO=W.CDSTDO AND C.CDINFO=W.CDINFO AND C.CDRUBR=W.CDRUBR)
UNION
(
SELECT DISTINCT
A1.CDENTI ARBRE_FONCT, A4.LILONG, A1.CDENRF NOEUD_NAVIG,A5.LILONG
,A.CDENTI PAGE_WEB,F.LILONG LIBELLE_PAGE, ' ' aa,' ' bb ,A.CDENRF INFORMATION, B.LILONG LIBELLE_INFO, A.CDCPNT RUBRIQUES_PAGE, C.LILONG
,W.LGRUBE "Longueur Rubrique", W.TYFORM "Type de la rubrique",W.NBDECI "Nombre décimale", E.TYPRES "TYPE DE PRESENCE"
, E.VACONT "Valeur rubrique", E.CDSCCO "Controle réglementaire"
FROM RC56 A, DI41 B, DI61 C, DI80 E, WF21 F, RC50 A1, RC50 A2, RC50 A3 , WT11 A4 , WT21 A5, WF21 A6 , DI60 W
WHERE
B.CDSTDO||B.CDINFO=A.CDENRF AND SUBSTR(A.CDCPNT,1,6)=C.CDRUBR AND C.CDSTDO||C.CDINFO=A.CDENRF
AND C.CDSTDO=E.CDSTDO(+) AND C.CDINFO=E.CDINFO(+) AND C.CDRUBR=E.CDRUBR(+)
AND A.CDENTI=F.GPECRA||F.CDECRA
--dosiier individuel
AND A.CDENTI='JAW00703'
--Affectation
--AND A.CDENTI='JAW00024'
AND A.TYENRF='IN'AND A.CDENRF LIKE 'ZY%'
AND B.CDLANG ='F' AND C.CDLANG='F' AND F.CDLANG='F'
AND A1.TYENRF = A2.TYENTI AND A2.TYENTI=A3.TYENRF
AND A1.CDENRF = A2.CDENTI AND A2.CDENTI=A3.CDENRF
AND A1.CDENTI = A4.CDTREE AND A4.CDLANG='F'
AND A2.CDENTI = A5.CDTREE||A5.CDNODE AND A5.CDLANG='F'
AND A2.CDENRF = A6.GPECRA||A6.CDECRA AND A6.CDLANG='F'
AND A1.TYENTI='AN' AND A2.TYENTI='NN' AND A2.TYENRF='WF'
--AND A1.CDENTI='AU2'
AND A.CDENTI=A2.CDENRF
AND C.CDSTDO=W.CDSTDO AND C.CDINFO=W.CDINFO AND C.CDRUBR=W.CDRUBR)
)
order by ARBRE_FONCT,NOEUD_NAVIG,PAGE_WEB,SOUS_PAGES,INFORMATION
`