I need some application to automatize the process of build store procedures from the metadata of a mysql database. I build three tier applications and the process of create the 5 basic (select, insert, update, delete, select by key) stored procedures is long and tedious. I know I can make use of metadata and build my own application (I'm doing it with sed, perl and regular expressions from the tables DDL), but maybe there are something better already done.

There are some application I can make use of to generate (MySQL dialect specific or template based) DDL for stored procedures from one MySQL database, or from E-R Diagram, OpenSource ?
Note: I don't have the stored procedures, I only have the tables. I want to avoid the process of create the stored procedures by hand. I have the tables DDL.

Thanks in advance,