Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- DELIMITER $$
- CREATE DEFINER=`user_name`@`%` PROCEDURE `sp_TABLE_name`(
- pTransType int,
- pId bigint,
- pName varchar(250),
- pStartFrom datetime,
- pStartTo datetime,
- pSignature longblob)
- BEGIN
- if pTransType = 1 then
- insert into TABLE_name (Id, Name, startfrom, startto, signature)
- values(pId, pName, pStartFrom, pStartTo, pSignature);
- end if;
- if pTransType = 2 then
- update TABLE_name set
- Name = pName,
- startfrom = pStartFrom,
- startto = pStartTo,
- signature = pSignature
- where Id = pId;
- end if;
- if pTransType = 3 then
- delete from TABLE_name where id = pId;
- end if;
- END$$
- DELIMITER ;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement