CREATE DATABASE IF NOT EXISTS test;
USE test;
DROP TABLE IF EXISTS `userinfo`;
CREATE TABLE `userinfo` (
`AutoId` int(4) NOT NULL auto_increment,
`UserName` varchar(20) NOT NULL,
`UserPswd` varchar(20) NOT NULL,
PRIMARY KEY (`AutoId`),
KEY `UserName` (`UserName`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
INSERT INTO `userinfo` (`AutoId`,`UserName`,`UserPswd`) VALUES
(1,'zgmaike','7910525');
DROP PROCEDURE IF EXISTS `UserInfo`;
DELIMITER $$
CREATE DEFINER=`zgmaike`@`%` PROCEDURE `UserInfo`(IN ID INT)
BEGIN
SELECT * FROM UserInfo WHERE AutoId = ID;
END $$
DELIMITER ;
DROP VIEW IF EXISTS `username`;
CREATE ALGORITHM=UNDEFINED DEFINER=`zgmaike`@`%` SQL SECURITY DEFINER VIEW `username` AS select `userinfo`.`AutoId` AS `AutoId`,`userinfo`.`UserName` AS `UserName` from `userinfo`;
欢迎光临 MariaDB社区 (http://123.56.88.72/) | Powered by Discuz! X3.2 |