Skip to content

Instantly share code, notes, and snippets.

@TheByKotik
Created July 14, 2019 09:42
Show Gist options
  • Save TheByKotik/2bfd812062a879156bbec2f75be0cc10 to your computer and use it in GitHub Desktop.
Save TheByKotik/2bfd812062a879156bbec2f75be0cc10 to your computer and use it in GitHub Desktop.
CREATE DATABASE IF NOT EXISTS `test`;
USE `test`;
DELIMITER //
CREATE PROCEDURE `StoredProc`(
IN `Param1` INT
)
READS SQL DATA
SQL SECURITY INVOKER
BEGIN
SELECT `SecondInt` FROM `test` WHERE `FirstInt` = Param1;
END//
DELIMITER ;
CREATE TABLE IF NOT EXISTS `test` (
`FirstInt` int(11) DEFAULT NULL,
`SecondInt` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
INSERT INTO `test` (`FirstInt`, `SecondInt`) VALUES
(1, 1),
(2, 2);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment