DELIMITER $$
DROP PROCEDURE IF EXISTS `world`.` GetCountryNameContinentByCode `$$
CREATE PROCEDURE  `world`.`GetCountryNameContinentByCode`(codeIn CHAR(3))
Begin
    DECLARE Cname VARCHAR(52);
    DECLARE Ccontinent VARCHAR(50);
    SELECT Name, Continent INTO Cname, Ccontinent  FROM country WHERE code = TRIM(codeIn);
    SELECT Cname, Ccontinent;
  END $$
DELIMITER ;
tusa@localhost:3306 [world]> CALL GetCountryNameContinentByCode('AFG');
+-------------+------------+
| Cname       | Ccontinent |
+-------------+------------+
| Afghanistan | Asia       |
+-------------+------------+
1 row in set (0.00 sec)
Query OK, 0 rows affected (0.00 sec)

Latest conferences

We have 4234 guests and no members online