I am trying to remove the last 10 characters from a CLOB field in a DB2 database. I can do so using:
UPDATE report
SET comment = LEFT(comment, (LENGTH(comment) - 10))
However, I want to limit the truncation to a subset of the rows based on whether or not the report is in the current reporting period. I tried this...
UPDATE report
SET comment =
( SELECT LEFT(comment, (LENGTH(comment) - 10))
FROM report
INNER JOIN report_period
ON report.report_period_id = report_period.report_period_id
WHERE report_period.name = '2013 Interim Report' )
...but I get
The result of a scalar fullselect, SELECT INTO statement, or
VALUES INTO statement is more than one row
What am I doing wrong?