pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Shavonne Marietta Wijesinghe <shavonne.marietta@studioform.it>
To: pgsql-sql@postgresql.org
Subject: Insert only if not found
Date: Thu, 5 Apr 2007 10:38:21 +0200
Message-ID: <005b01c7775d$c4fa4b70$1102a8c0@dream> (raw)

Hello everyone..

Here is the result of my Insert. and also the insert works ok.

INSERT INTO MOD48_02 (ID, TE_INDI, TE_COGNOME, TE_NOME, TE_SESSO, TE_ATTNASC, TE_LUONASC, TE_DTNASC, TE_PROVSTATO, TE_PROV, TE_PATERNITA, TE_RICHIESTA, USERNAME, DATE_INSERTED, TIME_INSERTED) VALUES ('127001200745101033', 'england', 'bloom', 'orlando', 'M', 'ww', 'florida', '05/06/1984', 'america', 'UK', 'xx', 'no', 'demo', '05/04/2007', '10.10.33');

But before i insert this record i want to check if the it hasn't been inserted before. I want to use the following fields as the riefferent. TE_COGNOME, TE_NOME, TE_SESSO, TE_DTNASC

And if there is no record to match those 4 fields i want to insert it else just a message saying that the record has been inserted b4.

any idea to start with?

Shavonne Wijesinghe

view thread (7+ messages)  latest in thread

Message-ID: <005b01c7775d$c4fa4b70$1102a8c0@dream>
Permalink:  ../005b01c7775d$c4fa4b70$1102a8c0@dream/
Also on:    postgresql.org/message-id/005b01c7775d$c4fa4b70$1102a8c0@dream

 · 

reply

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: shavonne.marietta@studioform.it
  Subject: Re: Insert only if not found
  In-Reply-To: <005b01c7775d$c4fa4b70$1102a8c0@dream>

* 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