Advertisement
Guest User

Untitled

a guest
Nov 19th, 2019
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.34 KB | None | 0 0
  1. -----------------------------------------------------------------------
  2. -- DDL-Statement generation Mon Feb 01 14:37:49 CET 2016
  3. -----------------------------------------------------------------------
  4. -- drop the old view:
  5. -----------------------------------------------------------------------
  6. drop view filter.ERGEBNISERFASSUNG;
  7.  
  8. -----------------------------------------------------------------------
  9. -- create the new view:
  10. -----------------------------------------------------------------------
  11. create view FILTER.ERGEBNISERFASSUNG as
  12. select
  13. pez.oid as OID,
  14. pr.probe as PROBE,
  15. pr.nahmedatum as PROBENAHMEDATUM,
  16. pr.registrierdatum as PROBENREGISTRIERDATUM,
  17. pr.typ AS PROBENTYP,
  18. pr.art as PROBENART,
  19. pr.status as PROBENSTATUS,
  20. pr.prioritaet as PROBENPRIORITAET,
  21. pr.reserve4 as WETTER_NAHMETAG,
  22. pr.reserve5 as PROBEN_ID,
  23. pr.reserve6 as PROBENBEZEICHNUNG,
  24. case when przu.bzusatz1 = 1 then 'ja' else 'nein' end as PARALLELPROBE_AN_KUNDE,
  25. case when przu.bzusatz2 = 1 then 'ja' else 'nein' end as STOERFALL,
  26. case when przu.bzusatz3 = 1 then 'ja' else 'nein' end as SONDERPROBENAHME,
  27. case when przu.bzusatz4 = 1 then 'ja' else 'nein' end as AN_FREMDLABOR_VERSENDET,
  28. case when przu.bzusatz5 = 1 then 'nein' else 'ja' end as PROBENAHME_MOEGLICH,
  29. an.analyse as ANALYSE,
  30. an.name as ANALYSENAME,
  31. an.sw_fremduntersuchung as FREMDLABORANALYSE,
  32. er.ergebnis as ERGEBNIS,
  33. er.name as ERGEBNISNAME,
  34. er.art as ERGEBNISART,
  35. er.typ as ERGEBNISTYP,
  36. pez.status as ERGEBNISSTATUS,
  37. ew.wiederholung as MESSWIEDERHOLUNG,
  38. ppl.pruefplan as PRUEFPLAN,
  39. ppl.name as PRUEFPLAN_NAME,
  40. pd.produkt as MEDIUM,
  41. pd.name as MEDIUMNAME,
  42. kd.kunde as AUFTRAGGEBER,
  43. kd.name as AUFTRAGGEBERNAME,
  44. org.organisation as PROBENSTELLE,
  45. org.name as PROBENSTELLENNAME,
  46. hs.hauptstelle as HAUPTSTELLE,
  47. hs.name as HAUPTSTELLENNAME,
  48. us.unterstelle as UNTERSTELLE,
  49. us.name as UNTERSTELLENNAME,
  50. us.reserve3 as SCHACHTNUMMER,
  51. angr.gruppe as ANALYSENGRUPPE,
  52. angr.name as ANALYSENGRUPPENNAME
  53. from dialims.proben_erg_zuo pez
  54. left outer
  55. join dialims.proben pr on pr.oid = pez.probe_oid
  56. left outer
  57. join dialims.analysen an on an.oid = pez.analyse_oid
  58. left outer
  59. join dialims.ergebnisse er on er.oid = pez.ergebnis_oid
  60. left outer
  61. join dialims.ergebniswerte ew on ew.proben_erg_zuo_oid = pez.oid
  62. left outer
  63. join dialims.pp_p_zuo ppp on ppp.probe_oid = pr.oid
  64. left outer
  65. join dialims.pruefplaene ppl on ppl.oid = ppp.pruefplan_oid
  66. left outer
  67. join dialims.produkte pd on pd.oid = pr.produkt_oid
  68. left outer
  69. join dialims.kunden kd on kd.oid = pr.kunde_oid
  70. left outer
  71. join dialims.organisationen org on org.oid = pr.organisation_oid
  72. left outer
  73. join dialims.hauptstellen hs on hs.oid = pr.hauptstelle_oid
  74. left outer
  75. join dialims.unterstellen us on us.oid = pr.unterstelle_oid
  76. left outer
  77. join dialims.aag_zuo aag on aag.analyse_oid = an.oid
  78. left outer
  79. join dialims.analysegruppen angr on angr.oid = aag.gruppe_oid
  80. left outer
  81. join dialims.zusaetze przu on przu.ref_oid = pr.oid
  82. ;
  83.  
  84. -----------------------------------------------------------------------
  85. -- grants for the view:
  86. -----------------------------------------------------------------------
  87. grant select on filter.ERGEBNISERFASSUNG to dialims
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement