MySQL Forums
Forum List  »  Newbie

Re: Dependent Insert
Posted by: Gavin Greenwalt
Date: July 29, 2008 11:42AM

Oh. You can do unique indeces of TWO columns. I asked someone if that was possible and they said "no"--I need to find new friends.

It is hard to explain because right now the database sits at about 40 tables and I'm using it as the back end for a 3D application so there are a lot of other dependencies that would take a few hours to explain. ;) Only about 10 people max are going to be hitting the database with reads at any one given time. I was more concerned with the app checking to see if it exists not finding it and someone sneaking in a copy accidentally. Which as unlikely as it should happen... still would be worrisome. But now that I know I can put a unique index on two columns I'm perfectly satisfied for them to just receive an error in the outlandish circumstance where that occurs.

Do SQL stored procedures have TRY()CATCH() commands? Maxscript have these incredibly helpful functions.

I can just go TRY(INSERT INTO etc... )CATCH(QUERY * FROM)
It'll do the "Try" code and if it gets an error or warning (such as duplicate key) it proceeds onto the Catch() it's like a catchall IF/ELSE.

Options: ReplyQuote


Subject
Written By
Posted
July 28, 2008 11:00PM
July 29, 2008 06:46AM
July 29, 2008 08:19AM
July 29, 2008 10:52AM
July 29, 2008 11:22AM
Re: Dependent Insert
July 29, 2008 11:42AM
July 29, 2008 02:07PM
July 29, 2008 05:02PM
July 30, 2008 06:57AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.