Home » SQL & PL/SQL » SQL & PL/SQL » Validate insert or update
Validate insert or update [message #6677] Thu, 01 May 2003 13:24 Go to next message
andy
Messages: 92
Registered: December 1999
Member
Hi All,
Gald I found this forum hope you can help.

I'm a newbie to SQL and need to do soemthing fast and simple on my latest project.

I have a form that user's will be able to type in or correct product_names in a product table.....

What I need to do is put in sql code to validate that an already existing product name doesn't exist. I want to display a message alert if it can't update the prodcut name information for the record that will state that one already exists.....Can I get soem help with this?

So in a nutshell I need to validate any inserts or updates to the product name to make sure that there is no existing product of the same name and I have to message the user that he will have to choose another name.....

Thank you and I really appreciate any quick help you can provide ...

Andy
Re: Validate insert or update [message #6734 is a reply to message #6677] Sat, 03 May 2003 02:10 Go to previous message
Naveen
Messages: 75
Registered: June 2001
Member
hi,

You can set unique constraint on product_name table and let database handle the validations. But remember that data is case sensitive. 'andy' is not same as 'ANDY'. If this is not what you are looking for let me know whether you are using pl/sql blocks to provide the insert and update capabilities.

regards---Naveen.
Previous Topic: Can't Import on 9.2?
Next Topic: How to rollback main procedure depending on nested SP failure
Goto Forum:
  


Current Time: Fri Apr 19 19:46:50 CDT 2024