Please help with DB2 UPDATE:
I am trying to update the VALS_DV_SSA_06 table (ben amount) with the Amt
from the temp_rf.
The ben field is decimal (9,2) and the amt field is a varchar.
(1)
[RED]
ERROR:
UPDATE VALS_DV_SSA_06 SET ben = ( SELECT double(cast (rtrim(amt) as char(5))) as ben from temp_rf ) where ssn in (select ssn from temp_rf ) and fund='RFP'
DB21034E The command was processed as an SQL statement because it was not a
valid Command Line Processor command. During SQL processing it returned:
SQL0811N The result of a scalar fullselect, SELECT INTO statement, or VALUES
INTO statement is more than one row. SQLSTATE=21000
SQL0811N The result of a scalar fullselect, SELECT INTO statement, or VALUES INTO statement is more than one row.
Explanation:
One of the following caused the error:
o Execution of an embedded SELECT INTO or VALUES INTO statement
resulted in a result table of more than one row.
o Execution of a scalar fullselect resulted in a result table
of more than one row.
Federated system users: this situation can be detected by
federated server or by the data source.
The statement cannot be processed.
User Response:
Ensure that the statement contains the proper condition
specifications. If it does, there may be a data problem that is
causing more than one row to be returned when only one is
expected.
Federated system users: isolate the problem to the data source
failing the request (refer to the problem determination guide to
determine which data source is failing to process the SQL
statement) and examine the selection criteria and data for that
object.
sqlcode : -811
sqlstate : 21000
[/RED]
(2)
this does not work at all
THANKS A LOT
C.
I am trying to update the VALS_DV_SSA_06 table (ben amount) with the Amt
from the temp_rf.
The ben field is decimal (9,2) and the amt field is a varchar.
(1)
Code:
UPDATE VALS_DV_SSA_06 SET ben =
( SELECT double(cast (rtrim(amt) as char(5))) from temp_rf)
where ssn in (select ssn from temp_rf )
ERROR:
UPDATE VALS_DV_SSA_06 SET ben = ( SELECT double(cast (rtrim(amt) as char(5))) as ben from temp_rf ) where ssn in (select ssn from temp_rf ) and fund='RFP'
DB21034E The command was processed as an SQL statement because it was not a
valid Command Line Processor command. During SQL processing it returned:
SQL0811N The result of a scalar fullselect, SELECT INTO statement, or VALUES
INTO statement is more than one row. SQLSTATE=21000
SQL0811N The result of a scalar fullselect, SELECT INTO statement, or VALUES INTO statement is more than one row.
Explanation:
One of the following caused the error:
o Execution of an embedded SELECT INTO or VALUES INTO statement
resulted in a result table of more than one row.
o Execution of a scalar fullselect resulted in a result table
of more than one row.
Federated system users: this situation can be detected by
federated server or by the data source.
The statement cannot be processed.
User Response:
Ensure that the statement contains the proper condition
specifications. If it does, there may be a data problem that is
causing more than one row to be returned when only one is
expected.
Federated system users: isolate the problem to the data source
failing the request (refer to the problem determination guide to
determine which data source is failing to process the SQL
statement) and examine the selection criteria and data for that
object.
sqlcode : -811
sqlstate : 21000
[/RED]
(2)
Code:
UPDATE VALS_DV_SSA_06 D INNER JOIN temp_rf T ON D.SSN=T.SSN SET ben = double(cast (rtrim(amt) as char(5)))
THANKS A LOT
C.