Hi,
I try to select data from one table and insert into another using one query. I've made it like this:
but nothing happens (no rows inserted). Debugger says the syntax is correct and I can insert into this table in the 'normal' way using
When I run SELECT statement alone, it returns number of records and the fields have correct data type.
Should I somehow commit the transaction or do it in the other way? When I try to use explicit COMMIT, I get an error "** Unknown Field or Variable name - COMMIT. (201)".
Thanks in advance for help.
Regards,
Maciej.
I try to select data from one table and insert into another using one query. I've made it like this:
Code:
INSERT INTO z_conversion01 (emp-no, month, year, comp-amt)
SELECT emp-no, month, year, SUM(comp-amt)
FROM p_sal_comps
WHERE year > 2006
AND comp-no IN (403, 409, 465, 467)
GROUP BY emp-no, month, year.
but nothing happens (no rows inserted). Debugger says the syntax is correct and I can insert into this table in the 'normal' way using
Code:
INSERT INTO z_conversion01 (emp-no, month, year, comp-amt)
VALUES(100,11,2001,5432).
When I run SELECT statement alone, it returns number of records and the fields have correct data type.
Should I somehow commit the transaction or do it in the other way? When I try to use explicit COMMIT, I get an error "** Unknown Field or Variable name - COMMIT. (201)".
Thanks in advance for help.
Regards,
Maciej.