Saturday, August 26, 2017

anil

How to Create a Simple Stored Procedure in mysql?


What do you mean by stored procedure?
stored procedure is a set of SQL statements that form a logical unit and perform a particular task, and they are used to encapsulate a group of operations or queries to execute on a database server.
Why do we use stored procedures?
The client of the stored procedure is isolated from the implementation details of the stored procedure and from the underlying schema. Stored procedures can reduce network traffic, because SQL statements can be executed in batches rather than sending several requests from the client
Syntax :-

DELIMITER $$
CREATE PROCEDURE `simpleprocedure`(IN name varchar(50),IN user_name varchar(50),IN branch varchar(50))
BEGIN
    insert into student (name,user_name,branch) values (in_name ,in_user_name,in_branch);
END$$
DELIMITER ;
Just copy and pase this code in your SQL command line... 


About Author -

Hi, I am Anil.

Welcome to my eponymous blog! I am passionate about web programming. Here you will find a huge information on web development, web design, PHP, Python, Digital Marketing and Latest technology.

Subscribe to this Blog via Email :

Note: Only a member of this blog may post a comment.