pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Samuel J. Sutjiono <ssutjiono@wc-group.com>
To: pgsql-sql@postgresql.org
To: pgsql-general@postgresql.org
Subject: System Messages
Date: Wed, 27 Feb 2002 10:39:28 -0500
Message-ID: <00f701c1bfa4$f19b67c0$110a010a@headquarters.wcgroup.com> (raw)

I have a function (stored procedures) that updates or inserts a customer record (see below).

IF found then 
   Update Customer 
   Set custname = icustname
   retmsg := ''record already exists - updated'';
ELSE    
   Insert into Customer (custname) VALUES (icustname);
   retmsg := ''successful'';
END IF;

Can anybody tell me how I can be sure that the record is updated or inserted into the database ? Is there any system message in PostgreSQL that I can query ?

Thanks for your help. 

view thread (2+ messages)  latest in thread

Message-ID: <00f701c1bfa4$f19b67c0$110a010a@headquarters.wcgroup.com>
Permalink:  ../00f701c1bfa4$f19b67c0$110a010a@headquarters.wcgroup.com/
Also on:    postgresql.org/message-id/00f701c1bfa4$f19b67c0$110a010a@headquarters.wcgroup.com

 · 

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: ssutjiono@wc-group.com, pgsql-general@postgresql.org
  Subject: Re: System Messages
  In-Reply-To: <00f701c1bfa4$f19b67c0$110a010a@headquarters.wcgroup.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