I'm trying to populate file EXTRACT from file ITEMS, but only include active items that have a positive balance on hand in file INVENTORY. Files EXTRACT and ITEMS have identical fields since EXTRACT was created by copying ITEMS, but without copying data.
INSERT into EXTRACT
SELECT * from ITEMS a
inner join
INVENTORY b
ON a.item# = b.item#
WHERE a.IID = 'Active' AND
b. ONHAND > 0 ;
Running this SQL gives me error code SQL0117 Statement contains wrong number of values.
Looking at details for SQL0117, it looks as if I may need to list all fields shared by files ITEMS & EXTRACT, but that is 340 fields to specify and I'm lazy enough that I'd rather not do that unless I have to. Is that my problem or is there something else I am missing or doing incorrectly?
INSERT into EXTRACT
SELECT * from ITEMS a
inner join
INVENTORY b
ON a.item# = b.item#
WHERE a.IID = 'Active' AND
b. ONHAND > 0 ;
Running this SQL gives me error code SQL0117 Statement contains wrong number of values.
Looking at details for SQL0117, it looks as if I may need to list all fields shared by files ITEMS & EXTRACT, but that is 340 fields to specify and I'm lazy enough that I'd rather not do that unless I have to. Is that my problem or is there something else I am missing or doing incorrectly?
Comment