How to dump stored procedures to a file?

2006-09-01 Thread Matthew Wilson
It seems that mysqldump on mysql 5.0 does not export my stored procedures. How do I dump these out so that other people can load them into their copies of my database? Matt -- A better way of running series of SAS programs: http://overlook.homelinux.net/wilsonwiki/SasAndMakefiles -- MySQL G

How to name a table based on the contents of a variable?

2006-08-31 Thread Matthew Wilson
I'm writing a stored procedure that gets a VARCHAR(45) as a parameter. Inside my stored procedure, I want to create a table with a name based on that parameter. For example, if I do call my_sp('XXX'); I want the stored procedure to create a table named foo_XXX. I don't know how to do this. He

How to draw data model diagrams from existing schema?

2006-08-30 Thread Matthew Wilson
I've spent the last month building a fairly elaborate database with lots of foreign keys. I want to draw a diagram that maps the relationships between all the tables, but I haven't found any software that can do that. Does anyone have any suggestions? I want to draw a picture with a box for eac

How to deal with summary data and reports

2006-08-29 Thread Matthew Wilson
I wrote a fairly large query that summarizes our sales into monthly totals by business unit, then left joins on some other information from a bunch of other tables. Running the query takes a long time. I'm considering whether to store my summary data as a table, like this: create table monthly_t