@@ -25,7 +25,8 @@ WITH RECURSIVE
2525                             af .beschreibung ,
2626                             af .kommunikation_von ,
2727                             ah .edifact_format_version ,
28-                              af .anwendungshandbuch_primary_key 
28+                              af .anwendungshandbuch_primary_key ,
29+                              null             as  is_on_uebertragungsdatei_level
2930                      FROM  segmentgroup sg
3031                               JOIN  anwendungsfall af ON  sg .anwendungsfall_primary_key  =  af .primary_key 
3132                               JOIN  anwendungshandbuch ah ON  af .anwendungshandbuch_primary_key  =  ah .primary_key 
@@ -34,8 +35,8 @@ WITH RECURSIVE
3435
3536                      SELECT  s .primary_key ,
3637                             s .position ,
37-                              ' segment' AS  type,
38-                              s .id       AS  root_id_text,
38+                              ' segment'                         AS  type,
39+                              s .id                               AS  root_id_text,
3940                             s .name ,
4041                             s .ahb_status ,
4142                             s .anwendungsfall_primary_key ,
@@ -48,7 +49,8 @@ WITH RECURSIVE
4849                             af .beschreibung ,
4950                             af .kommunikation_von ,
5051                             ah .edifact_format_version ,
51-                              af .anwendungshandbuch_primary_key 
52+                              af .anwendungshandbuch_primary_key ,
53+                              s .is_on_uebertragungsdatei_level  as  is_on_uebertragungsdatei_level
5254                      FROM  segment s
5355                               JOIN  anwendungsfall af ON  s .anwendungsfall_primary_key  =  af .primary_key 
5456                               JOIN  anwendungshandbuch ah ON  af .anwendungshandbuch_primary_key  =  ah .primary_key 
@@ -83,7 +85,7 @@ WITH RECURSIVE
8385                              o .kommunikation_von ,
8486                              o .edifact_format_version ,
8587                              o .anwendungshandbuch_primary_key ,
86- 
88+                                o . is_on_uebertragungsdatei_level , 
8789                              CASE WHEN o .type  =  ' segment_group' o .root_id_text  ELSE NULL  END AS  segmentgroup_id,
8890                              CASE WHEN o .type  =  ' segment_group' o .name  ELSE NULL  END         AS  segmentgroup_name,
8991                              CASE WHEN o .type  =  ' segment_group' o .ahb_status  ELSE NULL  END   AS  segmentgroup_ahb_status,
@@ -142,6 +144,7 @@ WITH RECURSIVE
142144                         h .kommunikation_von ,
143145                         h .edifact_format_version ,
144146                         h .anwendungshandbuch_primary_key ,
147+                          h .is_on_uebertragungsdatei_level ,
145148
146149                         ' SG' ||  child .id ,
147150                         child .name ,
@@ -199,7 +202,7 @@ WITH RECURSIVE
199202                         h .kommunikation_von ,
200203                         h .edifact_format_version ,
201204                         h .anwendungshandbuch_primary_key ,
202- 
205+                           s . is_on_uebertragungsdatei_level , 
203206                         h .segmentgroup_id ,
204207                         h .segmentgroup_name ,
205208                         h .segmentgroup_ahb_status ,
@@ -255,7 +258,7 @@ WITH RECURSIVE
255258                         h .kommunikation_von ,
256259                         h .edifact_format_version ,
257260                         h .anwendungshandbuch_primary_key ,
258- 
261+                           h . is_on_uebertragungsdatei_level , 
259262                         h .segmentgroup_id ,
260263                         h .segmentgroup_name ,
261264                         h .segmentgroup_ahb_status ,
@@ -311,7 +314,7 @@ WITH RECURSIVE
311314                         h .kommunikation_von ,
312315                         h .edifact_format_version ,
313316                         h .anwendungshandbuch_primary_key ,
314- 
317+                           h . is_on_uebertragungsdatei_level , 
315318                         h .segmentgroup_id ,
316319                         h .segmentgroup_name ,
317320                         h .segmentgroup_ahb_status ,
@@ -368,7 +371,7 @@ WITH RECURSIVE
368371                         h .kommunikation_von ,
369372                         h .edifact_format_version ,
370373                         h .anwendungshandbuch_primary_key ,
371- 
374+                           h . is_on_uebertragungsdatei_level , 
372375                         h .segmentgroup_id ,
373376                         h .segmentgroup_name ,
374377                         h .segmentgroup_ahb_status ,
@@ -424,7 +427,7 @@ WITH RECURSIVE
424427                         h .kommunikation_von ,
425428                         h .edifact_format_version ,
426429                         h .anwendungshandbuch_primary_key ,
427- 
430+                           h . is_on_uebertragungsdatei_level , 
428431                         h .segmentgroup_id ,
429432                         h .segmentgroup_name ,
430433                         h .segmentgroup_ahb_status ,
0 commit comments