sql - Invalid Identifier with Joins -


i don't tend ask questions regarding errors 1 happening me on every report doing. there fundamentally wrong approach , need solution , explanation if possible. need convert multiple reports , on getting error in 1 way or another.

here code.

i getting invalid identifier on:

inner join unit_instance_occurrences uio on uio.offering_organisation = ou.organisation_code 

what don't understand ou identifier has been defined.

here full code:

select pu.calocc_code,   ou.fes_full_name,   pu.uio_id,   uio.fes_uins_instance_code ||' '||uio.long_description crse_desc,   ebs_tutorgroupslist_sel(pu.id,pu.uio_id) grp,   pu.person_code,   p.forename,   p.surname,   upper(p.surname) ||', '||p.forename||' ('||pu.person_code||')' student,   pu.progress_code,   pu.progress_status,   pu.progress_date,   marks.absent,   marks.late,   marks.not_expected,   marks.present,   marks.notified_absence,   marks.blanks,   sum( marks.absent+ marks.late+ marks.not_expected+ marks.present+ marks.notified_absence+ marks.blanks ) poss_marks people p,   organisation_units ou,   (select red.session_code,     red.object_id uio_id,     reds.person_code,     sum(reds.absent) absent,     sum(reds.late) late,     sum(reds.not_expected) not_expected,     sum(reds.present) present,     sum(reds.notified_absence) notified_absence,     sum(reds.blanks) blanks       (select reds.object_id person_code,       reds.register_event_id,       reds.session_code,      -- count(decode(reds.usage_code, 'o', 1)) absent,       --count(decode(reds.usage_code, 'l', 1)) late,       --count(decode(reds.usage_code, 'v', 1)) not_expected,      -- count(decode(reds.usage_code, '/', 1)) present,     --  count(decode(reds.usage_code, 'x', 1)) notified_absence,     --  count(decode(reds.usage_code, null, 1)) blanks     register_event_details_slots reds     reds.session_code    = :p_occurrence --added params master     , reds.object_type       = 'l'     , reds.planned_end_date <= sysdate) reds   inner join register_event_details red   on red.register_event_id = reds.register_event_id   , red.session_code     = reds.session_code       --red.register_event_id = reds.register_event_id     --and red.session_code = reds.session_code     red.object_type = 'u'   ) marks inner join unit_instance_occurrences uio             on uio.offering_organisation = ou.organisation_code inner join people_units pu             on pu.calocc_code  = marks.session_code --(+)             , pu.person_code = marks.person_code  --(+)             , pu.uio_id      = marks.uio_id       --(+)             , pu.uio_id      = uio.uio_id             , pu.person_code = p.person_code   --pu.calocc_code = marks.session_code --(+)   --and pu.person_code = marks.person_code --(+)   --and pu.uio_id = marks.uio_id --(+)   --pu.uio_id = uio.uio_id   --and uio.offering_organisation = ou.organisation_code   --and pu.person_code = p.person_code   pu.unit_type                = 'r' , pu.calocc_code            = :p_occurrence -- added params master , uio.owning_organisation   = :p_faculty , uio.offering_organisation = :p_division , uio.uio_id               not null , uio.fes_active            = 'y' 

if re-organise joins, following, not mix implicit (using ,) , explicit joins (using inner join, etc).

select   blah   organisation_units ou inner join   unit_instance_occurrences uio     on  uio.offering_organisation = ou.organisation_code inner join   people_units pu     on  pu.uio_id       = uio.uio_id inner join   people p     on  p.person_code  = pu.person_code inner join (   yoursubquery )   marks     on  pu.calocc_code  = marks.session_code --(+)     , pu.person_code  = marks.person_code  --(+)     , pu.uio_id       = marks.uio_id       --(+)   --pu.calocc_code = marks.session_code --(+)   --and pu.person_code = marks.person_code --(+)   --and pu.uio_id = marks.uio_id --(+)   --pu.uio_id = uio.uio_id   --and uio.offering_organisation = ou.organisation_code   --and pu.person_code = p.person_code       pu.unit_type              = 'r'   , pu.calocc_code            = :p_occurrence -- added params master   , uio.owning_organisation   = :p_faculty   , uio.offering_organisation = :p_division   , uio.uio_id               not null   , uio.fes_active            = 'y' 

my bigger concern, however, have commented out many (+). these obsolete syntax allowing outer joins. means query above still need re-worked, , possibly re-ordered accommodate appropriate left join, etc.


Comments

Popular posts from this blog

java - Intellij Synchronizing output directories .. -

git - Initial Commit: "fatal: could not create leading directories of ..." -