Error:
'The following unexpected error occurred attempting to Failure during CP-IS upload message creation:
org.springframework.jdbc.BadSqlGrammarException:
## Error querying database. Cause: java.sql.SQLException: ORA-01427: single-row subquery returns more than one row'
This could be due to one or more person records in the CPIS cohort having multiple NHS numbers recorded.
The following query can be used to identify any affected records:
select prf.person_id, count(prf.reference)
from person_references prf
where prf.reference_type_id = 'NHS'
group by prf.person_id
having count(prf.reference) > 1
