I guess I did not explain the question very well...
I will try again..
At 1st the table is empty..
I want to insert a row coming in..obviously at this point as there are no records in the table.. I want to insert the 1st row.

When someone tries to insert the next record... i want to check if it is already there in that table or not.. if its there then do not insert it, if it isn't then insert it.. and so on.

In sql server you can do it by saying

If not exists( SELECT ProjectCode_Item_Code
FROM ProjectCode where ProjectCode_Item_Code = XYZ)
Insert into ProjectCode(ProjectCode_Item_Code)
VALUES(xyz)


can I do the same thing in Oracle ?

The statement I wrote will work and works only when I have atleast 1 record in the table... but not at start when there will be no records.


Insert into ProjectCode(ProjectCode_Item_Code)
SELECT xyz
FROM ProjectCode
WHERE NOT EXISTS(SELECT ProjectCode_Item_Code
FROM ProjectCode where ProjectCode_Item_Code = XYZ) ;



[Edited by SONALIAK on 09-24-2002 at 10:20 AM]