-- Collection of code snippets by Arne Vajhøj 
-- (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) 
DELIMITER //
CREATE PROCEDURE limsel(_n INTEGER)
BEGIN
   -- SELECT * FROM t1 ORDER BY f2 LIMIT _n;
   SELECT * FROM t1 ORDER BY f2 LIMIT 2;
END//
DELIMITER ;

CALL limsel(2);

DROP PROCEDURE limsel;
