  | |  Re: Select/Update statements with multiple references and/or a
procedure | Re: Select/Update statements with multiple references and/or a
procedure 2005-02-12 - By Graham Reeds
Back Jan Theodore Galkowski wrote: > Hey Graham, > > I've done a fair bit of medical work, both for clients and for my wife > who needs to manage an inventory. > > What's exactly the problem with using Excel?
Not exactly interactive but it does make a nice graph. Everytime she adds a new day to the month she has to add the relevant BB (Before Breakfast), BL (Lunch), BT (Tea), BBd (Bed) manually. I've suggested things like templates to help her but I opened my mouth and said "I could do better".
> On Fri, 11 Feb 2005 22:31:38 +0000, "Graham Reeds" > <grahamr@(protected)> said: > >>I am writing a simple webapp for my house mate who is diabetic. >>Currently she is using a Excel spreadsheet for it but it is problematic. >> I said I could write something better so here I am. >> >>The app only uses two tables which represent a single day's glucose >>levels and insuling taken: >> >>CREATE TABLE readings >>( >> `ID` int(10) unsigned NOT NULL auto_increment, >> `Glucose` float NOT NULL default '0', >> `Insulin` int(10) unsigned NOT NULL default '0', >> PRIMARY KEY (ID) >>) >> > > > What's the *OBJECT* here that's being tracked with the ID? Is it a > day's treatment? A reading? Why are they keyed? Simply to be able to > associate them with the "records" table?
Yes. You take 4 readings a day, once before breakfast - the BB_id in records, once before lunch, tea and bed for the glucose levels and also record how much insulin you take. The reason they are keyed is because I thought that would be sensible way to do it.
> Why not have just a readings table and characterize a kind of reading as > BB, BL, BT, and BBd? > Can date or time stamp each of these. That is, > [snip]
I guess that would work - I was thinking along the lines of separating in their logical blocks (normalising?).
>>I was thinking of a select procedure that will first see if there is a >>record for the day. If not then it will create the initial records with >>the default values and return those. However does MySQL have a PL/SQL >>style language? > > Usually this is done outside of MySQL with something like PHP, but quite > a lot can be done with SQL itself. > Almost anything can be done once stored procedures show up, but that's > not yet.
Thanks for you help.
Graham Reeds.
-- MySQL Windows Mailing List For list archives: http://lists.mysql.com/win32 To unsubscribe: http://lists.mysql.com/win32?unsub=mysql@(protected)
Earn $52 per hosting referral at Lunarpages.
|
|
 |