Insert into table if not exist otherwise return error
I am using oracle 10g to create a user register application.
what i want is to insert the user information (like Email ,username, password, etc.) into a table. i am able to insert the data into the table but what i want is to check before inserting that same email,and username doesnt exist. if it does it should return some error like the email or username already exist.
please help and suggest some solution.
it will be highly appreciated.
thanks and regard,
Simplest and best solution is to put a unique index on the combined fields.
thanks for the reply man.
i defined a unique key on my column and validated it.