From: Achilleus Mantzios <achill@matrix.gatewaynet.com>
To: Rado Petrik <r.p@szm.sk>
Cc: PostgreSQL-mailinglist <pgsql-sql@postgresql.org>
Subject: Re: What is bad in this query ?
Date: Fri, 2 May 2003 17:07:56 -0200 (GMT+2)
Message-ID: <Pine.LNX.4.44.0305021705440.19233-100000@matrix.gatewaynet.com> (raw)
In-Reply-To: <1051881697.29275.14.camel@caj>
On 2 May 2003, Rado Petrik wrote:
> Hi,
>
> What is bad in this query ?
>
> SELECT CASE
> WHEN EXIST(SELECT * FROM user WHERE name=rado)
> THEN (INSERT INTO user VALUES('rado'))
> END;
>
> PostgreSQL return
>
> ERROR: parser: parse error at or near "INTO"
>
> table user have only one column 'name' .
What do you want to do in the first place??
Have N+1 rows with name='rado' if N>0 ???
>
>
>
>
> Thanks
>
>
--
==================================================================
Achilleus Mantzios
S/W Engineer
IT dept
Dynacom Tankers Mngmt
Nikis 4, Glyfada
Athens 16610
Greece
tel: +30-210-8981112
fax: +30-210-8981877
email: achill@matrix.gatewaynet.com
mantzios@softlab.ece.ntua.gr
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: achill@matrix.gatewaynet.com, r.p@szm.sk
Subject: Re: What is bad in this query ?
In-Reply-To: <Pine.LNX.4.44.0305021705440.19233-100000@matrix.gatewaynet.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox