- 浏览: 1736932 次
- 性别:
- 来自: 上海
文章分类
- 全部博客 (337)
- javaScript校验 (11)
- java (31)
- java连接数据库 (1)
- js应用 (41)
- JQuery (15)
- linux操作命令 (12)
- loadrunner测试 (5)
- tomcat (18)
- 数据库 (12)
- eclipse (7)
- 触发器 (7)
- 表单 (3)
- ibatis (6)
- oracle (4)
- xml (1)
- Exception (6)
- spring (16)
- struts (4)
- struts 标签 (2)
- sql (8)
- sql server (6)
- 其它 (18)
- Apache (2)
- 电脑故障 (4)
- java 线程 (1)
- dwr (8)
- jackey (18)
- 总结 (34)
- gcc linux (2)
- extjs 学习 (5)
- 网站建设 (4)
- 健康 (2)
- 房地产知识 (1)
- hibernate (3)
- mysql (7)
- linux (13)
- svn (1)
最新评论
-
阳光泛滥的日子:
很好用谢谢
java.net.URISyntaxException的解决办法 -
linjianqing:
现在有更好的处理方式吗?我正也为这发愁
applet访问打印机出现的问题 -
ruyi574812039:
非常感谢您的总结!想问几个问题!假设三个项目分别以静态部署的三 ...
在Tomcat中部署Web程序的几种方式 -
yangguo:
太j8麻烦了
Spring3.1中使用缓存注解及Shiro的缓存联合 -
bellawang:
很好用谢谢
java.net.URISyntaxException的解决办法
2009.0713
insert 触发器
CREATE TRIGGER [change_view_tDBDes_when_insert] ON [dbo].[tDBDes]
FOR INSERT
AS
declare @db varchar(255)
declare @sql1 nvarchar(4000), @sql2 nvarchar(4000), @sql3 nvarchar(4000), @sql4 nvarchar(4000), @sql5 nvarchar(4000), @sql6 nvarchar(4000), @sql7 nvarchar(4000)
declare @name1 varchar(255), @name_table varchar(255)
set @name1 = (select name1 from inserted)
set @db = substring(@name1,7,len(@name1)-6)
if(substring(@name1,7,1)=3) set @name_table='tAJB_UID'
else set @name_table='tYHXX'
set @sql1='create view v1_'+@db+' as '
set @sql2='create view v2_'+@db+' as '
set @sql3='create view v3_'+@db+' as '
set @sql4='create view v4_'+@db+' as '
set @sql5='create view v5_'+@db+' as '
set @sql6='create view v6_'+@db+' as '
set @sql7='create view v7_'+@db+' as '
if(substring(@db,1,1)=1)
begin
set @sql1=@sql1+'(SELECT a.*,UIDS,YHMC,YHDZ,EMAIL,YHZT,comment,JJLJHM,short_address,convert(char(20),CJSJ,120) CJSJ1,convert(char(20),ZHXGSJ,120) ZHXGSJ1,convert(char(20),ZHCSSJ,120) ZHCSSJ1,'''' reserved1,b.handlePlan as uidHandlepLan '
set @sql1=@sql1+' FROM vYH a,'+@name1+'.dbo.'+@name_table+' b'
set @sql1=@sql1+' WHERE a.UID=b.UID)'
end
else if(substring(@db,1,1)=3)
begin
set @sql1=@sql1+'(SELECT a.*,UIDS,YHMC,YHDZ,EMAIL,YHZT,comment,'''' JJLJHM,short_address,convert(char(20),CJSJ,120) CJSJ1,convert(char(20),ZHXGSJ,120) ZHXGSJ1,convert(char(20),ZHCSSJ,120) ZHCSSJ1,c.reserved1,b.handlePlan as uidHandlepLan, d.PlanDescription as uidPlanDescription '
set @sql1=@sql1+' FROM vYH a inner join '+@name1+'.dbo.'+@name_table+' b on a.UID=b.UID left join CACDB_'+@db+'.dbo.userinfo c'
set @sql1=@sql1+' on substring(b.UID,11,10)=substring(c.id,1,10) left join tPlanManager d on d.PlanID =b.handlePlan)'
end
else
begin
set @sql1=@sql1+'(SELECT a.*,UIDS,YHMC,YHDZ,EMAIL,YHZT,comment,'''' JJLJHM,short_address,convert(char(20),CJSJ,120) CJSJ1,convert(char(20),ZHXGSJ,120) ZHXGSJ1,convert(char(20),ZHCSSJ,120) ZHCSSJ1,'''' reserved1,b.handlePlan as uidHandlepLan,c.PlanDescription as uidPlanDescription'
set @sql1=@sql1+' FROM vYH a inner join '+@name1+'.dbo.'+@name_table+' b'
set @sql1=@sql1+' on a.UID=b.UID left join tPlanManager c on c.PlanID =b.handlePlan)'
end
set @sql2=@sql2+'(select pre_UID,a.address,description,a.handlePlan,d.PlanDescription,c.UID,YHZT,comment'
set @sql2=@sql2+' from tArea a inner join '+@name1+'.dbo.'+@name_table+' c'
set @sql2=@sql2+' on a.pre_UID='''+substring(@name1,7,len(@name1)-6)+''' left join tPlanManager d on d.PlanID=a.handlePlan)'
set @sql3=@sql3+'(select a.YHDZ UID_Address, a.short_address, a.UID'
set @sql3=@sql3+' from '+@name1+'.dbo.'+@name_table+' a)'
set @sql4=@sql4+'(select a.id operator_id,a.loginId loginId,b.*,convert(char(20),AlarmDateTime,120) AlarmDateTime1'
set @sql4=@sql4+' from CACDB_User_Log.dbo.Handle_Alarm_Log_'+@db+' b left join tOperator a '
set @sql4=@sql4+' on b.Handler_ID=a.id)'
set @sql5=@sql5+'(select a.UID,a.monitor_id,a.mainAccount'
set @sql5=@sql5+' from '+@name1+'.dbo.tUser_Monitor a, CACDB_S1000.dbo.vYH b'
set @sql5=@sql5+' where a.isMonitor=1 and a.UID=b.UID and b.ifMonitor=2)'
set @sql5=@sql5+' union all (select a.UID,b.id,0 from '+@name1+'.dbo.'+@name_table+' a, CACDB_S6000.dbo.tMonitor b, t_c6101group_Area c, t_c6101group_monitor d where c.area_id='''+substring(@name1,7,len(@name1)-6)+''' and c.group_id=d.group_id and d.monitor_id=b.id)'
set @sql6=@sql6+'(select a.UID,a.monitor_id,a.mainAccount'
set @sql6=@sql6+' from '+@name1+'.dbo.tUser_Monitor a, CACDB_S1000.dbo.vYH b'
set @sql6=@sql6+' where a.UID=b.UID and b.ifMonitor=2)'
set @sql6=@sql6+' union all (select a.UID,b.id,0 from '+@name1+'.dbo.'+@name_table+' a, CACDB_S6000.dbo.tMonitor b, t_c6101group_Area c, t_c6101group_monitor d where c.area_id='''+substring(@name1,7,len(@name1)-6)+''' and c.group_id=d.group_id and d.monitor_id=b.id)'
--add by locker v7
if(substring(@db,1,1)='5')
begin
set @sql7=@sql7+'(SELECT a.c_hsb_cs_id as smasId,a.c_state,a.c_ser_healthchkintervalsecond,a.c_proxy_ip,a.c_register_ip,c.YHMC,c.YHZT,c.JJLJHM,c.UIDLevel,c.sendInfoToRelatedPerson,c.RelationCamer,d.* '
set @sql7=@sql7+' FROM '+@name1+'.dbo.mst_hsbpara a INNER JOIN ' + @name1 +'.dbo.'+@name_table+' c ON c.hsb_userid = a.c_hsb_cs_id inner join vYH d on d.UID=c.UID)'
exec(@sql7)
end
exec(@sql1)
exec(@sql2)
exec(@sql3)
exec(@sql4)
exec(@sql5)
exec(@sql6)
declare x cursor for select name1 from tDBDes
open x
set @sql1='alter view vUser as '
set @sql2='alter view vArea as '
set @sql3='alter view v_UID_address as '
set @sql4='alter view vAlarmLog_operator as '
set @sql5='alter view vUID_Monitor as '
set @sql6='alter view vUID_Monitor_All as '
set @sql7='alter view v_SmasIDtoUser as '
fetch next from x into @name1
while(@@FETCH_STATUS=0)
begin
set @db = substring(@name1,7,len(@name1)-6)
set @sql1=@sql1+'(select * from v1_'+@db+')'
set @sql1=@sql1+' UNION ALL '
set @sql2=@sql2+'(select * from v2_'+@db+')'
set @sql2=@sql2+' UNION ALL '
set @sql3=@sql3+'(select * from v3_'+@db+')'
set @sql3=@sql3+' UNION ALL '
set @sql4=@sql4+'(select * from v4_'+@db+')'
set @sql4=@sql4+' UNION ALL '
set @sql5=@sql5+'(select * from v5_'+@db+')'
set @sql5=@sql5+' UNION ALL '
set @sql6=@sql6+'(select * from v6_'+@db+')'
set @sql6=@sql6+' UNION ALL '
print @db
if(substring(@db,1,1)='5') set @sql7=@sql7+'(select * from v7_'+@db+')' + ' UNION ALL '
fetch next from x into @name1
end
close x
deallocate x
set @sql1=substring(@sql1,1,len(@sql1)-10)
set @sql2=substring(@sql2,1,len(@sql2)-10)
set @sql3=substring(@sql3,1,len(@sql3)-10)
set @sql4=substring(@sql4,1,len(@sql4)-10)
set @sql5=substring(@sql5,1,len(@sql5)-10)
set @sql6=substring(@sql6,1,len(@sql6)-10)
set @sql7=substring(@sql7,1,len(@sql7)-10)
print @sql7
exec(@sql1)
exec(@sql2)
exec(@sql3)
exec(@sql4)
exec(@sql5)
exec(@sql6)
exec(@sql7)
删除触发器
CREATE TRIGGER [change_view_tDBDes_when_delete] ON [dbo].[tDBDes]
FOR DELETE
AS
declare @db varchar(255)
declare @sql1 nvarchar(4000), @sql2 nvarchar(4000), @sql3 nvarchar(4000), @sql4 nvarchar(4000), @sql5 nvarchar(4000), @sql6 nvarchar(4000), @sql7 nvarchar(4000)
declare @name1 varchar(255), @name_table varchar(255)
declare @viewName1 varchar(255),@viewName2 varchar(255),@viewName3 varchar(255),@viewName4 varchar(255),@viewName5 varchar(255),@viewName6 varchar(255),@viewName7 varchar(255)
set @name1 = (select name1 from deleted)
set @db = substring(@name1,7,len(@name1)-6)
if(substring(@name1,7,1)=3) set @name_table='tAJB_UID'
else set @name_table='tYHXX'
set @sql1='drop view v1_'+@db
set @sql2='drop view v2_'+@db
set @sql3='drop view v3_'+@db
set @sql4='drop view v4_'+@db
set @sql5='drop view v5_'+@db
set @sql6='drop view v6_'+@db
set @sql7='drop view v7_'+@db
set @viewName1 = 'v1_'+@db
set @viewName2 = 'v2_'+@db
set @viewName3 = 'v3_'+@db
set @viewName4 = 'v4_'+@db
set @viewName5 = 'v5_'+@db
set @viewName6 = 'v6_'+@db
set @viewName7 = 'v7_'+@db
if exists (select * from sysobjects where name=''+@viewName1)
exec(@sql1)
if exists (select * from sysobjects where name=''+@viewName2)
exec(@sql2)
if exists (select * from sysobjects where name=''+@viewName3)
exec(@sql3)
if exists (select * from sysobjects where name=''+@viewName4)
exec(@sql4)
if exists (select * from sysobjects where name=''+@viewName5)
exec(@sql5)
if exists (select * from sysobjects where name=''+@viewName6)
exec(@sql6)
if exists (select * from sysobjects where name=''+@viewName7)
exec(@sql7)
--print 'aa'
declare x cursor for select name1 from tDBDes
open x
set @sql1='alter view vUser as '
set @sql2='alter view vArea as '
set @sql3='alter view v_UID_address as '
set @sql4='alter view vAlarmLog_operator as '
set @sql5='alter view vUID_Monitor as '
set @sql6='alter view vUID_Monitor_All as '
set @sql7='alter view v_SmasIDtoUser as '
fetch next from x into @name1
while(@@FETCH_STATUS=0)
begin
set @db = substring(@name1,7,len(@name1)-6)
set @sql1=@sql1+'(select * from v1_'+@db+')'
set @sql1=@sql1+' UNION ALL '
set @sql2=@sql2+'(select * from v2_'+@db+')'
set @sql2=@sql2+' UNION ALL '
set @sql3=@sql3+'(select * from v3_'+@db+')'
set @sql3=@sql3+' UNION ALL '
set @sql4=@sql4+'(select * from v4_'+@db+')'
set @sql4=@sql4+' UNION ALL '
set @sql5=@sql5+'(select * from v5_'+@db+')'
set @sql5=@sql5+' UNION ALL '
set @sql6=@sql6+'(select * from v6_'+@db+')'
set @sql6=@sql6+' UNION ALL '
if(substring(@db,1,1)='5') set @sql7=@sql7+'(select * from v7_'+@db+')' + ' UNION ALL '
fetch next from x into @name1
end
close x
deallocate x
set @sql1=substring(@sql1,1,len(@sql1)-10)
set @sql2=substring(@sql2,1,len(@sql2)-10)
set @sql3=substring(@sql3,1,len(@sql3)-10)
set @sql4=substring(@sql4,1,len(@sql4)-10)
set @sql5=substring(@sql5,1,len(@sql5)-10)
set @sql6=substring(@sql6,1,len(@sql6)-10)
set @sql7=substring(@sql7,1,len(@sql7)-10)
exec(@sql1)
exec(@sql2)
exec(@sql3)
exec(@sql4)
exec(@sql5)
exec(@sql6)
exec(@sql7)
发表评论
-
实现Applet与Servlet之间进行通讯的简单实例
2011-08-09 21:36 2993Servlet传送查询记录集给Applet 这篇文章是继< ... -
js 表单使用总结 jackey
2010-05-26 15:51 20961 javascript刷新页面 ... -
javascript的子窗口和父窗口的传值与刷新
2010-02-21 18:04 3188另存为子窗口 <!DOCTYPE HTML PUB ... -
showModalDialog参数使用详解
2010-02-04 19:24 1625showModalDialog:模式窗 ... -
Log4j配置文件的示例_jackey
2010-02-03 13:05 2032引子: 最近老是用到log4j的东西,我想这样优秀的一个 ... -
实现数据库中的数据(db data)转化成document文档 实现jdbc批量插入数据
2010-01-28 16:36 1741package com.test; import java. ... -
Ajax实现文件上传 jackey 好方法
2010-01-19 11:02 8303首先要说的就是 ajax 是无法实现上传文件的,可以想一下aj ... -
js控制select的option
2010-01-05 15:15 5759js控制select的option JS sele ... -
Windows下Apache+Tomcat+MySQL+jsp+php的服务器整合配置
2009-09-29 14:30 2523所需软件 (1) j2sdk- ... -
Windows下Apache+Tomcat+MySQL+jsp+php的服务器整合配置
2009-09-29 14:22 3859所需软件(1) j2sdk-1_4_2-win ... -
EL表达式 (详解)
2009-09-12 02:59 8248EL表达式 1、EL简介1)语法结构 ... -
在Tomcat中部署Web程序的几种方式
2009-09-10 18:36 20348在Tomcat中部署Java Web应用程序有两种方式:静态部 ... -
window xp Service pack 2+ iis 5.1+tomcat-5.5.27 +jdk1.5.0_08
2009-08-07 23:34 4257xp下整合IIS和tomcat ... -
使用IIS+Tomcat6.0将JSP网站发布到Internet
2009-08-07 10:40 5787使用IIS+Tomcat6.0将JS ... -
Spring整合第三方MVC框架的通用配置
2009-08-06 17:55 1583Spring整合第三方MVC框架的通用配置 ... -
常见错误解决方案
2009-08-06 14:33 17801. sql server 错误签名 ISQL/w - ... -
dwr spring 如何配置
2009-08-06 13:57 2751DWR和Spring 让DWR和Spring一起工作的步 ... -
java 遍历map 方法 集合 jackey
2009-08-02 12:02 29659package com.jackey.topic; impo ... -
JSON 入门指南 jackey
2009-07-29 16:43 1338JSON 即 JavaScript Object Natati ... -
Eclipse插件的安装有两种方法 ___jackey
2009-07-29 14:06 1334Eclipse插件的安装有两种 ...
相关推荐
根据提供的文件信息,我们可以梳理出以下几个关键的知识点: ### SQL语句:创建表与主键定义 #### 创建表 `dc`: ```sql CREATE TABLE dc ( tid NUMBER(10) NOT NULL, tname VARCHAR(10), taddress VARCHAR(10)...
[企业政府]Jacky法律在线网站源码_falv.zip源码ASP.NET网站源码打包下载[企业政府]Jacky法律在线网站源码_falv.zip源码ASP.NET网站源码打包下载[企业政府]Jacky法律在线网站源码_falv.zip源码ASP.NET网站源码打包...
"最简单的飞信工具 by jacky_luo"表明这是一个由用户jacky_luo开发的简化版或优化版飞信工具,可能是为了提高用户体验或者增加某些特定功能。 在描述中,我们看到的信息与标题相同,进一步确认这是一个由jacky_luo...
AppSec EU 2016 大会上,Jacky Fox,Deloitte Ireland 的 Cyber & IT Forensic 领导者,就“Women in Cyber Security”发表了演讲,探讨了性别与网络安全的关系以及如何吸引并保留女性人才在这一领域。 首先,Jacky...
Jacky的打飞机游戏 已在Eclipse能运行,含有APK文件 感谢Jacky的教程 和 他的源码,嘿嘿!! 在此附上他的博客地址 ,一起支持他http://blog.csdn.net/jackystudio/article/category/1591201
这个名为"Jacky_Dai.rar_解方程_解方程组_高斯消去法"的压缩包文件似乎包含了使用VC++编程语言实现的高斯消去法程序,它可以帮助我们理解如何通过编程来解决数学中的线性系统问题。 高斯消去法,又称为高斯简化法,...
这个光盘版的内存检测工具包含多个版本,如memtest JACKY版2.1和4.2,以及RST(可能是指RAID Storage Technology)相关的功能。这些工具都是专门设计用来测试内存条的稳定性、兼容性和错误率的。 首先,让我们详细...
本项目“winform_ftp_v2.0_jacky20200126”提供了一个完整的FTP客户端源码,支持文件的上传、下载以及列出文件和目录列表功能,特别适合初学者或开发者作为参考和学习。下面将对该项目的核心知识点进行深入讲解。 ...
这个“Jacky法律在线网站源码”是一个使用ASP.NET技术开发的法律咨询服务网站的完整源代码,旨在帮助开发者理解如何在实际项目中应用ASP.NET进行网页设计和功能实现。 1. ASP.NET框架基础: ASP.NET提供了丰富的...
这个压缩包"ASP.NET源码——[企业]Jacky法律在线网站源码.zip"包含了构建一个企业级法律在线服务平台的源代码,我们可以从中学习和理解ASP.NET在实际项目中的应用。 首先,ASP.NET的核心组件包括ASP.NET Web Forms...
在Jacky_dai的这篇博客文章中,涵盖了多个C++编程和Windows开发的相关知识点,包括标准模板库(STL)的List、内联函数与宏定义的对比、宏的巧妙使用、Windows Template Library(WTL)的学习资源、报文传输中的进制转换...
「安全管理」AppSecEU2016-Jacky-Fox-Women-in-Cyber - NGFW 安全建设 安全方案 数据库审计 系统安全 NGFW
这是一个Eclipse使用的基础篇,适合于刚开始接触Eclipse的朋友们学习。
shopOfSweets_jacky415 shopOfSweets_jacky415shopOfSweets_jacky415 ---关于糖果店的多彩网站,使用了Bootstrap
这篇文章通过Jacky的分享,探讨了如何将软件UX模型应用于硬件产品,以提高其用户体验。 首先,我们要明确用户体验的基本概念。UX不仅关乎产品的功能性,还涉及到用户的情感反应和满意度。传统上,可用性工程(UE)...
源码参考,欢迎下载
【Symantec云安全解决方案】 在当今数字化转型的时代,云计算已经成为了企业信息化的重要支柱,但同时也带来了新的安全挑战。Symantec作为一家知名的网络安全公司,提供了全面的云安全解决方案来帮助企业应对这些...
【标题】"jacky415.github.io:jacky415.github.io ---我的个人网站-我的投资组合; 网站重塑计划" 暗示这是一个关于个人网站的项目,其中包含了用户的投资组合展示,并且正在进行网站的更新或改造。这个项目很可能是...
前言前面几篇我们就 Redux 展开了几篇文章,这次我们来实现 react-thunk,就不是叫实现 redux-thunk 了,直接上源码,因为源码就 11