我正在尝试根据创建的过程在数据库中创建一个表。我不熟悉mysql程序,无法尝试创建这个数据库。
以下是程序代码:
DELIMITER //
CREATE PROCEDURE SetChanProps(IN vchanmask TEXT, in vchankey TEXT, IN vcommentxt TEXT, IN ventrymsg TEXT, IN vexpires TIMESTAMP, IN vgroupname TEXT, IN vchanlimit INT, IN vmodes TEXT, IN vonlyowner INT, IN vsetbynick TEXT, IN vsetbyhost TEXT, IN vsetbypid INT, IN vtopic TEXT, IN vkickexisting INT)
BEGIN
DECLARE msgid int;
DECLARE rowcount int;
DECLARE setondate TIMESTAMP;
SET setondate = CURRENT_TIMESTAMP;
SELECT COUNT(*) INTO rowcount FROM `chanprops` WHERE `chanmask` = vchanmask;
if rowcount > 0 THEN UPDATE `chanprops` SET `chankey` = vchankey, `comment` = vcommentxt, `entrymsg` = ventrymsg, `expires` = vexpires, `groupname` = vgroupname, `limit` = vchanlimit, `mode` = vmodes, `onlyowner` = vonlyowner, `setbynick` = vsetbynick, `setbyhost` = vsetbyhost, `setbypid` = vsetbypid, `topic` = vtopic, `setondate` = setondate WHERE `chanmask` = vchanmask;
ELSE INSERT INTO `chanprops` (`chanmask`,`chankey`,`comment`,`entrymsg`,`expires`,`groupname`,`limit`,`mode`,`onlyowner`,`setbynick`,`setbyhost`,`setbypid`,`topic`) VALUES (vchanmask,vchankey,vcommentxt,ventrymsg,vexpires,vgroupname,vchanlimit,vmodes,vonlyowner,vsetbynick,vsetbyhost,vsetbypid,vtopic);
end if;
SET msgid = 36;
select matrixqueue(msgid,vchanmask,vchankey,vcommentxt,ventrymsg,Unix_Timestamp(vexpires),vgroupname,vchanlimit,vmodes,vonlyowner,vsetbynick,vsetbyhost,vsetbypid,vtopic,Unix_Timestamp(setondate),vkickexisting);
END//
DELIMITER ;
这是我整理这张table的正确路线吗?
ELSE INSERT INTO `chanprops` (`chanmask`,`chankey`,`comment`,`entrymsg`,`expires`,`groupname`,`limit`,`mode`,`onlyowner`,`setbynick`,`setbyhost`,`setbypid`,`topic`) VALUES (vchanmask,vchankey,vcommentxt,ventrymsg,vexpires,vgroupname,vchanlimit,vmodes,vonlyowner,vsetbynick,vsetbyhost,vsetbypid,vtopic);
然后我会使用create过程行(第2行)来确定列id的类型吗?
不幸的是,我试图利用这个过程的项目已经多年没有工作了,已经被它的创建者放弃了。它们包含了其他的.sql文件,这些文件通常只是为我创建表。他们似乎错过了我真正关心的那个。
暂无答案!
目前还没有任何答案,快来回答吧!