Friday 8 May 2015

Mysql - Stored Procedure with Input and Output Parameters

Click here to watch in Youtube : https://www.youtube.com/watch?v=9gueIEwUHnA&index=2&list=UUhwKlOVR041tngjerWxVccw

Click the below Image to Enlarge
Mysql - Stored Procedure with Input and Output Parameters
Mysql - Stored Procedure with Input and Output Parameters
Mysql - Stored Procedure with Input and Output Parameters
Mysql - Stored Procedure with Input and Output Parameters
Mysql - Stored Procedure with Input and Output Parameters
Mysql - Stored Procedure with Input and Output Parameters
Mysql - Stored Procedure with Input and Output Parameters

DELIMITER $$

DROP PROCEDURE IF EXISTS `world`.`getCityName` $$
CREATE PROCEDURE `world`.`getCityName` 
   (IN CITY_ID INT, OUT CITY_NAME VARCHAR(255))
BEGIN
   SELECT Name INTO CITY_NAME
   FROM city
   WHERE ID = CITY_ID;
END $$

DELIMITER ;

----------------------------------------------------------

set @CITY_ID=3;
call getCityName(@CITY_ID,@CITY_NAME);
select @CITY_NAME;

See also:
  • All JavaEE Viedos Playlist
  • All JavaEE Viedos
  • All JAVA EE Links
  • Servlets Tutorial
  • All Design Patterns Links
  • JDBC Tutorial
  • Java Collection Framework Tutorial
  • 1 comment: