{"id":15456,"date":"2020-04-08T09:05:15","date_gmt":"2020-04-08T09:05:15","guid":{"rendered":"https:\/\/dbtut.com\/?p=15456"},"modified":"2021-02-06T09:13:02","modified_gmt":"2021-02-06T09:13:02","slug":"mysql-stored-procedures","status":"publish","type":"post","link":"https:\/\/dbtut.com\/index.php\/2020\/04\/08\/mysql-stored-procedures\/","title":{"rendered":"MySQL Stored Procedures"},"content":{"rendered":"<p>The article provides information about MySQL stored procedures. Creating a stored procedure and stored procedure types are explained with examples.<\/p>\n<h3>What is MySQL Stored Procedures?<\/h3>\n<p>Stored procedures are compiled SQL commands stored in DBMS.<\/p>\n<p>Codes written in stored procedures run faster than SQL commands because they are compiled only when they run first.<\/p>\n<p>Advanced VTY systems such as &#8220;SQL Server, Oracle, Sybase&#8221; support Stored Procedures.<\/p>\n<p>MySQL stored procedures are available after MySQL 5.0.<\/p>\n<p>Stored procedures are often used to store repetitive queries.<\/p>\n<p>Create a Stored Procedure in MySQL<\/p>\n<p>Stored procedures are created with the keyword CREATE PROCEDURE.<\/p>\n<pre class=\"lang:default decode:true\">CREATE PROCEDURE MyStoredProcedure(parameter1, parameter2, parameterN)\r\nBEGIN\r\n -- MySQL ve SQL commands\r\nEND;<\/pre>\n<p>Let&#8217;s list all products in the products table using the stored procedure.<\/p>\n<pre class=\"lang:default decode:true\">DELIMITER \/\/\r\nCREATE PROCEDURE ListProducts_SP_Example()\r\nBEGIN\r\n  SELECT * FROM products;\r\nEND\/\/\r\nDELIMITER ;<\/pre>\n<h4>What is delimiter in mysql stored procedure?<\/h4>\n<p>We can replace the default MySQL separator (;) with the DELIMITER keyword before the stored procedure. In our example, we set the separator as (\/\/).<\/p>\n<p>Changing the separator to (\/\/) ensures that the SQL and MySQL commands to be written are stored as a single command.<\/p>\n<h3>CALL a Stored Procedure in MySQL<\/h3>\n<p>The most important nice feature of the stored procedure is that it can be used over and over again after created.<\/p>\n<p>The CALL keyword is used to run the stored procedure.<\/p>\n<pre class=\"lang:default decode:true \">CALL MyStoredProcedures(parameter1, parameter2, parameterN);<\/pre>\n<p>Let&#8217;s run the stored procedure named MyStoredProcedure().<\/p>\n<pre class=\"lang:default decode:true\">CALL MyStoredProcedure();<\/pre>\n<p>When the stored procedure is executed, SQL commands in the stored procedure will be executed.<\/p>\n<h3>Using Variables in MySQL Stored Procedures<\/h3>\n<p>For the definition of variables in MySQL, you can look the article&#8221;<a href=\"https:\/\/dbtut.com\/index.php\/2020\/03\/23\/how-do-i-declare-a-variable-in-mysql\/\" target=\"_blank\" rel=\"noopener noreferrer\">How do I declare a variable in MySQL?<\/a>&#8220;.<\/p>\n<p>However, the DECLARE keyword is used to create variables within the stored procedure.<\/p>\n<pre class=\"lang:default decode:true \">DECLARE variable_name datatype(size) DEFAULT default_value;<\/pre>\n<p>The SET keyword is used to assign a value to the variable.<\/p>\n<p>Sample; Let&#8217;s create a variable named MyName and set a value.<\/p>\n<pre class=\"lang:default decode:true \">DECLARE MyName VARCHAR(50) DEFAULT '';\r\nSET MyNAme = 'Yusuf Sefa SEZER';<\/pre>\n<p>Lets use it in a stored procedure.<\/p>\n<pre class=\"lang:default decode:true\">DELIMITER \/\/\r\nCREATE PROCEDURE SakliYordam()\r\nBEGIN\r\n  DECLARE MyName VARCHAR(50) DEFAULT ''; \r\n  SET MyNAme = 'Yusuf Sefa SEZER';\r\nEND\/\/\r\nDELIMITER ;<\/pre>\n<p>When we run the stored procedure, it will not give any result since the variable is not used.<\/p>\n<p>To use the variable in SQL commands, it will be enough to Select the variable name.<\/p>\n<pre class=\"lang:default decode:true\">DELIMITER \/\/\r\nCREATE PROCEDURE MyStoredProcedure()\r\nBEGIN\r\n  DECLARE MyName VARCHAR(50) DEFAULT '';\r\n  SET MyName = 'Yusuf Sefa SEZER';\r\n  SELECT CHAR_LENGTH(MyName) AS Lenght_of_MyName;\r\nEND\/\/\r\nDELIMITER ;<\/pre>\n<p>When the stored procedure is executed, it will return the length of the value of the MyName variable.<\/p>\n<p>Variables can only be used between BEGIN and END, where they are defined.<\/p>\n<p>Variables are inaccessible except for BEGIN and END, where they are defined.<\/p>\n<h3>Stored Procedure Parameters in MySQL<\/h3>\n<p>By passing parameters to stored procedures, various operations can be performed according to the parameter.<\/p>\n<p>Stored procedure parameters are written in stored procedure brackets.<\/p>\n<p>Stored procedure parameters are divided into three as <strong>IN<\/strong>, <strong>OUT<\/strong> and <strong>INOUT<\/strong>.<\/p>\n<p>A simple parameter usage example;<\/p>\n<pre class=\"lang:default decode:true\">DELIMITER \/\/\r\nCREATE PROCEDURE Legnht_of_Name(myanme VARCHAR(50))\r\nBEGIN\r\n  SELECT CHAR_LENGTH(myname) AS Name_Length;\r\nEND\/\/\r\nDELIMITER ;<\/pre>\n<p>The IN parameter is used when the parameter type is not written.<\/p>\n<p>We can run the above stored procedure as follows.<\/p>\n<pre class=\"lang:default decode:true\">CALL Legnht_of_Name('Yusuf SEZER');<\/pre>\n<h3 class=\"LC20lb DKV0Md\">How to use IN, OUT and INOUT Parameters in Mysql Stored Procedure<\/h3>\n<h4>In and OUT Usage;<\/h4>\n<p>In is the default usage. W<\/p>\n<pre class=\"lang:default decode:true\">DELIMITER \/\/\r\nCREATE PROCEDURE Legnht_of_Name(IN mynameVARCHAR(50), OUT namelength INT)\r\nBEGIN\r\n  SET namelength = CHAR_LENGTH(myname);\r\nEND\/\/\r\nDELIMITER ;<\/pre>\n<p>We can use above stored procedure as follows;<\/p>\n<pre class=\"lang:default decode:true\">SET @namelength = 0;\r\nCALL Legnht_of_Name('Yusuf SEZER', @namelength);\r\nSELECT @namelength;<\/pre>\n<h4>INOUT Usage;<\/h4>\n<p>INOUT is a combination of IN and OUT.<\/p>\n<pre class=\"lang:default decode:true\">DELIMITER \/\/\r\nCREATE PROCEDURE Legnht_of_Name_Plus_Counter(IN myname VARCHAR(50), INOUT counter INT)\r\nBEGIN\r\n  SET counter= counter + CHAR_LENGTH(myname);\r\nEND\/\/\r\nDELIMITER ;<\/pre>\n<p>We can use above stored procedure as follows;<\/p>\n<pre class=\"lang:default decode:true \">SET @namelength= 0;\r\nCALL Legnht_of_Name_Plus_Counter('Yusuf SEZER', @namelength);\r\nSELECT @namelength;\r\n\r\nSET @namelength= 1;\r\nCALL Legnht_of_Name_Plus_Counter('Yusuf SEZER', @namelength);\r\nSELECT @namelength;\r\n\r\nSET @namelength= 2;\r\nCALL Legnht_of_Name_Plus_Counter('Yusuf SEZER', @namelength);\r\nSELECT @namelength;<\/pre>\n<h3>Insert Stored Procedure in MySQL<\/h3>\n<pre class=\"lang:default decode:true\">DELIMITER \/\/\r\nCREATE PROCEDURE AddProduct(IN product_name VARCHAR(50), IN product_price DECIMAL, IN product_id INT)\r\nBEGIN\r\n  INSERT INTO Products(productname, productprice, id) VALUES(product_name, product_price, product_id);\r\nEND\/\/\r\nDELIMITER ;<\/pre>\n<p>We can use above stored procedure as follows;<\/p>\n<pre class=\"lang:default decode:true\">CALL AddProduct('MySQL Book', 49, 59);<\/pre>\n<p>Stored procedures are run similarly in programming languages like PHP, Java, C#.<\/p>\n<div class=\"pvc_clear\"><\/div>\n<p id=\"pvc_stats_15456\" class=\"pvc_stats all  \" data-element-id=\"15456\" style=\"\"><i class=\"pvc-stats-icon medium\" aria-hidden=\"true\"><svg aria-hidden=\"true\" focusable=\"false\" data-prefix=\"far\" data-icon=\"chart-bar\" role=\"img\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewBox=\"0 0 512 512\" class=\"svg-inline--fa fa-chart-bar fa-w-16 fa-2x\"><path fill=\"currentColor\" d=\"M396.8 352h22.4c6.4 0 12.8-6.4 12.8-12.8V108.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v230.4c0 6.4 6.4 12.8 12.8 12.8zm-192 0h22.4c6.4 0 12.8-6.4 12.8-12.8V140.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v198.4c0 6.4 6.4 12.8 12.8 12.8zm96 0h22.4c6.4 0 12.8-6.4 12.8-12.8V204.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v134.4c0 6.4 6.4 12.8 12.8 12.8zM496 400H48V80c0-8.84-7.16-16-16-16H16C7.16 64 0 71.16 0 80v336c0 17.67 14.33 32 32 32h464c8.84 0 16-7.16 16-16v-16c0-8.84-7.16-16-16-16zm-387.2-48h22.4c6.4 0 12.8-6.4 12.8-12.8v-70.4c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v70.4c0 6.4 6.4 12.8 12.8 12.8z\" class=\"\"><\/path><\/svg><\/i> <img loading=\"lazy\" decoding=\"async\" width=\"16\" height=\"16\" alt=\"Loading\" src=\"https:\/\/dbtut.com\/wp-content\/plugins\/page-views-count\/ajax-loader-2x.gif\" border=0 \/><\/p>\n<div class=\"pvc_clear\"><\/div>\n","protected":false},"excerpt":{"rendered":"<p>The article provides information about MySQL stored procedures. Creating a stored procedure and stored procedure types are explained with examples. What is MySQL Stored Procedures? Stored procedures are compiled SQL commands stored in DBMS. Codes written in stored procedures run faster than SQL commands because they are compiled only when they run first. Advanced VTY &hellip;<\/p>\n<div class=\"pvc_clear\"><\/div>\n<p id=\"pvc_stats_15456\" class=\"pvc_stats all  \" data-element-id=\"15456\" style=\"\"><i class=\"pvc-stats-icon medium\" aria-hidden=\"true\"><svg aria-hidden=\"true\" focusable=\"false\" data-prefix=\"far\" data-icon=\"chart-bar\" role=\"img\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewBox=\"0 0 512 512\" class=\"svg-inline--fa fa-chart-bar fa-w-16 fa-2x\"><path fill=\"currentColor\" d=\"M396.8 352h22.4c6.4 0 12.8-6.4 12.8-12.8V108.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v230.4c0 6.4 6.4 12.8 12.8 12.8zm-192 0h22.4c6.4 0 12.8-6.4 12.8-12.8V140.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v198.4c0 6.4 6.4 12.8 12.8 12.8zm96 0h22.4c6.4 0 12.8-6.4 12.8-12.8V204.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v134.4c0 6.4 6.4 12.8 12.8 12.8zM496 400H48V80c0-8.84-7.16-16-16-16H16C7.16 64 0 71.16 0 80v336c0 17.67 14.33 32 32 32h464c8.84 0 16-7.16 16-16v-16c0-8.84-7.16-16-16-16zm-387.2-48h22.4c6.4 0 12.8-6.4 12.8-12.8v-70.4c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v70.4c0 6.4 6.4 12.8 12.8 12.8z\" class=\"\"><\/path><\/svg><\/i> <img loading=\"lazy\" decoding=\"async\" width=\"16\" height=\"16\" alt=\"Loading\" src=\"https:\/\/dbtut.com\/wp-content\/plugins\/page-views-count\/ajax-loader-2x.gif\" border=0 \/><\/p>\n<div class=\"pvc_clear\"><\/div>\n","protected":false},"author":485,"featured_media":15461,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_uf_show_specific_survey":0,"_uf_disable_surveys":false,"footnotes":""},"categories":[7],"tags":[9425,9433,9440,9422,9451,9415,9416,9441,9418,9417,9419,9437,9434,9438,9446,9439,9444,9456,9455,9448,9447,9450,9423,9436,9429,9449,9428,9435,9452,9430,9454,9442,9427,9426,9445,9443,9421,9420,9432,9431,9414,9412,9413,9424],"class_list":["post-15456","post","type-post","status-publish","format-standard","has-post-thumbnail","","category-mysql","tag-add-stored-procedure-to-mysql","tag-call-a-stored-procedure-in-mysql","tag-call-mysql-procedure","tag-can-we-write-stored-procedure-in-mysql","tag-create-insert-stored-procedure-in-mysql","tag-different-types-of-procedures-in-mysql","tag-does-mysql-support-stored-procedures","tag-execute-mysql-procedure","tag-how-do-i-create-a-stored-procedure-in-mysql","tag-how-do-i-create-a-stored-procedure","tag-how-do-stored-procedures-work","tag-how-to-call-mysql-procedure","tag-how-to-execute-mysql-procedure","tag-how-to-run-mysql-procedure","tag-how-to-use-in-out-parameters-in-mysql-stored-procedure","tag-how-to-use-mysql-stored-procedure","tag-how-to-use-variable-in-mysql-stored-procedure","tag-in-and-out-parameters-in-mysql-stored-procedure","tag-inout-parameters-in-mysql-stored-procedure","tag-insert-into-stored-procedure-mysql","tag-insert-stored-procedure-in-mysql","tag-insert-stored-procedure-in-mysql-example","tag-mysql-create-procedure-with-parameters","tag-mysql-stored-procedure-call","tag-mysql-stored-procedure-in-out-inout","tag-mysql-stored-procedure-insert","tag-mysql-stored-procedure-out-parameter","tag-mysql-stored-procedure-select","tag-mysql-stored-procedures","tag-mysql-workbench-create-stored-procedure","tag-out-and-inout-parameters-in-mysql-stored-procedure","tag-run-mysql-procedure","tag-select-procedure-mysql","tag-sql-stored-procedures-mysql","tag-stored-procedure-parameters-in-mysql","tag-using-variables-in-mysql-stored-procedures","tag-what-are-the-types-of-stored-procedures-in-mysql","tag-what-are-the-types-of-stored-procedures","tag-what-is-delimiter-in-mysql-stored-procedure","tag-what-is-mysql-stored-procedures","tag-what-is-procedure-in-mysql-with-example","tag-where-are-procedures-stored-in-mysql","tag-why-use-stored-procedures-in-mysql","tag-writing-stored-procedures-in-mysql"],"aioseo_notices":[],"a3_pvc":{"activated":true,"total_views":153,"today_views":0},"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.9 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>MySQL Stored Procedures - Database Tutorials<\/title>\n<meta name=\"description\" content=\"The article provides information about MySQL stored procedures. Creating a stored procedure and stored procedure types are explained.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/dbtut.com\/index.php\/2020\/04\/08\/mysql-stored-procedures\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"MySQL Stored Procedures - Database Tutorials\" \/>\n<meta property=\"og:description\" content=\"The article provides information about MySQL stored procedures. Creating a stored procedure and stored procedure types are explained.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/dbtut.com\/index.php\/2020\/04\/08\/mysql-stored-procedures\/\" \/>\n<meta property=\"og:site_name\" content=\"Database Tutorials\" \/>\n<meta property=\"article:published_time\" content=\"2020-04-08T09:05:15+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-02-06T09:13:02+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/dbtut.com\/wp-content\/uploads\/2020\/04\/Ads\u0131z-2.png\" \/>\n\t<meta property=\"og:image:width\" content=\"525\" \/>\n\t<meta property=\"og:image:height\" content=\"307\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Yusuf SEZER\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Yusuf SEZER\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/dbtut.com\/index.php\/2020\/04\/08\/mysql-stored-procedures\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/dbtut.com\/index.php\/2020\/04\/08\/mysql-stored-procedures\/\"},\"author\":{\"name\":\"Yusuf SEZER\",\"@id\":\"https:\/\/dbtut.com\/#\/schema\/person\/be8bf54494b6a89e626cbed2c940599a\"},\"headline\":\"MySQL Stored Procedures\",\"datePublished\":\"2020-04-08T09:05:15+00:00\",\"dateModified\":\"2021-02-06T09:13:02+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/dbtut.com\/index.php\/2020\/04\/08\/mysql-stored-procedures\/\"},\"wordCount\":506,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/dbtut.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/dbtut.com\/index.php\/2020\/04\/08\/mysql-stored-procedures\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/dbtut.com\/wp-content\/uploads\/2020\/04\/Ads\u0131z-2.png\",\"keywords\":[\"Add stored procedure to mysql\",\"call a stored procedure in mysql\",\"call mysql procedure\",\"Can we write stored procedure in MySQL?\",\"create insert stored procedure in mysql\",\"Different types of Procedures in MySQL\",\"Does MySQL support stored procedures?\",\"execute mysql procedure\",\"How do I create a stored procedure in MySQL?\",\"How do I create a stored procedure?\",\"How do stored procedures work?\",\"how to call mysql procedure\",\"How to execute mysql procedure\",\"how to run mysql procedure\",\"How to use IN OUT Parameters in Mysql Stored Procedure\",\"how to use mysql stored procedure\",\"how to use variable in mysql stored procedure\",\"IN and OUT Parameters in Mysql Stored Procedure\",\"INOUT Parameters in Mysql Stored Procedure\",\"insert into stored procedure mysql\",\"insert stored procedure in mysql\",\"insert stored procedure in mysql example\",\"Mysql create procedure with parameters\",\"MySQL stored procedure call\",\"Mysql stored procedure IN out inout\",\"Mysql stored procedure insert\",\"MySQL stored procedure OUT parameter\",\"Mysql stored procedure select\",\"MySQL Stored Procedures\",\"Mysql Workbench create stored procedure\",\"OUT and INOUT Parameters in Mysql Stored Procedure\",\"run mysql procedure\",\"Select procedure mysql\",\"Sql stored procedures mysql\",\"Stored Procedure Parameters in MySQL\",\"using variables in mysql stored procedures\",\"What are the types of stored procedures in MySQL\",\"What are the types of stored procedures?\",\"what is delimiter in mysql stored procedure\",\"What is MySQL Stored Procedures?\",\"What is procedure in MySQL with example?\",\"Where are procedures stored in MySQL?\",\"Why use stored procedures in MySQL?\",\"Writing stored procedures in mysql\"],\"articleSection\":[\"MySQL-MariaDB\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/dbtut.com\/index.php\/2020\/04\/08\/mysql-stored-procedures\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/dbtut.com\/index.php\/2020\/04\/08\/mysql-stored-procedures\/\",\"url\":\"https:\/\/dbtut.com\/index.php\/2020\/04\/08\/mysql-stored-procedures\/\",\"name\":\"MySQL Stored Procedures - Database Tutorials\",\"isPartOf\":{\"@id\":\"https:\/\/dbtut.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/dbtut.com\/index.php\/2020\/04\/08\/mysql-stored-procedures\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/dbtut.com\/index.php\/2020\/04\/08\/mysql-stored-procedures\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/dbtut.com\/wp-content\/uploads\/2020\/04\/Ads\u0131z-2.png\",\"datePublished\":\"2020-04-08T09:05:15+00:00\",\"dateModified\":\"2021-02-06T09:13:02+00:00\",\"description\":\"The article provides information about MySQL stored procedures. Creating a stored procedure and stored procedure types are explained.\",\"breadcrumb\":{\"@id\":\"https:\/\/dbtut.com\/index.php\/2020\/04\/08\/mysql-stored-procedures\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/dbtut.com\/index.php\/2020\/04\/08\/mysql-stored-procedures\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/dbtut.com\/index.php\/2020\/04\/08\/mysql-stored-procedures\/#primaryimage\",\"url\":\"https:\/\/dbtut.com\/wp-content\/uploads\/2020\/04\/Ads\u0131z-2.png\",\"contentUrl\":\"https:\/\/dbtut.com\/wp-content\/uploads\/2020\/04\/Ads\u0131z-2.png\",\"width\":525,\"height\":307},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/dbtut.com\/index.php\/2020\/04\/08\/mysql-stored-procedures\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/dbtut.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"MySQL Stored Procedures\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/dbtut.com\/#website\",\"url\":\"https:\/\/dbtut.com\/\",\"name\":\"Database Tutorials\",\"description\":\"MSSQL, Oracle, PostgreSQL, MySQL, MariaDB, DB2, Sybase, Teradata, Big Data, NOSQL, MongoDB, Couchbase, Cassandra, Windows, Linux\",\"publisher\":{\"@id\":\"https:\/\/dbtut.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/dbtut.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/dbtut.com\/#organization\",\"name\":\"dbtut\",\"url\":\"https:\/\/dbtut.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/dbtut.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/dbtut.com\/wp-content\/uploads\/2021\/02\/dbtutlogo.jpg\",\"contentUrl\":\"https:\/\/dbtut.com\/wp-content\/uploads\/2021\/02\/dbtutlogo.jpg\",\"width\":223,\"height\":36,\"caption\":\"dbtut\"},\"image\":{\"@id\":\"https:\/\/dbtut.com\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/dbtut.com\/#\/schema\/person\/be8bf54494b6a89e626cbed2c940599a\",\"name\":\"Yusuf SEZER\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/dbtut.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/19675b3db2d4ce370af047187123e2055a2b254ede3f0e7d9bc934da478146f7?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/19675b3db2d4ce370af047187123e2055a2b254ede3f0e7d9bc934da478146f7?s=96&d=mm&r=g\",\"caption\":\"Yusuf SEZER\"},\"url\":\"https:\/\/dbtut.com\/index.php\/author\/yusufsezer\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"MySQL Stored Procedures - Database Tutorials","description":"The article provides information about MySQL stored procedures. Creating a stored procedure and stored procedure types are explained.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/dbtut.com\/index.php\/2020\/04\/08\/mysql-stored-procedures\/","og_locale":"en_US","og_type":"article","og_title":"MySQL Stored Procedures - Database Tutorials","og_description":"The article provides information about MySQL stored procedures. Creating a stored procedure and stored procedure types are explained.","og_url":"https:\/\/dbtut.com\/index.php\/2020\/04\/08\/mysql-stored-procedures\/","og_site_name":"Database Tutorials","article_published_time":"2020-04-08T09:05:15+00:00","article_modified_time":"2021-02-06T09:13:02+00:00","og_image":[{"width":525,"height":307,"url":"https:\/\/dbtut.com\/wp-content\/uploads\/2020\/04\/Ads\u0131z-2.png","type":"image\/png"}],"author":"Yusuf SEZER","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Yusuf SEZER","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/dbtut.com\/index.php\/2020\/04\/08\/mysql-stored-procedures\/#article","isPartOf":{"@id":"https:\/\/dbtut.com\/index.php\/2020\/04\/08\/mysql-stored-procedures\/"},"author":{"name":"Yusuf SEZER","@id":"https:\/\/dbtut.com\/#\/schema\/person\/be8bf54494b6a89e626cbed2c940599a"},"headline":"MySQL Stored Procedures","datePublished":"2020-04-08T09:05:15+00:00","dateModified":"2021-02-06T09:13:02+00:00","mainEntityOfPage":{"@id":"https:\/\/dbtut.com\/index.php\/2020\/04\/08\/mysql-stored-procedures\/"},"wordCount":506,"commentCount":0,"publisher":{"@id":"https:\/\/dbtut.com\/#organization"},"image":{"@id":"https:\/\/dbtut.com\/index.php\/2020\/04\/08\/mysql-stored-procedures\/#primaryimage"},"thumbnailUrl":"https:\/\/dbtut.com\/wp-content\/uploads\/2020\/04\/Ads\u0131z-2.png","keywords":["Add stored procedure to mysql","call a stored procedure in mysql","call mysql procedure","Can we write stored procedure in MySQL?","create insert stored procedure in mysql","Different types of Procedures in MySQL","Does MySQL support stored procedures?","execute mysql procedure","How do I create a stored procedure in MySQL?","How do I create a stored procedure?","How do stored procedures work?","how to call mysql procedure","How to execute mysql procedure","how to run mysql procedure","How to use IN OUT Parameters in Mysql Stored Procedure","how to use mysql stored procedure","how to use variable in mysql stored procedure","IN and OUT Parameters in Mysql Stored Procedure","INOUT Parameters in Mysql Stored Procedure","insert into stored procedure mysql","insert stored procedure in mysql","insert stored procedure in mysql example","Mysql create procedure with parameters","MySQL stored procedure call","Mysql stored procedure IN out inout","Mysql stored procedure insert","MySQL stored procedure OUT parameter","Mysql stored procedure select","MySQL Stored Procedures","Mysql Workbench create stored procedure","OUT and INOUT Parameters in Mysql Stored Procedure","run mysql procedure","Select procedure mysql","Sql stored procedures mysql","Stored Procedure Parameters in MySQL","using variables in mysql stored procedures","What are the types of stored procedures in MySQL","What are the types of stored procedures?","what is delimiter in mysql stored procedure","What is MySQL Stored Procedures?","What is procedure in MySQL with example?","Where are procedures stored in MySQL?","Why use stored procedures in MySQL?","Writing stored procedures in mysql"],"articleSection":["MySQL-MariaDB"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/dbtut.com\/index.php\/2020\/04\/08\/mysql-stored-procedures\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/dbtut.com\/index.php\/2020\/04\/08\/mysql-stored-procedures\/","url":"https:\/\/dbtut.com\/index.php\/2020\/04\/08\/mysql-stored-procedures\/","name":"MySQL Stored Procedures - Database Tutorials","isPartOf":{"@id":"https:\/\/dbtut.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/dbtut.com\/index.php\/2020\/04\/08\/mysql-stored-procedures\/#primaryimage"},"image":{"@id":"https:\/\/dbtut.com\/index.php\/2020\/04\/08\/mysql-stored-procedures\/#primaryimage"},"thumbnailUrl":"https:\/\/dbtut.com\/wp-content\/uploads\/2020\/04\/Ads\u0131z-2.png","datePublished":"2020-04-08T09:05:15+00:00","dateModified":"2021-02-06T09:13:02+00:00","description":"The article provides information about MySQL stored procedures. Creating a stored procedure and stored procedure types are explained.","breadcrumb":{"@id":"https:\/\/dbtut.com\/index.php\/2020\/04\/08\/mysql-stored-procedures\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/dbtut.com\/index.php\/2020\/04\/08\/mysql-stored-procedures\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/dbtut.com\/index.php\/2020\/04\/08\/mysql-stored-procedures\/#primaryimage","url":"https:\/\/dbtut.com\/wp-content\/uploads\/2020\/04\/Ads\u0131z-2.png","contentUrl":"https:\/\/dbtut.com\/wp-content\/uploads\/2020\/04\/Ads\u0131z-2.png","width":525,"height":307},{"@type":"BreadcrumbList","@id":"https:\/\/dbtut.com\/index.php\/2020\/04\/08\/mysql-stored-procedures\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/dbtut.com\/"},{"@type":"ListItem","position":2,"name":"MySQL Stored Procedures"}]},{"@type":"WebSite","@id":"https:\/\/dbtut.com\/#website","url":"https:\/\/dbtut.com\/","name":"Database Tutorials","description":"MSSQL, Oracle, PostgreSQL, MySQL, MariaDB, DB2, Sybase, Teradata, Big Data, NOSQL, MongoDB, Couchbase, Cassandra, Windows, Linux","publisher":{"@id":"https:\/\/dbtut.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/dbtut.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/dbtut.com\/#organization","name":"dbtut","url":"https:\/\/dbtut.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/dbtut.com\/#\/schema\/logo\/image\/","url":"https:\/\/dbtut.com\/wp-content\/uploads\/2021\/02\/dbtutlogo.jpg","contentUrl":"https:\/\/dbtut.com\/wp-content\/uploads\/2021\/02\/dbtutlogo.jpg","width":223,"height":36,"caption":"dbtut"},"image":{"@id":"https:\/\/dbtut.com\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/dbtut.com\/#\/schema\/person\/be8bf54494b6a89e626cbed2c940599a","name":"Yusuf SEZER","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/dbtut.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/19675b3db2d4ce370af047187123e2055a2b254ede3f0e7d9bc934da478146f7?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/19675b3db2d4ce370af047187123e2055a2b254ede3f0e7d9bc934da478146f7?s=96&d=mm&r=g","caption":"Yusuf SEZER"},"url":"https:\/\/dbtut.com\/index.php\/author\/yusufsezer\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/dbtut.com\/index.php\/wp-json\/wp\/v2\/posts\/15456","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dbtut.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dbtut.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dbtut.com\/index.php\/wp-json\/wp\/v2\/users\/485"}],"replies":[{"embeddable":true,"href":"https:\/\/dbtut.com\/index.php\/wp-json\/wp\/v2\/comments?post=15456"}],"version-history":[{"count":0,"href":"https:\/\/dbtut.com\/index.php\/wp-json\/wp\/v2\/posts\/15456\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/dbtut.com\/index.php\/wp-json\/wp\/v2\/media\/15461"}],"wp:attachment":[{"href":"https:\/\/dbtut.com\/index.php\/wp-json\/wp\/v2\/media?parent=15456"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dbtut.com\/index.php\/wp-json\/wp\/v2\/categories?post=15456"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dbtut.com\/index.php\/wp-json\/wp\/v2\/tags?post=15456"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}