20 septembre 2011

Accès HRWeb aux travaux ZO associés aux demandes, Correction de ZO2O.NUDORI

Le dossier de travail sous HRv7, conserve dans la rubrique ZO2O.NUDORI le NUDOSS de la demande ZO associée. En cas de suppression et de recréation de la demande, le lien est perdu et l'interface Web ne peut plus afficher les anciens travaux associés à la demande (ce lien est codé dans la page AABV800D)

Pour lister les travaux déphasés :

Ordre SQL DB2:
select ZO00D.NUDOSS, ZO2O.NUDORI, ZO00T.NUDOSS, ZO00T.CDPHAS, ZO00T.CDELMT, ZO00T.TYTMPL, ZO00T.IDREQU, ZO00T.FLGJOB, ZO00T.TISOUM
from ZO00 ZO00T, ZO2O,ZO00 ZO00D
where ZO00T.NUDOSS=ZO2O.NUDOSS
and ZO00T.CDPHAS=ZO00D.CDPHAS and ZO00T.CDELMT=ZO00D.CDELMT and ZO00T.TYTMPL=ZO00D.TYTMPL and ZO00T.IDREQU=ZO00D.IDREQU
and ZO00D.FLGJOB='0' and ZO00D.TISOUM='0001-01-01-00.00.00.000000'
and ZO00D.NUDOSS<>ZO2O.NUDORI

Ordre SQL Oracle : remplacer "0001-01-01-00.00.00.000000" par "0001-01-01"

Pour corriger les déphasages :

Ordre SQL DB2:
update ZO2O
set ZO2O.NUDORI = (
select coalesce(
(select ZO00D.NUDOSS from ZO00 ZO00D, ZO00 ZO00T
where  ZO00T.NUDOSS=ZO2O.NUDOSS
and ZO00T.CDPHAS=ZO00D.CDPHAS and ZO00T.CDELMT=ZO00D.CDELMT and ZO00T.TYTMPL=ZO00D.TYTMPL and ZO00T.IDREQU=ZO00D.IDREQU
and ZO00D.FLGJOB='0' and ZO00D.TISOUM='0001-01-01-00.00.00.000000')
,0)
from SYSIBM.SYSDUMMY1)

Ordre SQL Oracle : remplacer "coalesce" par "nvl", "0001-01-01-00.00.00.000000" par "0001-01-01" et "SYSIBM.SYSDUMMY1" par "DUAL"

Aucun commentaire:

Enregistrer un commentaire