Advertisement
Advertisement
| 07.20.2008 at 10:11PM PDT, ID: 23580949 |
|
[x]
Attachment Details
|
||
|
[x]
The Solution Rating System
|
||
With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.
Your Input Matters If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support. Thank you! |
||
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: |
Sample template: CREATE FUNCTION `proc_$variable`() RETURNS int(11) BEGIN DECLARE raw_info CURSOR FOR SELECT email FROM table_$variable; DECLARE CONTINUE HANDLER FOR SQLSTATE '02000' BEGIN END; OPEN raw_info; main: LOOP <do something> END LOOP main; CLOSE raw_info; RETURN SELECT count(*) FROM table_$variable; END Assuming sample template in /opt/templates and script called like this: > script.pl 55 /opt/templates Script will read templates and create the following SP in the MySQL DB: CREATE FUNCTION `proc_55`() RETURNS int(11) BEGIN DECLARE raw_info CURSOR FOR SELECT email FROM table_55; DECLARE CONTINUE HANDLER FOR SQLSTATE '02000' BEGIN END; OPEN raw_info; main: LOOP <do something> END LOOP main; CLOSE raw_info; RETURN SELECT count(*) FROM table_55; END |