Home » SQL & PL/SQL » SQL & PL/SQL » to check the record before inserting
to check the record before inserting [message #193288] Fri, 15 September 2006 10:06 Go to next message
Messages: 63
Registered: March 2005
I have a table with following fields and data

id name amount status
1 aaa 10 initial

I am trying to insert another record in the above table with the same data as the first record


before this record is inserted in the database I need to compare the new record which should be inserted into the database with the records already exist in the table(need to check all the fields) if it exists then do not insert the record.I mean atleast one column value should change either the amount,status or id

thanks in advance
Re: to check the record before inserting [message #193289 is a reply to message #193288] Fri, 15 September 2006 10:07 Go to previous message
Messages: 1016
Registered: March 2005
Location: Scotland
Senior Member
create a unique constraint on the combination of those fields
Previous Topic: Query Doubt
Next Topic: creating a temp table...pls help
Goto Forum:

Current Time: Wed Jul 26 02:07:43 CDT 2017

Total time taken to generate the page: 0.07779 seconds