MySQL Forums
Forum List  »  Stored Procedures

Re: Error handling and 'if exists'
Posted by: Rick James
Date: May 16, 2015 11:57PM

Are you allowing a user to pass "drop temporary table t_person;" to the stored procedure? That is the wrong level of abstraction. The stored procedure should have one function and it is given the name of the table to drop. Then it
1. Check that user is not trying to drop things that he should not touch,
2. Constructs the DROP statement.
3. Executes it.
4. Checks for errors. About the only error at this point would be "table does not exist".

Options: ReplyQuote


Subject
Views
Written By
Posted
2505
May 11, 2015 07:17AM
Re: Error handling and 'if exists'
823
May 16, 2015 11:57PM


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.