Home Quartz Create a Simple Procedure


Share on Google+Share on Google+

Create a Simple Procedure

create simple procedure

Create a Simple Procedure


Simple Procedure is a set of SQL statement which are executed under one name.

Understand with Example 

This example shows you how to create a simple procedure. This procedure display all records of stu_table table. The create table construct a table 'Stu_Table'.

Create Table Stu_Table

create table Stu_Table(Stu_Id integer(2), Stu_Name varchar(15), Stu_Class  varchar(10))

Insert data into Stu_Table

The insert into add the records or rows to the table 'Stu_Table'.

insert into Stu_Table values(1,'Komal',10);
insert into Stu_Table values(2,'Ajay',10);
insert into Stu_Table values(3,'Rakesh',10);
insert into Stu_Table values(4,'Bhanu',10);
insert into Stu_Table values(5,'Santosh',10);
insert into Stu_Table values(1,'Komal',10);


Stu_Id Stu_Name Stu_Class
1 Komal 10
2 Ajay 10
3 Rakesh 10
4 Bhanu 10
5 Santosh 10
1 Komal 10

Create Procedure

The Create Procedure in SQL  is used to create a procedure Abc( ).The SQL stored procedure bodies contain of one or more statement nested inside a BEGIN and END keyword. In this Query stored procedure returns you the records from 'Stu_Table'.

delimiter $$

create procedure Abc()
	SELECT * FROM Stu_Table;

Call Procedure

The call procedure abc is used to execute the procedure andS return you the records from table 'Stu_Table'.

call abc();


Stu_Id Stu_Name Stu_Class
1 Komal 10
2 Ajay 10
3 Rakesh 10
4 Bhanu 10
5 Santosh 10
1 Komal 10

Liked it!  Share this Tutorial

Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.

Posted on: April 18, 2011

Ask Questions?    Discuss: Create a Simple Procedure  

Post your Comment

Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image