Funny Parse Error on Insert

From: Orion <o2(at)trustcommerce(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: Funny Parse Error on Insert
Date: 2001-11-12 19:12:18
Message-ID: 9sp6lt$huk$1@news.tht.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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?

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Ilker Egilmez 2001-11-12 20:06:16 problem: index on number not honoured
Previous Message Haller Christoph 2001-11-12 16:05:34 Re: integer attribute 1672 != 1672