Restricting data input

Restricting data input

am 06.04.2010 12:41:43 von Tompkins Neil

--00151747538a70824604838f17b9
Content-Type: text/plain; charset=ISO-8859-1

Hi

I have a table that contains league standings type information for a soccer
league. For example

season_id
round_id
team_id
league_id
home_won
home_draw
home_lost
home_goals
home_conceded
away_won
away_draw
away_lost
away_goals
away_conceded

Basically each row contains each league's round results for each team. From
here I can display the league standings for each round for each league. My
question is how / what is the best way to restrict incorrect data input
apart from a coding issue/bug - e.g I need to ensure that for each round a
team can only have either a value in the fields home_won or home_draw
or home_lost or away_won or away_draw or away_lost as a example. Or is this
best coded within my application ?

Cheers
Neil

--00151747538a70824604838f17b9--

RE: Restricting data input

am 06.04.2010 13:17:00 von misiaQ

For such strongly database related logic sometimes its handy to keep all the
update and insert queries inside the stored procedures. All the validation
you mention in that case should be also build in the procedure.

Regards,
m

-----Original Message-----
From: Tompkins Neil [mailto:neil.tompkins@googlemail.com]
Sent: Tuesday, April 06, 2010 11:42 AM
To: [MySQL]
Subject: Restricting data input

Hi

I have a table that contains league standings type information for a soccer
league. For example

season_id
round_id
team_id
league_id
home_won
home_draw
home_lost
home_goals
home_conceded
away_won
away_draw
away_lost
away_goals
away_conceded

Basically each row contains each league's round results for each team. From
here I can display the league standings for each round for each league. My
question is how / what is the best way to restrict incorrect data input
apart from a coding issue/bug - e.g I need to ensure that for each round a
team can only have either a value in the fields home_won or home_draw
or home_lost or away_won or away_draw or away_lost as a example. Or is this
best coded within my application ?

Cheers
Neil


--------------------------------------------------
Szukasz pracy? Sprawdz oferty na praca.interia.pl!
http://link.interia.pl/f265b


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=gcdmg-mysql-2@m.gmane.org