I have the following generic query which I am trying to use to insert
into a 3 field table
INSERT INTO tb_files (subj, area, file_no) select '4', '8',(SELECT CASE
WHEN (4||8) NOT IN (SELECT (subj||area) FROM tb_files) THEN '1' ELSE
max(file_no)+1 END FROM tb_files GROUP BY (subj||area),subj,area HAVING
subj = '4' AND area = '8');
However the first entry will not go in with a
'null value in column "file_no" violates not-null constraint'
message
Anyone any ideas on this - the CASE statement does not seem to be being
evaluated