I am at a loss on how to handle this error. The subselect query below fails with this error:
SQL State: 21000
Vendor Code: -811
Message: [SQL0811] Result of SELECT more than one row. Cause . . . . . : The result table of a SELECT INTO statement, a subquery, or a subselect of a SET statement contains more than one row. The error type is 2. If the error type is 1 then a SELECT INTO statement attempted to return more than one row. If the error type is 2 then a subselect of a basic predicate has produced more than one row. Only one row is allowed. Recovery . . . : Change the selection so that only one result row is returned and then try the request again. The DECLARE CURSOR, OPEN, and FETCH statements must be used to process more than one result row. For a subquery the IN, EXISTS, ANY or ALL predicates can be used to process more than one result row. If one row was expected, there may be data errors, such as duplicate rows, that are causing more than one row to be returned.
I am pretty sure it is just my lack of experience that is causing my frustration. Can someone help me with this problem, please?
Here is the code
update qtemp.items a
set itemallocationid = (select iak from vd_gpl.ax_siop
Where (select imprfg from qtemp.items) = trim(productfamily));
I have attached a document showing a sample of the ax_siop file and the qtemp.items file, specifically where the fields are that I am joining on