Saturday, August 26, 2017

Anil kr Prajapati

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 PHP programming. Here you will find a hug of information on web development, web design, PHP and Latest technology.

Subscribe to this Blog via Email :