Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- use wiekocheich;
- DELIMITER $$
- DROP PROCEDURE IF EXISTS `tsc_sp_add_page`$$
- CREATE PROCEDURE `tsc_sp_add_page` (in idfolder int(11), in title varchar(65), in template varchar(100))
- COMMENT 'creates a new page and adds all wildcards which will be shown infolder,InLanguage,InAll,InPage'
- BEGIN
- --id of the inserted page
- DECLARE pageid INT(11);
- --declarations for the loop
- DECLARE done INT DEFAULT 0;
- DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = 1;
- --first we create the page record
- INSERT INTO `tsc_page` (`id` ,`idfolder` , `title` , `template`) VALUES (NULL , idfolder, title , template);
- set pageid = LAST_INSERT_ID();
- --then we have to link all wildcards with the created page that will be shown infolder
- --next we have to link all wildcards with the created page that will be shown InLanguage
- --next we have to link all wildcards with the created page that will be shown InAll
- declare c_wildcard cursor for SELECT `id` , `name` , `content` FROM `tsc_wildcard` WHERE `InAll` =1;
- --next we have to link all wildcards with the created page that will be shown InPage
- END$$
- DELIMITER ;
- --call tsc_sp_add_page();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement