DELIMITER $$
CREATE DEFINER=`sa`@`%` PROCEDURE `UpdateProvinceSalePrice`()MODIFIES SQL DATASQL SECURITY INVOKER
BEGIN
-- 需要定义接收游标数据的变量 DECLARE priceid int(11);DECLARE pricecode varchar(36);-- PricingCategory.codeDECLARE pricecorpid varchar(36);DECLARE pricecorpcode varchar(50);DECLARE pricecustomertypeid int(11);DECLARE pricegrouptype smallint(6);DECLARE pricegroupcode varchar(50);DECLARE pricemethod smallint(6);DECLARE priceIsForced smallint(6);DECLARE priceSalePrice decimal(11);DECLARE pricePrecision int(11);DECLARE priceRetentionway smallint(6);DECLARE pricestatus smallint(6);DECLARE pricecheckprice INT;DECLARE MapSalePrice varchar(30);DECLARE MapCategoryCode varchar(30);DECLARE SalePriceFormat varchar(150);DECLARE PinGroupCode varchar(30);DECLARE PinCode varchar(30);DECLARE CompanyName varchar(30);DECLARE ExistProductId varchar(38);DECLARE ExistProductCode varchar(38);-- 遍历数据结束标志DECLARE done bool DEFAULT false;-- 游标DECLARE cur CURSOR FOR SELECT id,Code, corpid,corpcode,customertypeid, grouptype,groupcode,pricemethods,IsForced,SalePrice,`Precision`,`Retentionway`,`status` FROM ProvincePricingCategory categoryjoin ProvincePricingCategory_SYNC categorysync on category.Id=BillId join schedulelog log on categorysync.SyncNum> log.syncnum where log.tagbillname='ProvincePricingCategory' and !category.IsForced and id=19474;-- 将结束标志绑定到游标DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = TRUE;-- 打开游标OPEN cur;-- 开始循环read_loop: LOOP-- 提取游标里的数据,这里只有一个,多个的话也一样;FETCH cur INTO priceid,pricecode, pricecorpid,pricecorpcode,pricecustomertypeid,pricegrouptype,pricegroupcode,pricemethod,priceIsForced,priceSalePrice,pricePrecision,priceRetentionway,pricestatus;-- 声明结束的时候IF done THENLEAVE read_loop;END IF;-- 这里做你想做的循环的事件--SET SQL_SAFE_UPDATES = 0;set CompanyName= concat('P',pricecorpcode);set @pricecode=pricecode; -- 动态拼sqlselect  salepricefieldmap.PartsSalePrice,salepricefieldmap.PriceCategoryCode from customertype join salepricefieldmap on  customertype.TypeCode =salepricefieldmap.TypeCode where customertype.Id=pricecustomertypeid into MapSalePrice,MapCategoryCode;select  SalePriceFormat(pricemethod,pricePrecision,priceRetentionway,priceSalePrice) into SalePriceFormat; -- 获得销售价计算公式select pricemethod,pricePrecision,priceRetentionway,priceSalePrice,SalePriceFormat;CREATE TEMPORARY TABLE if not exists  PartsSalePrice_TMP(ProductId varchar(36),ProductCode varchar(36)) ENGINE = MEMORY;CREATE TEMPORARY TABLE if not exists  sparepart_tmp(ProductId varchar(36),ProductCode varchar(36),SupplierCode varchar(36)) ENGINE = MEMORY;if(pricegrouptype=3) thenselect part.ProductId from sparepart partinner join partsgroup fz on fz.groupcode = part.groupcode  and fz.category=1inner join partsgroup pp on pp.parentcode = fz.code and pp.groupcode = part.groupcode and pp.category=2join ProvincePricingCategory category on pp.code =category.Groupcode and category.grouptype=2 and category.corpid = pricecorpid and category.status=2where  part.ProductCode =pricegroupcode and category.IsForced=1 limit 1 into ExistProductId;if ExistProductId is null THEN set ExistProductCode=null;select  pgroup.code from sparepart partjoin PartsGroup pgroup on part.groupcode=pgroup.groupcode and pgroup.category=1where part.ProductCode= pricegroupcode  into ExistProductCode;select * from  ProvincePricingCategory category join PartsGroup pgroup on category.groupcode=pgroup.code  and category.corpid = pricecorpid and category.status=2where  FIND_IN_SET(pgroup.code, GetAncestry(ExistProductCode))  and category.grouptype=1 and  category.corpid = pricecorpid limit 1 into ExistProductId ;if(ExistProductId is null)THEN insert into sparepart_tmpSELECT  part.ProductId,  part.ProductCode,cost.SupplierCode FROM  sparepart part join enterprisepartscost cost on cost.productcode=part.productcode  where part.productcode=pricegroupcode;set @insertsql= concat('INSERT INTO PartsSalePrice_TMPselect part.ProductCode,part.ProductId from  sparepart_tmp part  LEFT join ', CompanyName ,' price on part.ProductCode =price.productcode and  part.SupplierCode =price.SupplierCode WHERE price.productcode is null');      prepare stmpinsert from @insertsql;execute stmpinsert;if(exists(select 1 from PartsSalePrice_TMP)) thenset @SalePricesql= concat('insert into ',CompanyName,'(productid,productcode,productname,suppliercode,suppliername,checkprice,',MapSalePrice,',',MapCategoryCode,')select part.ProductId,part.ProductCode,cost.ProductName,cost.SupplierCode,cost.SupplierName,cost.CheckPrice,',SalePriceFormat,',',' ? from sparepart_tmp part join  enterprisepartscost coston  part.Productcode=cost.Productcode;');prepare stmp from @SalePricesql;execute stmp using @pricecode;end if;set @SalePricesql=concat('update ',CompanyName,' price join enterprisepartscost cost on cost.productcode= price.productcode and cost.suppliercode=price.suppliercode set price.',MapSalePrice,'=',SalePriceFormat,',' ,MapCategoryCode,'= ? ',' where price.productcode =cost.productcode and price.productcode=',pricegroupcode);prepare stmp from @SalePricesql;execute stmp using @pricecode;END IF;       END IF;end if;if(pricegrouptype=2) thenselect  fz.code from partsgroup fzjoin PartsGroup pgroup on pgroup.parentcode=fz.code and pgroup.category=2where pgroup.code= pricegroupcode  into ExistProductCode;select  part.ProductId from partsgroup fzjoin ProvincePricingCategory category on fz.code=category.Groupcode and category.grouptype=2 and category.corpid = pricecorpid where   FIND_IN_SET(fz.code, GetAncestry(ExistProductCode)) and category.IsForced=1  limit 1 into ExistProductCode;if (ExistProductId is null) THEN insert into sparepart_tmpSELECT  part.ProductId,  part.ProductCode,cost.SupplierCode   FROM  sparepart part join PartsGroup parentgroup  on parentgroup.groupcode=part.groupcode and parentgroup.category=1join PartsGroup childrengroup on childrengroup.ParentCode=parentgroup.code and childrengroup.groupcode = part.SpareBrandCode and childrengroup.category=2left join ProvincePricingCategory category on part.productcode=category.groupcode and category.grouptype=3 and category.corpid = pricecorpid  and category.IsForced=1 and status=2join enterprisepartscost cost on cost.productcode=part.productcodewhere category.code is null and childrengroup.groupcode=pricegroupcode;set @insertsql= concat('INSERT INTO PartsSalePrice_TMPselect part.ProductCode,part.ProductId from  sparepart_tmp part  LEFT join ', CompanyName ,' price on part.ProductCode =price.productcode and  part.SupplierCode =price.SupplierCode WHERE price.productcode is null');      prepare stmpinsert from @insertsql;execute stmpinsert;  if(exists(select 1 from PartsSalePrice_TMP)) thenset @SalePricesql= concat('insert into ',CompanyName,'(productid,productcode,productname,suppliercode,suppliername,checkprice,',MapSalePrice,',',MapCategoryCode,')select part.ProductId,part.ProductCode,cost.ProductName,cost.SupplierCode,cost.SupplierName,cost.CheckPrice,',SalePriceFormat,',',' ? from sparepart_tmp part join  enterprisepartscost coston  part.Productcode=cost.Productcode;');prepare stmp from @SalePricesql;execute stmp using @pricecode;end if;         set @SalePricesql= concat('update ',CompanyName,' price join sparepart_tmp  part on part.ProductCode =price.productcode and cost.suppliercode=price.suppliercode set price.CheckPrice=cost.CheckPrice,price.',MapSalePrice,'=',SalePriceFormat,',' , MapCategoryCode,'= ? ');prepare stmp from @SalePricesql;execute stmp using @pricecode;END IF;    end if;if(pricegrouptype=1) thenselect pgroup.code from PartsGroup pgroupjoin ProvincePricingCategory category on pgroup.code=category.Groupcode and category.grouptype=1 and category.corpid = pricecorpid  and status=2where FIND_IN_SET(pgroup.code, GetAncestry(pricegroupcode)) and category.IsForced limit 1 into ExistProductId;if ExistProductId is null  THEN insert into sparepart_tmpselect distinct fenzu.ProductId,fenzu.ProductCode,fenzu.SupplierCode from  (select distinct part.ProductId,part.ProductCode, b.SupplierCode from PartsGroup pgroup left join ProvincePricingCategory category on pgroup.code=category.GroupCode and category.grouptype=1 and category.corpid = pricecorpid  and category.IsForced=1 and category.status=2 and FIND_IN_SET(parentcode, queryChildrenGroup(pricegroupcode)) join sparepart part on  pgroup.groupcode=part.groupcode join EnterprisePartsCost b on part.productcode = b.productcodewhere category.GroupCode is null and pgroup.category=1)fenzujoin(select distinct part.ProductId ,part.ProductCode, b.SupplierCode from PartsGroup pgroup join PartsGroup cgroup on pgroup.code=cgroup.parentcode and  FIND_IN_SET(cgroup.parentcode, queryChildrenGroup(pricegroupcode))  and cgroup.category=2 left join ProvincePricingCategory category on cgroup.code=category.GroupCode and category.grouptype=2  and category.corpid = pricecorpid  and category.IsForced=1 and category.status=2join sparepart part on  cgroup.groupcode=part.SpareBrandCode  and part.groupcode = pgroup.groupcodejoin EnterprisePartsCost b on part.productcode = b.productcodewhere  category.GroupCode is null) pinpaion fenzu.ProductId=pinpai.ProductIdjoin (select distinct part.ProductId,part.ProductCode ,b.SupplierCode from PartsGroup pgroup join sparepart part on  pgroup.groupcode=part.groupcodeleft join ProvincePricingCategory category on part.productcode=category.GroupCode and category.grouptype=3 and FIND_IN_SET(parentcode, queryChildrenGroup(pricegroupcode))  and category.corpid = pricecorpid  and category.IsForced=1 and category.status=2join EnterprisePartsCost b on part.productcode = b.productcodewhere  category.GroupCode is null)peijianon fenzu.ProductId=peijian.ProductId;set @insertsql= concat('INSERT INTO PartsSalePrice_TMPselect part.ProductCode,part.ProductId from  sparepart_tmp part  LEFT join ', CompanyName ,' price on part.ProductCode =price.productcode and  part.SupplierCode =price.SupplierCode WHERE price.productcode is null'); prepare stmpinsert from @insertsql;execute stmpinsert;if(exists(select 1 from PartsSalePrice_TMP)) thenset @SalePriceInsertsql= concat('insert into ',CompanyName,'(productid,productcode,productname,suppliercode,suppliername,checkprice,',MapSalePrice,',',MapCategoryCode,')select part.ProductId,part.ProductCode,cost.ProductName,cost.SupplierCode,cost.SupplierName,cost.CheckPrice,',SalePriceFormat,',',' ? from sparepart_tmp part join  enterprisepartscost coston  part.Productcode=cost.Productcode;');prepare stmpin from @SalePriceInsertsql;execute stmpin using @pricecode;end if;set @SalePricesql= concat('update ',CompanyName,' price join sparepart_tmp part on part.ProductCode =price.productcodejoin enterprisepartscost cost on cost.productcode= price.productcode and cost.suppliercode=price.suppliercode set price.',MapSalePrice,'=',SalePriceFormat, ',' ,MapCategoryCode,'= ? ');prepare stmp from @SalePricesql;execute stmp using @pricecode;end if;END IF;   drop table PartsSalePrice_TMP;drop table sparepart_tmp;END LOOP;-- 关闭游标CLOSE cur;
END;$$
use dcs;
call UpdateProvinceSalePrice()call UpdateSalePrice()
INSERT INTO PartsSalePrice_TMP            select part.ProductCode,part.ProductId from  sparepart_tmp part  LEFT join P1001 price on part.ProductCode =price.productcode and  part.SupplierCode =price.SupplierCode            WHERE price.productcode is nullINSERT INTO PartsSalePrice_TMPselect part.ProductCode,part.ProductId from  sparepart_tmp part  LEFT join P1001 price on part.ProductCode =price.productcode and  part.SupplierCode =price.SupplierCode WHERE price.productcode is nullCREATE  TABLE if not exists  PartsSalePrice_TMP(ProductId varchar(36),ProductCode varchar(36)) ENGINE = MEMORY;use dcs;DELIMITER $$select * from p1001CREATE DEFINER=`sa`@`%` PROCEDURE `UpdateSalePrice`()MODIFIES SQL DATASQL SECURITY INVOKER
BEGIN
-- 需要定义接收游标数据的变量 DECLARE priceid int(11);-- PricingCategory.idDECLARE pricecode varchar(36);-- PricingCategory.codeDECLARE pricecorpid varchar(36);-- PricingCategory.corpidDECLARE pricecorpcode varchar(50);-- PricingCategory.corpcodeDECLARE pricecustomertypeid int(11);-- PricingCategory.customertypeidDECLARE pricegrouptype smallint(6);-- PricingCategory.grouptypeDECLARE pricegroupcode varchar(50);-- PricingCategory.groupcodeDECLARE pricemethod smallint(6);-- PricingCategory.pricemethodsDECLARE priceIsForced smallint(6);-- PricingCategory.IsForcedDECLARE priceSalePrice decimal(11);-- PricingCategory.SalePriceDECLARE pricePrecision int(11);-- PricingCategory.PrecisionDECLARE priceRetentionway smallint(6);-- PricingCategory.RetentionwayDECLARE pricestatus smallint(6);-- PricingCategory.statusDECLARE SalePriceFormat varchar(150);-- SalePriceFormat()DECLARE MapSalePrice varchar(30);--  salepricefieldmap.PartsSalePriceDECLARE MapCategoryCode varchar(30);-- salepricefieldmap.PriceCategoryCodeDECLARE CompanyName varchar(30);-- 'p'+PricingCategory.corpcode-- 遍历数据结束标志DECLARE done bool DEFAULT false;-- 游标DECLARE cur CURSOR FOR SELECT id,Code, corpid,corpcode,customertypeid,grouptype,groupcode,pricemethods,IsForced,category.SalePrice,`Precision`,`Retentionway`,`status` FROM PricingCategory categoryjoin PricingCategory_SYNC categorysync on category.Id=BillId join schedulelog log on categorysync.SyncNum> log.syncnum where log.tagbillname='PricingCategory' ;-- 将结束标志绑定到游标DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = TRUE;-- 打开游标OPEN cur;-- 开始循环read_loop: LOOP-- 提取游标里的数据,这里只有一个,多个的话也一样;FETCH cur INTO priceid,pricecode, pricecorpid,pricecorpcode,pricecustomertypeid,pricegrouptype,pricegroupcode,pricemethod,priceIsForced,priceSalePrice,pricePrecision,priceRetentionway,pricestatus;-- 声明结束的时候IF done THENLEAVE read_loop;END IF;-- 这里做你想做的循环的事件--SET SQL_SAFE_UPDATES = 0;set CompanyName= 'PartsSalePrice'; -- 需要更新的销售价表select  salepricefieldmap.PartsSalePrice,salepricefieldmap.PriceCategoryCode from customertype join salepricefieldmap on  customertype.TypeCode =salepricefieldmap.TypeCode where customertype.Id=pricecustomertypeid into MapSalePrice,MapCategoryCode; -- 获得需要更新的销售价具体列 select  SalePriceFormat(pricemethod,pricePrecision,priceRetentionway,priceSalePrice) into SalePriceFormat; -- 获得销售价计算公式set @pricecode=pricecode; -- 动态拼sqlCREATE TEMPORARY TABLE if not exists  PartsSalePrice_TMP(ProductId varchar(50),ProductCode varchar(36)) ENGINE = MEMORY;  -- 需要新增的销售价临时表CREATE TEMPORARY TABLE if not exists  sparepart_tmp(ProductId varchar(50),ProductCode varchar(36),SupplierCode varchar(36)) ENGINE = MEMORY; -- 需要更新的动态备件表if(pricegrouptype=3) then -- 定价原则为备件insert into sparepart_tmp SELECT  part.ProductId,  part.ProductCode ,cost.SupplierCode FROM  sparepart part join enterprisepartscost cost on cost.productcode=part.productcode where part.productcode=1150;-- 需要更新的 配件临时表INSERT INTO PartsSalePrice_TMP  -- 需要新增的销售价临时表select part.ProductCode,part.ProductId from  sparepart_tmp part  LEFT join  PartsSalePrice  price on part.ProductCode =price.productcode  and  part.SupplierCode =price.SupplierCode  WHERE price.productcode is null;  if(exists(select 1 from PartsSalePrice_TMP)) then -- 新增销售价set @SalePricesql= concat('insert into ',CompanyName,'(productid,productcode,productname,suppliercode,suppliername,checkprice,',MapSalePrice,',',MapCategoryCode,')select part.ProductId,part.ProductCode,cost.ProductName,cost.SupplierCode,cost.SupplierName,cost.CheckPrice,',SalePriceFormat,',',' ? from sparepart_tmp part join  enterprisepartscost coston  part.Productcode=cost.Productcode;');prepare stmp from @SalePricesql;execute stmp using @pricecode;end if;-- Update 销售价set @SalePricesql=concat('update ',CompanyName,' price join enterprisepartscost cost on cost.productcode= price.productcode and cost.suppliercode=price.suppliercode set price.CheckPrice=cost.CheckPrice,price.',MapSalePrice,'=',SalePriceFormat,',' ,MapCategoryCode,'= ?  where price.productcode =cost.productcode and price.productcode=',pricegroupcode);prepare stmp from @SalePricesql;execute stmp  using @pricecode;end if;if(pricegrouptype=2) theninsert into sparepart_tmp -- 需要新增的销售价临时表SELECT  part.ProductId,  part.ProductCode ,cost.SupplierCode FROM  sparepart part join PartsGroup parentgroup  on parentgroup.groupcode=part.groupcode and parentgroup.category=1join PartsGroup childrengroup on childrengroup.ParentCode=parentgroup.code and childrengroup.groupcode = part.SpareBrandCode and childrengroup.category=2left join PricingCategory category on part.productcode=category.groupcode and category.grouptype=3join enterprisepartscost cost on cost.productcode=part.productcodewhere category.code is null and childrengroup.groupcode=pricegroupcode;INSERT INTO PartsSalePrice_TMP-- 需要新增的销售价临时表select part.ProductCode,part.ProductId from  sparepart_tmp part  LEFT join  PartsSalePrice  price on part.ProductCode =price.productcode and  part.SupplierCode =price.SupplierCode WHERE price.productcode is null;      if(exists(select 1 from PartsSalePrice_TMP)) then-- 新增销售价set @SalePricesql= concat('insert into ',CompanyName,'(productid,productcode,productname,suppliercode,suppliername,checkprice,',MapSalePrice,',',MapCategoryCode,')select part.ProductId,part.ProductCode,cost.ProductName,cost.SupplierCode,cost.SupplierName,cost.CheckPrice,',SalePriceFormat,',',' ? from sparepart_tmp part join  enterprisepartscost coston  part.Productcode=cost.Productcode;');prepare stmp from @SalePricesql;execute stmp using @pricecode;end if;-- Update 销售价set @SalePricesql= concat('update ',CompanyName,' price join sparepart_tmp  part on part.ProductCode =price.productcode  join enterprisepartscost on cost.suppliercode=price.suppliercode set price.CheckPrice=cost.CheckPrice,price.',MapSalePrice,'=',SalePriceFormat,',' , MapCategoryCode,'= ? ');prepare stmp from @SalePricesql;execute stmp using @pricecode;end if;if(pricegrouptype=1) theninsert into sparepart_tmp(ProductId,ProductCode,SupplierCode) -- 需要新增的销售价临时表select distinct fenzu.ProductId,fenzu.ProductCode,fenzu.SupplierCode from  (select distinct part.ProductId,part.ProductCode ,b.SupplierCode from PartsGroup pgroup left join PricingCategory category on pgroup.code=category.GroupCode and  category.grouptype=1  and FIND_IN_SET(parentcode, queryChildrenGroup(pricegroupcode)) join sparepart part on  pgroup.groupcode=part.groupcode join EnterprisePartsCost b on part.productcode = b.productcodewhere category.GroupCode is null and pgroup.category=1)fenzujoin(select distinct part.ProductId ,part.ProductCode  ,b.SupplierCode from PartsGroup pgroup join PartsGroup cgroup on pgroup.code=cgroup.parentcode and  FIND_IN_SET(cgroup.parentcode, queryChildrenGroup(pricegroupcode))  and cgroup.category=2left join PricingCategory category on cgroup.code=category.GroupCode and category.grouptype=2 join sparepart part on  cgroup.groupcode=part.SpareBrandCode  and part.groupcode = pgroup.groupcodejoin EnterprisePartsCost b on part.productcode = b.productcodewhere  category.GroupCode is null) pinpaion fenzu.ProductId=pinpai.ProductIdjoin (select distinct part.ProductId,part.ProductCode ,b.SupplierCode  from PartsGroup pgroup join sparepart part on  pgroup.groupcode=part.groupcodeleft join PricingCategory category on part.productcode=category.GroupCode and category.grouptype=3 and FIND_IN_SET(pgroup.parentcode, queryChildrenGroup(pricegroupcode)) join EnterprisePartsCost b on part.productcode = b.productcodewhere  category.GroupCode is null )peijianon fenzu.ProductId=peijian.ProductId;-- 需要新增的销售价临时表INSERT INTO PartsSalePrice_TMPselect part.ProductId ,part.ProductCode from  sparepart_tmp part  LEFT join  PartsSalePrice  price on part.ProductCode =price.productcode and  part.SupplierCode =price.SupplierCode WHERE price.productcode is null and;   -- 新增销售价if(exists(select 1 from PartsSalePrice_TMP)) thenset @SalePricesql= concat('insert into ',CompanyName,'(productid,productcode,productname,suppliercode,suppliername,checkprice,',MapSalePrice,',',MapCategoryCode,')select part.ProductId,part.ProductCode,cost.ProductName,cost.SupplierCode,cost.SupplierName,cost.CheckPrice,',SalePriceFormat,',',' ? from sparepart_tmp part join  enterprisepartscost coston  part.Productcode=cost.Productcode;');prepare stmp from @SalePricesql;execute stmp using @pricecode;end if;-- Update 销售价set @SalePricesql= concat('update ',CompanyName,' price join sparepart_tmp part on part.ProductCode =price.productcodejoin enterprisepartscost cost on cost.productcode= price.productcode and cost.suppliercode=price.suppliercode set price.',MapSalePrice,'=',SalePriceFormat, ',' ,MapCategoryCode,'= ?');prepare stmp from @SalePricesql;execute stmp using @pricecode;end if;drop table PartsSalePrice_TMP;drop table sparepart_tmp;END LOOP;-- 关闭游标CLOSE cur;END;$$use security

