I continue to get the same error message over and over for a SQL script that I have. This script runs just fine in TOAD. I have tried a altering the SQL and I have also tried a similar script with the same results.
the Error is:
Exception Messages:
WithOut_BI_in_TBRACCD - ‘BI’ is an unexpected token. Expecting white space. Line 27, position 25.
SQL 1:
select spriden_id from spriden
where spriden_change_ind is null
and spriden_pidm in
(
(select distinct tbraccd_pidm from tbraccd
where tbraccd_term_code = ‘ARTERM’)
minus
(select distinct tbraccd_pidm from tbraccd
where substr(tbraccd_term_code,1,1) in (‘1’,‘2’,‘4’,‘8’,‘9’)
)
minus
(select spraddr_pidm from spraddr
where spraddr_atyp_code = ‘BI’
and spraddr_to_date is null
and spraddr_status_ind is null)
)
and spriden_pidm in
(select tbraccd_pidm from tbraccd
group by tbraccd_pidm
having sum(tbraccd_balance) > 0)
order by spriden_id
SQL 2:
select spriden_id from spriden
where spriden_change_ind is null
and spriden_pidm in
((select distinct tbraccd_pidm from tbraccd
where tbraccd_term_code = ‘ARTERM’
minus
select distinct tbraccd_pidm from tbraccd
where substr(tbraccd_term_code,1,1) in (‘1’,‘2’,‘4’,‘8’,‘9’))
intersect
select tbraccd_pidm
from tbraccd
where tbraccd_atyp_code <> ‘BI’)
and spriden_pidm in
(select tbraccd_pidm from tbraccd
group by tbraccd_pidm
having sum(tbraccd_balance) > 0)
order by spriden_id