Skip to main content

Failure during CP-IS upload message creation - ORA-01427: single-row subquery returns more than one row

In this article, we explain the CP-IS upload error caused by a subquery returning multiple rows in the Mosaic database.

Y
Written by Yusef Abulaynain

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

Did this answer your question?