MySQL Forums
Forum List  »  Newbie

First DB design and stored procedure - beginner questions
Posted by: Bruno Vermeersch
Date: December 06, 2017 03:39AM

Hi all,

I made my first database design. A screenshot can be found here:https://i.imgsafe.org/7b/7b689c7679.png

The idea is to keep a list of approved posts. Every post has an author, a permlink, a reviewer and belongs to a category. A discoverer is optional. Reviewers can be enabled or disabled. Every post also has a list of keywords.

I want to achieve the following: I want to call the stored procedure or function with the following input parameters: author, permlink, discoverer, reviewer and category.

I got something to work but I'm not sure how to do the input parameter validation and how to 'report' when something is wrong. In a later stadium this stored procedure or function will be used from a php page.

I'm not sure if a stored procedure is the correct way to handle this.

If the category does not exist -> error
If the reviewer does not exist or is not enabled -> error
If the author does not exist -> add
If the discoverer does not exist -> add

If validation ok -> add

I was going to add to this post what I had this far but somehow I managed to delete my SP...

The issue I was having is that the SP continued when I detected an input was incorrect.

Any guidance is appreciated.

Options: ReplyQuote


Subject
Written By
Posted
First DB design and stored procedure - beginner questions
December 06, 2017 03:39AM


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.