Re: What is bad in this query ? - Mailing list pgsql-sql

From Achilleus Mantzios
Subject Re: What is bad in this query ?
Date
Msg-id Pine.LNX.4.44.0305021705440.19233-100000@matrix.gatewaynet.com
Whole thread Raw
In response to What is bad in this query ?  (Rado Petrik <r.p@szm.sk>)
Responses Re: What is bad in this query ?
List pgsql-sql
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



pgsql-sql by date:

Previous
From: "Matt Mello"
Date:
Subject: Re: implied FROM
Next
From: Rod Taylor
Date:
Subject: Re: What is bad in this query ?