Anas Al-Far Blog

Tell me.. What do you think?

Stored Procedures Auto Generator

November7

This is my new gift to the MySql Users, Administrators, Developers and any one looking or standard stored procedures and want to reduce development time as well.

My class generates standard stored procedures for every table in your database. So, If you have a MySql DB and needs to generate some standards procedures, I’m sure that you’ll find this script very very useful.

Once you run the script, you’ll notice that you have actually had a 5 stored procedures for each table in your database. Those stored procedures are:

- Get All Fields and Records From Table.
- Get All Fields From Table By Primary Key.
- Insert Into Table.
- Update Table By Primary Key.
- Delete from Table By Primary Key.

To download the class, please click here.

How to use it?

Please open the file in edit mode,� go to the end of file and edit this line with your configurations:

$generateSP = new storedProceduresAutoGenerator(’Your-DB-Server’, ‘Your-DB-Username’, ‘Your-DB-Password’, ‘Your-DB-Name’, ‘Any-Writable-Path-To-Generate-The-SP-Into’);

Save the file, and then just�run it.

Note: that the Stored Procedures Auto Generator Class has been released with source code under the LGPL free software license.

posted under Development
27 Comments to

“Stored Procedures Auto Generator”

  1. On November 9th, 2007 at 10:50 am Anas Al-Far Says:

    Thanks Taliba, I was able to translate your replay by google :)
    Keep track of my blog, I’m working on a lot of such scripts that you’ll find more interest.

  2. On November 9th, 2007 at 3:20 pm Abedelhadi shajrawi Says:

    Spero che tutti i migliori, l’uomo, grazie per questa classe inshallah io uso nel mio lavoro:) .. Dispiace per il primo commento

  3. On November 9th, 2007 at 3:23 pm Anas Al-Far Says:

    Non ti preoccupare “Abdelhadi”, I’ll eliminarlo.

  4. On November 16th, 2007 at 10:49 am Matrex Says:

    any sample how to use this script ?

    tnx :)

  5. On November 16th, 2007 at 12:33 pm Anas Al-Far Says:

    Sorry :)
    Pleae check the post again, I have added “How to”.
    Thanks.

  6. On November 16th, 2007 at 8:00 pm Matrex Says:

    nice … it works fine

    tnx

  7. On January 29th, 2008 at 12:42 pm dante Says:

    Warning: file_put_contents(C:/wamp\www\procedure\sql\GetAllUser.sql) [function.file-put-contents]: failed to open stream: No such file or directory in C:\wamp\www\procedure\storedProceduresAutoGenerator.php on line 394

    what is wrong ?
    $generateSP = new storedProceduresAutoGenerator(’localhost’, ‘root’, ”, ‘mysql’, ‘C:\wamp\www\procedure’);

  8. On January 29th, 2008 at 3:35 pm Anas Al-Far Says:

    Ok, fine.
    Please create a folder named “sql”.
    Right click on the folder.
    Go to “Security Tab”.
    Add “Everyone” user to the users list.
    Give “read, write and execute” permission to “everyone” user.
    Enjoy.

  9. On March 19th, 2008 at 9:55 pm Nikolet Says:

    Nice site!

  10. On March 21st, 2008 at 12:37 am raindeer Says:

    Hi,

    the file cudnt be opened using winzip. its in .gz extension and it shows invalid archive directory. Can you point me where I am able to download it ?

    Thanks

  11. On March 26th, 2008 at 7:00 pm Elisabethnq Says:

    thank you, bro

  12. On August 15th, 2008 at 12:37 pm Alex Says:

    Your blog is interesting!

    Keep up the good work!

  13. On August 24th, 2008 at 7:14 pm christian Says:

    Let me begin by saying that i love your blog anas.al-far.com a lot
    now.. back on topic hehe
    I cant say that im 100% with what you typed up… care to explain deeper?

  14. On September 7th, 2008 at 12:54 pm pokemon Says:

    Cool blog.
    Thanks, webmaster.

  15. On September 12th, 2008 at 7:16 pm Marina Says:

    Beautiful design.
    Thanks, webmaster.

  16. On September 14th, 2008 at 11:16 pm Pavel Says:

    Amazing site.
    Thanks, webmaster.

  17. On September 16th, 2008 at 12:57 pm proslaviy Says:

    Hi, how I can send PM?

  18. On October 16th, 2008 at 6:04 am Effilet Says:

    Excellent design, Tnks webmaster.

  19. On December 3rd, 2009 at 9:10 pm Raj Gohil Says:

    This is very helpful.

  20. On December 26th, 2009 at 4:13 am Pharma124 Says:

    Very nice site!

  21. On December 29th, 2009 at 12:12 pm myname Says:

    you might want to consider installing a spam filter on your blog =)

  22. On January 8th, 2010 at 7:19 am Pharmc48 Says:

    Very nice site!

  23. On January 13th, 2010 at 6:02 am Deepan prabhu Says:

    Thanks you script really helped me chew in a lot of work . cheers .

  24. On March 3rd, 2010 at 7:06 pm samir Says:

    i got urs auot generate stored procedur. but how can i run php file to generat stored procedure.

  25. On March 3rd, 2010 at 7:48 pm Anas Al-Far Says:

    Samir: are you using Windows/Linux OS? also, do you have any PHP editor installed? or any development package like AppServ?

  26. On March 3rd, 2010 at 7:56 pm samir Says:

    in autogenerate stored procedure . where i put storedprocedure.php in separate folder or else?

    igot error like Warning: file_put_contents(C:\xampp\htdocs\sql\sql\UpdateZone_masterByID.sql) [function.file-put-contents]: failed to open stream: No such file or directory in C:\xampp\htdocs\bpb\storedproceduresautogenerator.php on line 390

    Warning: chmod() [function.chmod]: No such file or directory in C:\xampp\htdocs\bpb\storedproceduresautogenerator.php on line 391

    Warning: file_put_contents(C:\xampp\htdocs\sql\sql\InsertIntoZone_master.sql) [function.file-put-contents]: failed to open stream: No such file or directory in C:\xampp\htdocs\bpb\storedproceduresautogenerator.php on line 392

    Warning: chmod() [function.chmod]: No such file or directory in C:\xampp\htdocs\bpb\storedproceduresautogenerator.php on line 393

    Warning: file_put_contents(C:\xampp\htdocs\sql\sql\GetAllZone_master.sql) [function.file-put-contents]: failed to open stream: No such file or directory in C:\xampp\htdocs\bpb\storedproceduresautogenerator.php on line 394

  27. On March 3rd, 2010 at 8:05 pm Anas Al-Far Says:

    Samir:
    ok, you just need to create this directory on your machine:
    C:\xampp\htdocs\sql\sql\
    and make sure its writeable!

Email will not be published

Website example

Your Comment:

Security Code: