Hi,
I was wondering if you can use a select statement as one of the values in an INSERT statement when writing SQL for DB2 on the OS/390. Here is an example that give me a -104 SQL code saying ILLEGAL STATEMENT INTEGER:
INSERT INTO DDD1.PAYMENTS (EMPLOYERID , CITY , STATE , ZIP , TYPE , STATUS , ASSIGN_DATE , DUE_DATE ,
RECEIVER ) VALUES
(1,'COLU','AZ' , '29201', '9D', 'A' , CURRENT DATE , (CURRENT DATE + (SELECT INTEGER
(VALUE ) FROM DD1.DAT WHERE DAT_CD = 'AS09-D' ) DAYS ) , (SELECT USER_ID FROM DDD1.USER WHERE FUNC_AREA =
'ASN' AND ACCESS = 'FO' ) )
I was wondering if you can use a select statement as one of the values in an INSERT statement when writing SQL for DB2 on the OS/390. Here is an example that give me a -104 SQL code saying ILLEGAL STATEMENT INTEGER:
INSERT INTO DDD1.PAYMENTS (EMPLOYERID , CITY , STATE , ZIP , TYPE , STATUS , ASSIGN_DATE , DUE_DATE ,
RECEIVER ) VALUES
(1,'COLU','AZ' , '29201', '9D', 'A' , CURRENT DATE , (CURRENT DATE + (SELECT INTEGER
(VALUE ) FROM DD1.DAT WHERE DAT_CD = 'AS09-D' ) DAYS ) , (SELECT USER_ID FROM DDD1.USER WHERE FUNC_AREA =
'ASN' AND ACCESS = 'FO' ) )