Databases| SQL| MySQL| Questions?

 

 

 

 

 

 

 

 

 

 

 

 

 

Search Tutorials

Latest Questions
Comments
 
Use DECLARE Statement in Procedure 
 

Use DECLARE Statement in Procedure is used to define variable and its data type.

 

Use DECLARE Statement in Procedure

                         

Use DECLARE Statement in Procedure is used to define variable and its data type.

Understand with Example

The Tutorial illustrate an example from 'Use Declare Statement in Procedure'. To grasp this Example, we create a procedure 'abc'. The Query start with the BEGIN Section that include DECLARE statement which define a variable x ,y and z and data type is integer kind. The SET variable set the value of ' x' to 10 and 'y' to 20.The set z set the compute value of variable x and y respectively.

  select z :The select z return you the sum value of x and y variable in z.

 

Create Procedure

delimiter $$
create procedure abc()
BEGIN 
	DECLARE x int;
	DECLARE y int;
	DECLARE z int;
	SET x = 10;
	SET y = 20;
	set z = x+y;
	select z;
END$$
delimiter ;

Call Procedure

To invoke a procedure, we use call abc ( ).The below syntax show you to call procedure :

call abc()

Result

+------+
| z    |
+------+
| 30   |
+------+

                         

» View all related tutorials
Related Tags: sql mysql c table data ui datatypes types type tutorial field name ria create tab ie example with to datatype

Leave your comment:

Name:

Email:

URL:

Title:

Comments:


Enter Code:

Audio Version
Reload Image
 

Note: Emails will not be visible or used in any way, and are not required. Please keep comments relevant. Any content deemed inappropriate or offensive may be edited and/or deleted.

No HTML code is allowed. Line breaks will be converted automatically. URLs will be auto-linked. Please use BBCode to format your text.

Add This Tutorial To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Training Courses
Tell A Friend
Your Friend Name
Software Solutions
Least Viewed
Most Rated
Recently Viewed
Search Tutorials

 

 
 

Home | JSP | EJB | JDBC | Java Servlets | WAP  | Free JSP Hosting  | Search Engine | News Archive | Jboss 3.0 tutorial | Free Linux CD's | Forum | Blogs

About Us | Advertising On RoseIndia.net  | Site Map

India News

Indian Software Development Company | iPhone Development Company in India | Flex Development Company in India | Java Training Delhi | Java Training at Noida |

Send your comments, Suggestions or Queries regarding this site at roseindia_net@yahoo.com.

Copyright © 2008. All rights reserved.