Hola Marcela, fiajte de reemplazar esa parte:
AND vw_hist_academica.materia IN (
SELECT mp.materia
FROM sga_alumnos,
sga_planes,
vw_materias_plan as mp
WHERE sga_alumnos.unidad_academica = :ua
AND sga_alumnos.carrera = :carrera
AND sga_alumnos.legajo = :legajo
AND sga_planes.unidad_academica = sga_alumnos.unidad_academica
AND sga_planes.carrera = sga_alumnos.carrera
AND sga_planes.plan = sga_alumnos.plan
AND mp.unidad_academica = sga_alumnos.unidad_academica
AND mp.carrera = sga_alumnos.carrera
AND mp.plan = sga_alumnos.plan
AND mp.version = sga_planes.version_actual
AND mp.titulo = :titulo
)
Por:
AND (vw_hist_academica.materia IN (
SELECT mp.materia
FROM sga_alumnos,
sga_planes,
vw_materias_plan as mp
WHERE sga_alumnos.unidad_academica = :ua
AND sga_alumnos.carrera = :carrera
AND sga_alumnos.legajo = :legajo
AND sga_planes.unidad_academica = sga_alumnos.unidad_academica
AND sga_planes.carrera = sga_alumnos.carrera
AND sga_planes.plan = sga_alumnos.plan
AND mp.unidad_academica = sga_alumnos.unidad_academica
AND mp.carrera = sga_alumnos.carrera
AND mp.plan = sga_alumnos.plan
AND mp.version = sga_planes.version_actual
AND mp.titulo = :titulo
) OR
vw_hist_academica.materia IN (
SELECT mp.materia
FROM sga_titulos_otorg as t,
vw_materias_plan as mp
WHERE t.unidad_academica = :ua
AND t.carrera = :carrera
AND t.legajo = :legajo
AND t.titulo = :titulo
AND mp.unidad_academica = t.unidad_academica
AND mp.carrera = t.carrera
AND mp.plan = t.plan
AND mp.version = t.version
AND mp.titulo = t.titulo
))
Esta es la query completa de la datawindow:
SELECT vw_hist_academica.materia,
NVL(plan_actual.nombre_materia, NVL(sga_atrib_mat_plan.nombre_materia, sga_materias.nombre)) as materia_nombre,
vw_hist_academica.fecha,
vw_hist_academica.resultado,
CASE
WHEN vw_hist_academica.nota MATCHES '*[a-zA-Z!^]*' then ''
ELSE vw_hist_academica.nota
END as nota,
vw_hist_academica.forma_aprobacion,
vw_hist_academica.acta,
vw_hist_academica.acta_promocion,
vw_hist_academica.nro_resolucion,
vw_hist_academica.tipo_acta,
CASE
WHEN vw_hist_academica.forma_aprobacion IN ('Examen','Examen equivalente') THEN cast(vw_hist_academica.acta as varchar(50))
WHEN vw_hist_academica.forma_aprobacion IN ('Promoción', 'Promoción en otra carrera') THEN cast(vw_hist_academica.acta_promocion as varchar(50))
WHEN vw_hist_academica.forma_aprobacion IN ('Equivalencia','Equivalencia equivalente','Homologada') THEN cast(vw_hist_academica.nro_resolucion as varchar(50))
ELSE ''
END as acta_resolucion,
CASE
WHEN vw_hist_academica.forma_aprobacion IN ('Examen','Examen equivalente') THEN 'E'
WHEN vw_hist_academica.forma_aprobacion IN ('Promoción', 'Promoción en otra carrera') THEN 'P'
WHEN vw_hist_academica.forma_aprobacion IN ('Equivalencia','Equivalencia equivalente') THEN 'Q'
WHEN vw_hist_academica.forma_aprobacion = 'Homologada' THEN 'R'
ELSE 'R'
END as tipo_aprobacion,
CASE
WHEN vw_hist_academica.forma_aprobacion IN ('Examen','Examen equivalente') THEN
(SELECT sga_folios.folio_fisico
FROM sga_detalle_acta, OUTER sga_folios
WHERE sga_detalle_acta.unidad_academica = vw_hist_academica.unidad_academica
AND sga_detalle_acta.carrera = vw_hist_academica.carrera
AND sga_detalle_acta.legajo = vw_hist_academica.legajo
AND sga_detalle_acta.tipo_acta = vw_hist_academica.tipo_acta
AND sga_detalle_acta.acta = vw_hist_academica.acta
AND sga_folios.unidad_academica = sga_detalle_acta.unidad_academica
AND sga_folios.tipo_acta = sga_detalle_acta.tipo_acta
AND sga_folios.acta = sga_detalle_acta.acta
AND sga_folios.folio = sga_detalle_acta.folio
)
WHEN vw_hist_academica.forma_aprobacion IN ('Promoción','Promoción en otra carrera') THEN
(SELECT sga_folios_promo.folio_fisico
FROM sga_det_acta_promo, OUTER sga_folios_promo
WHERE sga_det_acta_promo.unidad_academica = vw_hist_academica.unidad_academica
AND sga_det_acta_promo.carrera = vw_hist_academica.carrera
AND sga_det_acta_promo.legajo = vw_hist_academica.legajo
AND sga_det_acta_promo.acta = vw_hist_academica.acta_promocion
AND sga_folios_promo.unidad_academica = sga_det_acta_promo.unidad_academica
AND sga_folios_promo.acta = sga_det_acta_promo.acta
AND sga_folios_promo.folio = sga_det_acta_promo.folio)
ELSE cast(null as integer)
END as folio_fisico
FROM sga_alumnos,
sga_planes,
vw_hist_academica,
sga_materias,
OUTER sga_atrib_mat_plan,
OUTER sga_atrib_mat_plan as plan_actual
WHERE sga_alumnos.unidad_academica = :ua
AND sga_alumnos.carrera = :carrera
AND sga_alumnos.legajo = :legajo
AND sga_planes.unidad_academica = sga_alumnos.unidad_academica
AND sga_planes.carrera = sga_alumnos.carrera
AND sga_planes.plan = sga_alumnos.plan
AND vw_hist_academica.unidad_academica = :ua
AND vw_hist_academica.carrera = :carrera
AND vw_hist_academica.legajo = :legajo
AND vw_hist_academica.resultado IN ('A','R')
AND sga_materias.unidad_academica = vw_hist_academica.unidad_academica
AND sga_materias.materia = vw_hist_academica.materia
AND sga_atrib_mat_plan.unidad_academica = vw_hist_academica.unidad_academica
AND sga_atrib_mat_plan.carrera = vw_hist_academica.carrera
AND sga_atrib_mat_plan.plan = vw_hist_academica.plan
AND sga_atrib_mat_plan.version = vw_hist_academica.version
AND sga_atrib_mat_plan.materia = vw_hist_academica.materia
AND plan_actual.unidad_academica = sga_alumnos.unidad_academica
AND plan_actual.carrera = sga_alumnos.carrera
AND plan_actual.plan = sga_alumnos.plan
AND plan_actual.version = sga_planes.version_actual
AND plan_actual.materia = vw_hist_academica.materia
AND (vw_hist_academica.materia IN (
SELECT mp.materia
FROM sga_alumnos,
sga_planes,
vw_materias_plan as mp
WHERE sga_alumnos.unidad_academica = :ua
AND sga_alumnos.carrera = :carrera
AND sga_alumnos.legajo = :legajo
AND sga_planes.unidad_academica = sga_alumnos.unidad_academica
AND sga_planes.carrera = sga_alumnos.carrera
AND sga_planes.plan = sga_alumnos.plan
AND mp.unidad_academica = sga_alumnos.unidad_academica
AND mp.carrera = sga_alumnos.carrera
AND mp.plan = sga_alumnos.plan
AND mp.version = sga_planes.version_actual
AND mp.titulo = :titulo
) OR
vw_hist_academica.materia IN (
SELECT mp.materia
FROM sga_titulos_otorg as t,
vw_materias_plan as mp
WHERE t.unidad_academica = :ua
AND t.carrera = :carrera
AND t.legajo = :legajo
AND t.titulo = :titulo
AND mp.unidad_academica = t.unidad_academica
AND mp.carrera = t.carrera
AND mp.plan = t.plan
AND mp.version = t.version
AND mp.titulo = t.titulo
))
Probalo y avisa si con este cambio lista las actividades del titulo obtenido en 2019 en otra version u otro plan de estudios.
¿Porque estan consultando un titulo obtenido hace 2 años?