A 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 :-
Just copy and pase this code in your SQL command line...DELIMITER $$CREATE PROCEDURE `simpleprocedure`(IN name varchar(50),IN user_name varchar(50),IN branch varchar(50))BEGINinsert into student (name,user_name,branch) values (in_name ,in_user_name,in_branch);END$$DELIMITER ;
Note: Only a member of this blog may post a comment.