- 浏览: 477799 次
- 性别:
- 来自: 广州
文章分类
- 全部博客 (502)
- Java (70)
- Linux (10)
- 数据库 (38)
- 网络 (10)
- WEB (13)
- JSP (4)
- 互联网 (71)
- JavaScript (30)
- Spring MVC (19)
- HTML (13)
- CSS (3)
- AngularJS (18)
- Redis (5)
- Bootstrap CSS (1)
- ZooKeeper (4)
- kafka (6)
- 服务器缓存 (4)
- Storm (1)
- MongoDB (9)
- Spring boot (16)
- log4j (2)
- maven (3)
- nginx (5)
- Tomcat (2)
- Eclipse (4)
- Swagger (2)
- Netty (5)
- Dubbo (1)
- Docker (7)
- Hadoop (12)
- OAuth (1)
- webSocket (4)
- 服务器性能 (7)
- Session共享 (1)
- tieye修改 (1)
- 工作 (1)
- 有用的语录 (0)
- https (2)
- common (5)
- 产品开发管理 (1)
- CDN 工作原理 (1)
- APNS、GCM (1)
- 架构图 (3)
- 功能实现分析 (1)
- JMX (1)
- 服务器相关操作命令 (1)
- img02 (0)
- 服务器环境搭建 (9)
- goodMenuBook (1)
- CEInstantPot (0)
- 有用数据 (1)
- 百度地图WEB API (2)
- 正则表达式 (1)
- 样式例子 (2)
- staticRecipePressureCooker.zip (1)
- jCanvas (1)
- 网站攻击方法原理 (1)
- 架构设计 (3)
- 物联网相关 (3)
- 研发管理 (7)
- 技术需求点 (1)
- 计划 (1)
- spring cloud (11)
- 服务器开发的一些实用工具和方法 (1)
- 每天学到的技术点 (4)
- Guava (1)
- ERP 技术注意要点 (2)
- 微信小程序 (1)
- FineRepor (1)
- 收藏夹 (1)
- temp (5)
- 服务架构 (4)
- 任职资格方案 (0)
- osno_test (1)
- jquery相关 (3)
- mybatis (4)
- ueditor (1)
- VueJS (7)
- python (10)
- Spring EL (1)
- shiro (1)
- 前端开发原理与使用 (7)
- YARN (1)
- Spark (1)
- Hbase (2)
- Pig (2)
- 机器学习 (30)
- matplotlib (1)
- OpenCV (17)
- Hystrix (1)
- 公司 (1)
- miniui (4)
- 前端功能实现 (3)
- 前端插件 (1)
- 钉钉开发 (2)
- Jenkins (1)
- elasticSearch使用 (2)
- 技术规范 (4)
- 技术实现原理 (0)
最新评论
--执行存储过程创建
if (exists (select * from sys.objects where name = 'p_areaChannelDistributionReport'))
drop proc p_areaChannelDistributionReport
go
create proc p_areaChannelDistributionReport
as
BEGIN
select COUNT(*) AS num from sa_agreement;
End
--调用、执行存储过程
exec p_areaChannelDistributionReport;
--循环使用
DECLARE @areaId as varchar(40)
DECLARE cur_area CURSOR FOR
SELECT nid AS areaId from t_area_info with (nolock) WHERE parentid=1
OPEN cur_area
fetch next from cur_area into @areaId --将游标向下移1行,获取的数据放入之前定义的变量@id,@name中
while @@fetch_status=0 --判断是否成功获取数据
begin
Print @areaId
fetch next from cur_area into @areaId --将游标向下移1行
end
close cur_area --关闭游标
deallocate cur_area
--定义变量和设置值
DECLARE @areaId as varchar(40)
Declare @yearString as varchar(6)
Set @yearString ='2021'
--增删改操作
Begin
Delete [areaChannelDistributionReport]
where
Not Exists (Select B.toChannel From #temp_areaChanneltargetValue AS B
WHere B.toChannel = [areaChannelDistributionReport].toChannel
AND B.channelId = [areaChannelDistributionReport].channelId
AND B.areaId = [areaChannelDistributionReport].areaId
AND B.channelType = [areaChannelDistributionReport].channelType
AND B.khId = [areaChannelDistributionReport].khId
AND B.yearString = [areaChannelDistributionReport].yearString
)
end
Begin
Update [areaChannelDistributionReport]
Set [khId] = B.[khId]
,[khName] = B.[khName]
,[channelId] = B.[channelId]
,[areaId] = B.[areaId]
,[areaName] = B.[areaName]
,[regionId] = B.[regionId]
,[regionName] = B.[regionName]
,[channelType] = B.[channelType]
,[channelTypeName] = B.[channelTypeName]
,[toChannel] = B.[toChannel]
,[targetT1] = B.[targetT1]
,[targetT2] = B.[targetT2]
,[targetT3] = B.[targetT3]
,[targetT4] = B.[targetT4]
,[targetT5] = B.[targetT5]
,[targetT6] = B.[targetT6]
,[targetN1] = B.[targetN1]
,[targetN2] = B.[targetN2]
,[targetN3] = B.[targetN3]
,[targetN4] = B.[targetN4]
,[targetN5] = B.[targetN5]
,[yearString] = B.[yearString]
,[targetT31] = B.[targetT31]
,[targetT32] = B.[targetT32]
,[targetT33] = B.[targetT33]
,[targetT41] = B.[targetT41]
,[targetT42] = B.[targetT42]
,[targetT43] = B.[targetT43]
,[targetT44] = B.[targetT44]
,[confirm] = B.[confirm]
From #temp_areaChanneltargetValue AS B
WHere B.toChannel = [areaChannelDistributionReport].toChannel
AND B.channelId = [areaChannelDistributionReport].channelId
AND B.areaId = [areaChannelDistributionReport].areaId
AND B.channelType = [areaChannelDistributionReport].channelType
AND B.khId = [areaChannelDistributionReport].khId
AND B.yearString = [areaChannelDistributionReport].yearString
end
Begin
insert into [areaChannelDistributionReport] (
khId ,
khName,
channelId,
areaId,
areaName,
regionId,
regionName,
channelType,
channelTypeName,
channelName,
toChannel,
targetT1,
targetT2,
targetT3,
targetT4,
targetT5,
targetT6,
targetN1,
targetN2,
targetN3,
targetN4,
targetN5 ,
yearString ,
targetT31,
targetT32,
targetT33,
targetT41,
targetT42,
targetT43,
targetT44,
confirm
)
Select
khId ,
khName,
channelId,
areaId,
areaName,
regionId,
regionName,
channelType,
channelTypeName,
channelName,
toChannel,
targetT1,
targetT2,
targetT3,
targetT4,
targetT5,
targetT6,
targetN1,
targetN2,
targetN3,
targetN4,
targetN5 ,
yearString,
targetT31,
targetT32,
targetT33,
targetT41,
targetT42,
targetT43,
targetT44,
confirm
From #temp_areaChanneltargetValue AS B
Where not exists (Select toChannel From [areaChannelDistributionReport]
WHere B.toChannel = [areaChannelDistributionReport].toChannel
AND B.channelId = [areaChannelDistributionReport].channelId
AND B.areaId = [areaChannelDistributionReport].areaId
AND B.channelType = [areaChannelDistributionReport].channelType
AND B.khId = [areaChannelDistributionReport].khId
AND B.yearString = [areaChannelDistributionReport].yearString
)
end
发表评论
-
SQL常用语句
2022-07-21 19:09 182delete from cacherefresh where ... -
ES数据同步方案
2022-06-24 10:57 2189//============================= ... -
SQL存储过程例子和有用的SQL
2022-02-19 09:20 172delete from cacherefresh where ... -
SQL优化对比与总结
2021-01-09 14:44 34719000000 b表 SELECT * from b w ... -
mysql提高insert into 插入速度的方法
2018-12-14 17:26 6060mysql提高insert into 插入 ... -
Mysql并发时经典常见的死锁原因及解决方法
2018-12-08 09:30 3020Mysql并发时经典常见的死锁原因及解决方法 MySQL有 ... -
数据库沉余实现方式
2018-12-04 17:30 980数据库沉余实现方式 canal 原理相对比较简单: (1)c ... -
最终一致性的常用做法
2018-12-01 22:28 597最终一致性的常用做法 ... -
库存扣减和锁
2018-11-29 16:19 2库存扣减和锁 在对数据库的值进行修改时,如果在多线程情况下 ... -
Spring Boot中整合Sharding-JDBC
2018-11-26 18:03 3412Spring Boot中整合Sharding-JDBC ... -
MYSQL 主从、读写分离、分库分表、高可用、数据安全
2018-11-19 18:03 1700MYSQL 主从、读写分离、分库分表、高可用、数据安全 ... -
mybatis-generator 使用
2018-05-19 11:29 512http://www.cnblogs.com/Jason-Xi ... -
eclipse JPA Tools 使用
2018-05-14 17:11 732https://blog.csdn.net/guoxin91/ ... -
mybatis 通用查询实现
2018-03-26 10:04 1367package com.oceano.modity.entit ... -
存储过程 函数
2017-10-27 17:59 446存储过程 函数 存储过 ... -
分页查询例子
2017-10-19 10:22 743分页查询例子 Mybatis分页插件PageHelper的 ... -
数据库同步工具
2017-10-14 14:27 1296数据库同步工具 goden gate Oracle Go ... -
ETL工具
2017-09-01 15:14 672ETL工具 ETL,是英文 Extract-Transfor ... -
PowerDesigner 对比pdm文件内容变化工具
2017-08-06 14:24 672PowerDesigner 对比pdm文件内容变化工具 -
hibernate 分库分表
2017-06-21 14:36 1072hibernate 分库分表 事务是对同一个数据库进行的,不 ...
相关推荐
GBase8s 存储过程测试方法 -- '------------------ 存储过程--------------------------------' --在交互式sql交互式工具中执行,创建表 CREATE TABLE COM_T2 (C1 INT,C2 varchar2(10)); INSERT INTO COM_T2 VALUES...
本文实例讲述了Python使用cx_Oracle调用Oracle存储过程的方法。分享给大家供大家参考,具体如下: 这里主要测试在Python中通过cx_Oracle调用PL/SQL。 首先,在数据库端创建简单的存储过程。 create or replace ...
TPC-E基准测试是一种权威的服务器在线事务处理性能评测基准,测试基准中包含12个基本事务,本文档实现的是以存储过程的方式来实现其中的一个事务:BrokerVolume,在评测中,客户端软件可以通过调用存储过程来对...
c#调用存储过程两种方法 - - c# sql .net asp.net
不需要去存储过程中找,只要输入您存过程的名称就可以找到您想要的存储过程 支持模糊查找,数据库连接测试.非常方便远程和安装使用
4.2.2 插入测试表调试存储过程 38 4.2.3 DBMS_OUTPUT系统内置包 39 附录一 sql*plus工具 40 附录1.1 sql*plus启动和关闭 41 附录1.2 sql*plus 环境设置 42 附录1.3 设置环境参数 42 附录1.4 sqlplus命令的执行 43 ...
本文讲述如何在Oracle通过任务和管道的应用,异步调用存储过程的方法。并且介绍了其基本原理和具体实现测试。
VB6.0 调用存储过程的例子(方法一) rm1窗体,Copy以下的代码到窗体中,该段代码将测试存储过程ADOTestRPE的返回值、输入参数及输出参数,测试的过程中,可能需要修改链接字符串。
在java代码中调用执行shell脚本,sqlldr导数与使用sqlplus在shell调用执行存储过程。 linux环境中有2个dba的用户:oracle、erm 还有1个web用户:erm 在linux环境中,这三个用户都可以直接在任意目录下执行该shell...
Firbird内嵌函数极少,本示例介绍了如何利用ibexpert创建使用UDF的存储过程,并在C#(winform)中调用该存储过程. 打包部署时只需如下: 1.GDS32.DLL (1.5的版本) 2.FirebirdSql.Data.FirebirdClient.dll 3.ib_util.dll ...
针对java调用存储过程写的通用封装,oracle,mssql测试通过,附带测试脚本.以前写过一个,感觉不是很好,这个周末就重写了一个,大家多多提意见,是eclipse工程直接跑junit就行了,所有的东西都在里面.除了存储过程也可以...
双击左边的树存储过程,存储过程名会自动到右边的输入框,再点击右边执行按钮进行完成加密。 B加密原理 1.把原存储过程备份到本地DATA/SourceFile文件夹下 2.把存储过程导出加密文件DATA/EncryptionFile文件夹下 3...
13总结14资源列表参考资料本文将以一个真实的项目为背景,从分析过去存储过程的测试方法中存在的问题入手,逐步阐述我们分析问题,寻找问题根源和寻求解决办法的过程,介绍我们开发这个基于JUnit的存储过程自动化...
2. 查看存储过程 3. 执行存储过程pr_buy 查询某商品在指定日期之间的销售量 5. 查看触发器 6. 通过sql语句更新商品价格,测试tr_update
金额转换成大写表示,可直接在服务器端执行,以测试可用,需要用到的朋友可下载
进入pl/sql测试窗口 2.执行语句 declare empname varchar2(255); customize_exp EXCEPTION; –自定义异常 begin FOR c IN (select d.* from scott.dept d) LOOP begin dbms_output.put_...
【描述集成测试执行过程中出现的特殊情况的约束准则。】 如,被测模块出现某个致命性错误。测试案例无法继续执行,测试工作需暂停,如果非关联模块可以进行测试则执行非关联模块的测试;当这些问题得到解决后重新...
首先需要安装LR的.NETADD-IN,在开发环境编写代码,做数据库连接,然后调用执行存储过程。装好以后,打开程序,应该看到菜单栏里多了一个: 首先需要安装LR的.NETADD-IN,在开发环境编写代码,做数据库连接,然后...
--执行存储过程,测试 declare productname nvarchar2(100); begin proc_getproductnambyid(productid =>'1',productName=>productname); dbms_output.put_line(productname); end; declare productname nvarchar2...
作业内容—存储过程和触发器、索引实验 一、 存储过程和触发器实验 1. 请在你选用的数据库平台上,针对你的应用场景,对如下操作至少各实现一个存储过程: 1)单表或多表查询 2)数据插入 3)数据删除 4)数据修改 ...