转载于:https://www.cnblogs.com/naliang/p/mysqlprocedure.html

mysql 存储过程相关推荐

  1. 常用MySQL函数存储过程_解析MySQL存储过程、常用函数代码

    mysql存储过程的概念: 存储在数据库当中可以执行特定工作(查询和更新)的一组SQL代码的程序段. mysql函数的概念: 函数是完成特定功能的SQL语句,函数分为内置函数和自定义函数(user-d ...

  2. MySQL 存储过程传参之in, out, inout 参数用法

    存储过程传参:存储过程的括号里,可以声明参数. 语法是 create procedure p([in/out/inout] 参数名  参数类型 ..) in :给参数传入值,定义的参数就得到了值 ou ...

  3. mysql中leave和_MySQL数据库之Mysql存储过程使用LEAVE实现MSSQL存储过程中return语法

    本文主要向大家介绍了MySQL数据库之Mysql存储过程使用LEAVE实现MSSQL存储过程中return语法 ,通过具体的内容向大家展现,希望对大家学习MySQL数据库有所帮助. DELIMITER ...

  4. MySQL存储过程详解

    1.      存储过程简介   我们常用的操作数据库语言SQL语句在执行的时候需要要先编译,然后执行,而存储过程(Stored Procedure)是一组为了完成特定功能的SQL语句集,经编译后存储 ...

  5. mysql存储过程语法及实例

    存储过程如同一门程序设计语言,同样包含了数据类型.流程控制.输入和输出和它自己的函数库. --------------------基本语法-------------------- 一.创建存储过程 c ...

  6. mycat mysql 存储过程_MyCat 学习笔记 第十三篇.数据分片 之 通过HINT执行存储过程...

    1 环境说明 VM 模拟3台MYSQL 5.6 服务器 VM1 192.168.31.187:3307 VM2 192.168.31.212:3307 VM3 192.168.31.150:  330 ...

  7. mysql 存储过程 格式化_转 mysql 存储过程初探

    https://www.cnblogs.com/qmfsun/p/4838032.html MySQL命令执行sql文件的两种方法 https://www.cnblogs.com/mark-chan/ ...

  8. hibernate mysql 存储过程_hibernate调用mysql存储过程

    hibernate调用mysql存储过程 在最近的项目中,碰到一小段数据库数据分析的程序,需要结合多张表联合查询或涉及到子查询,项目主要采用的java ee开发,使用了hibernate框架,由于这些 ...

  9. mybatis mysql 存储过程_Mysql 存储过程+Mybatis调用实现插入操作例子 | 学步园

    一. 简介:网上关于存储过程的使用有很多的例子,但大多实现的功能比较简单,由于本人对SQL语句还不是很熟悉,更别说存储过程了,所以在实现该例子的时候遇到了很多问题,现在拿给大家来分享. 二. 在本例子 ...

  10. MySQL 存储过程初研究

    最近在做一个移动设备多类型登录的统一用户系统.其中记录用户资料的部分,因为涉及到更换设备的相同用户.同一个用户多类型同时具备的情况,所以想分辨出尽量少的用户去合理记录,就需要多次查询.于是决定研究一下 ...

最新文章

  1. border属性的CSS缩写顺序
  2. windows11图文安装流程
  3. 大疆aeb连拍_前后双屏幕:大疆OSMO Action行动相机规格与谍照曝光
  4. java对多态的理解_对于Java中多态的理解
  5. 位运算解决二进制位上不同数字的个数问题
  6. ERP 趣读 【转】
  7. ASP.NET全局文件Global.asax用法分析
  8. java安全相关类 (java.security包)
  9. Altium_Designer如何快速寻找元件和封装
  10. 几款好用的串口和网络调试助手
  11. NoteExpress的使用方法
  12. python的PIL库
  13. 苹果电脑上可以转化照片格式的几个小工具
  14. 【无标题】c++创建一个三角形类,计算周长和面积
  15. 获取当前登录用户的用户名
  16. CS224N 2019年课程第一次作业复现
  17. Python3 Django的补充
  18. 【Unity/C#】游戏出现区域性崩溃,深藏的国际化巨坑
  19. python 试题:写一段程序逐行读入一个文本文件,并在屏幕上打印出来。
  20. ROS示例----TIAGo教程

热门文章

  1. pygame重新开始_Pygame(十八)音乐
  2. linux sql命令行查询语句不要换行_面试刷题mysql1:一条sql语句是如何经过mysql的体系结构的?...
  3. python程序设计常见运算符号_python常用运算符
  4. scala数据类型_Scala数据类型示例教程
  5. jquery按键事件_jQuery按键事件
  6. scala代码示例_Scala集合示例
  7. 2021最新Java高频面试题,很适合大厂面试
  8. 开课吧课堂:详解挂起、恢复和终止线程
  9. 01.mac下安装配置maven
  10. PostgreSQL视频去重 图片去重系列1