C:\Documents and Settings\db2admin>db2 select * from cl
8 record(s) selected.
C:\Documents and Settings\db2admin>db2 select * from tm
3 record(s) selected.
All columns defined as NOT NULL
SQL to update returns an Error
C:\Documents and Settings\db2admin>db2 update cl source set amt =
select amt from tm target where source.acc_num=target.acc_num)
DB21034E The command was processed as an SQL statement because
it was not avalid Command Line Processor command. During SQL
processing it returned:SQL0407N Assignment of a NULL value to
a NOT NULL column "TBSPACEID=4,TABLEID=530, COLNO=1" is
not allowed. SQLSTATE=23502
I undestand that the way I write statement is returning nulls.
UPDATE CL SOURCE SET
AMT = (
SELECT AMT FROM TM TARGET
Please help me write correct update statement : Need to update table CL from table TM simply to set AMT as in TM table where ACC_NUM matches.