hi thanks for the reply I did look at the CASE statement however cannot seem to alter the returned row-count ... CASE WHEN (@@ROW-COUNT = 0) THEN [what do I write here?] @@ROW-COUNT = 1? END -- View this message in context: http://postgresql.1045698.n5.nabble.com/if-clause-to-an-exiting-statement-tp3295519p3295641.html Sent from the PostgreSQL - general mailing list archive at Nabble.com. -- Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general