SET r. OPRND_VAL = (SELECT Rpad(SUBSTR(upd.NEW_GPI_CD,1,instr( r. OPRND_VAL,'*',1)-1),14,'*')FROM GPI_ERR_CRCTN upd
WHERE rtrim(r. OPRND_VAL,'*') = SUBSTR(upd. GPI_CD,1,instr(r. OPRND_VAL,'*',1)-1) AND upd. CMPLT_REPLC_CD = 'Y')
WHERE rtrim(r. OPRND_VAL,'*') =
(SELECT SUBSTR(upd. GPI_CD,1,instr(r. OPRND_VAL,'*',1)-1)
FROM GPI_ERR_CRCTN upd WHERE upd. CMPLT_REPLC_CD = 'Y' )
When I try to execute It is giving the following error
ORA-01427: single-row subquery returns more than one row
Cause: The outer query must use one of the keywords ANY, ALL, IN, or NOT IN to specify values to compare because the subquery returned more than one row.
The error message is fairly transparent. Your subquery is returning more than 1 row.
Either the SET clause or the WHERE clause subquery is returning multiple rows. (or possibly both) If it is the where clause, you could either use a multi - row operator instead of a single row operator, alternatively you could make sure that the subquery returns only 1 row. If it is the SET clause subquery that returns multiple rows, you will have to edit the query to return only 1 row.