I am trying to do an insert in the below table in DB2 and am getting an error while inserting the value 9 || SUBSTR (V_BRANCH_NO,2,2), in the BA_BATCH_NO, field. The field BA_BATCH_NO and BA_BRANCH_NO has been defined as an INTEGER type. The value of BA_BRANCH_NO is 456
All I need to do is ADD 9 which is an integer to the last 2 digits of branch number.
Hence the result would be 956
INSERT INTO SIEBEL.STG_PAYMNET_OUTBOUND (
BA_BANK_NO,
BA_BRANCH_NO,
BA_BATCH_NO
BA_BATCH_DATE)
VALUES
(V_BANK_NO
V_BRANCH_NO
9 || SUBSTR (V_BRANCH_NO,2,2),
V_DATE);
I would not like to declare the BA_BATCH_NO and BA_BRANCH_NO as char as I would SET their values to 0 later on so I will have to declare them as integer
I guess the way I am doing the substring of integer field is wrong
Any comments
Regards