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 -> If EXISTS before insert clause

If EXISTS before insert clause

From: JPike <jpike_at_welcom.com>
Date: 4 Feb 2005 13:01:56 -0800
Message-ID: <1107550916.809239.274630@f14g2000cwb.googlegroups.com>


In my sql script file for SQL Server I have:

IF EXISTS(SELECT PRD_UID FROM WST_PRD WHERE PRD_UID = 502) BEGIN
        INSERT INTO WST_PFD (PFG_UID, OBJ_UID) VALUES('14014', 'GRP_VIEW_RSK')
.
.
.

END Basically I want to see if an entry exists, reflecting that a product in installed, and if so run a group of inserts, etc.

This works fine in SQL Server but Oracle is not liking it. I know IF EXISTS doesn't exist here so how should I best do this to run in a script file?

jim Received on Fri Feb 04 2005 - 15:01:56 CST

Original text of this message

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