Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> best way to conditionally insert a row

best way to conditionally insert a row

From: Mark Harrison <mh_at_pixar.com>
Date: Thu, 09 Aug 2007 00:05:17 GMT
Message-ID: <1Tsui.1271$3x.761@newssvr25.news.prodigy.net>


I would like to insert a row into a table, but only if the primary key does not exist.

For example, if I have a table "keywords" with columns "name" and "val", I would like

   insert into keywords (name, val) values ('color', 'blue');

to happen only if there is not already a row where name='color'.

What is the best way to do this?

Many TIA!
Mark Received on Wed Aug 08 2007 - 19:05:17 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US