Inserting or Deleting conditionally - Mailing list pgsql-sql

From KÖPFERL Robert
Subject Inserting or Deleting conditionally
Date
Msg-id ED4E30DD9C43D5118DFB00508BBBA76EB16561@neptun.sonorys.at
Whole thread Raw
Responses Re: Inserting or Deleting conditionally
List pgsql-sql
Hi,

coming from imperative programming paradigma, I'm currently trying to
express something like that in _SQL_:

It should be atomic and like an API for a user. I'm therefore writing
functions:

CRETE FUNC...

c := SELECT x,y,z FROM table_a WHERE...
IF COUNT(c)=1 thenINSERT / DELETE ... WHERE x = c.x
ENDIF

LANGUAGE SQL;


How is this correctly formulated? Or is there no other way than PL/xxx?



Thanks


pgsql-sql by date:

Previous
From: KÖPFERL Robert
Date:
Subject: Re: Record type in sql
Next
From: Richard Huxton
Date:
Subject: Re: Inserting or Deleting conditionally