![]() By default, a procedure is associated with the default database (currently used database). Others (DB2, Mimer) also adhere.įollowing statements create a stored procedure. Stored procedures are migratory! MySQL adheres fairly closely to the SQL:2003 standard.And it makes sense to link the data with the processes that operate on the data. Stored procedures are always available as 'source code' in the database itself.That's the advantage of writing in SQL rather than in an external language like Java or C or PHP. ![]() ![]() When you write your stored procedure in SQL, you know that it will run on every platform that MySQL runs on, without obliging you to install an additional runtime-environment package, or set permissions for program execution in the operating system, or deploy different packages if you have different computer types. If you have a repetitive task that requires checking, looping, multiple statements, and no user interaction, do it with a single call to a procedure that's stored on the server. The main speed gain comes from reduction of network traffic. MySQL server takes some advantage of caching, just as prepared statements do. MySQL Procedure : Parameter INOUT example.MySQL Procedure : Parameter OUT example. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |