Here is the SQL Query that I'm trying to run in my program. However I can't even compile it, I'm getting an error that's just telling me something is wrong in the query.
The error I get is "SQL0117 Statement contains wrong number of values".
/Free
exec sql
INSERT INTO NOEDTSR
SELECT * FROM NOEDEH AS deh
WHERE EXISTS (SELECT act.AC2ACT FROM ACTEST AS act
WHERE act.AC2ACT = deh.N1ACTE
AND act.AC2CRB IN('C0','C2')
AND act.AC2TYT = 'DEN')
AND NOT EXISTS (SELECT sin.SISTE FROM SINREG AS sin
WHERE sin.SISTE = deh.N1STE
AND sin.SIGRP = deh.N1GRP
AND sin.SIIND = deh.N1IND
AND sin.SIRANG = deh.N1RANG
AND sin.SIACTE = deh.N1ACTE
AND sin.SIREEL = deh.N1MERG
AND sin.SISECU = deh.N1EBAS)
AND N1DBSS = 20
AND N1DBSA = 21
AND N1TIER = '000000000000000';
/end-free
I'm not specifying column_names here on purpose as I want to copy all of the columns from NOEDEH to NOEDTSR.
These two tables have the same structure as the DDS(Data Description Structure) used to compile both is the exactly same.
Any thoughts?