Welcome Guest, Not a member yet? Register   Sign In
Handle Exceptions
#1

[eluser]alejandronanez[/eluser]
Hey everybody it's me again.

I'm working with Oracle XE, I developed a form for creating new data on one of my tables but that table has a UNIQUE KEY restriction, and when I insert an existing record CI says this.


Quote:A Database Error Occurred

Error Number:


INSERT INTO "table" ("field2", "field3") VALUES ('name', 'last name')

How can I handle this exception?

Any suggestion?

Thanks!
#2

[eluser]flaky[/eluser]
you can try transactions
or you could basically first make a select to check if the unique key exists then if it doesn't exist make the insert
#3

[eluser]alejandronanez[/eluser]
Thanks!!! I'll try and I will tell you aboyut it. Thanks again!!!




Theme © iAndrew 2016 - Forum software by © MyBB