problem with inserting a generated seq no into not null field

Поиск
Список
Период
Сортировка
От mike
Тема problem with inserting a generated seq no into not null field
Дата
Msg-id 1086694668.31284.18.camel@datacc
обсуждение исходный текст
Ответы Re: problem with inserting a generated seq no into not null field  (Manfred Koizar <mkoi-pg@aon.at>)
Re: problem with inserting a generated seq no into not  (Stephan Szabo <sszabo@megazone.bigpanda.com>)
Список pgsql-general
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



В списке pgsql-general по дате отправления:

Предыдущее
От: jseymour@linxnet.com (Jim Seymour)
Дата:
Сообщение: Re: encrypted passwords
Следующее
От:
Дата:
Сообщение: Re: encrypted passwords