Funny Parse Error on Insert

Поиск
Список
Период
Сортировка
От Orion
Тема Funny Parse Error on Insert
Дата
Msg-id 9sp6lt$huk$1@news.tht.net
обсуждение исходный текст
Список pgsql-sql
I am getting a parse error on insert and I cant tell why.  Anyone better at 
SQL what to lend me a hand?

I'm just doing a simple 'INSERT INTO table (x,y) SELECT ...'

Here's my statement and the error.

fdb=> INSERT INTO mfps_action_codes_394 (code,description) SELECT 
'$','Dun Notice Printed' WHERE NOT EXISTS (SELECT 1 FROM 
mfps_action_codes_394 WERE code = '$');
ERROR:  parser: parse error at or near "code"

Note if I remove the WHERE clause from the SELECT it works...

fdb=> INSERT INTO mfps_action_codes_394 (code,description) SELECT '$','Dun 
Notice Printed';
INSERT 9751582 1

Why would this happen?


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

Предыдущее
От: Orion
Дата:
Сообщение: Re: Funny Parse Error on Insert
Следующее
От: Brian@McSweeney.iol.ie (Brian)
Дата:
Сообщение: INSERT question