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
rajuakula
Messages: 63
Registered: March 2005
Member
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

(1,aaa,10,initial)

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
JSI2001
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: Tue Dec 06 02:23:50 CST 2016

Total time taken to generate the page: 0.10992 seconds